Results 1 to 5 of 5
  1. #1
    amzeek is offline Member
    Join Date
    Mar 2011
    Posts
    3
    Rep Power
    0

    Default Spring exception org.springframework.beans.BeanInstantiationExcepti on

    Hello,

    On tomcat server start up, I get the following exception. Any input is appreciated.


    Java Code:
    o[B]rg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'uploadFileController' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.jpmam.client.smp.loader.web.UploadFileController]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError[/B]
    	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:254)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:823)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
    	at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:402)
    	at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:316)
    	at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:282)
    	at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:126)
    	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
    	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)
    	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)
    	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:519)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:592)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    Caused by: org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.jpmam.client.smp.loader.web.UploadFileController]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:115)
    	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
    	at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:248)
    	... 36 more
    Caused by: java.lang.NoClassDefFoundError
    	at com.jpmc.am.common.util.excel.XlsReader.loadAndConfigureProperties(XlsReader.java:58)
    	at com.jpmc.am.common.util.excel.XlsReader.init(XlsReader.java:50)
    	at com.jpmam.client.smp.loader.web.UploadFileController.<init>(UploadFileController.java:103)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    	at java.lang.reflect.Constructor.newInstance(Constructor.java:501)
    	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:100)
    	... 38 more
    Mar 15, 2011 1:14:34 PM org.apache.catalina.core.StandardContext loadOnStartup

  2. #2
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    Here is written "Caused by: java.lang.NoClassDefFoundError
    at com.jpmc.am.common.util.excel.XlsReader.loadAndCon figureProperties(XlsReader.java:58)"
    You just forget add some library's in classpath
    Skype: petrarsentev
    http://TrackStudio.com

  3. #3
    amzeek is offline Member
    Join Date
    Mar 2011
    Posts
    3
    Rep Power
    0

    Default

    Quote Originally Posted by Petr View Post
    Here is written "Caused by: java.lang.NoClassDefFoundError
    at com.jpmc.am.common.util.excel.XlsReader.loadAndCon figureProperties(XlsReader.java:58)"
    You just forget add some library's in classpath
    Hey Petr,
    Thanks for your reply.
    Line 58 of XlsReader.java is as follows:

    [CODE]
    final AbstractBoundXMLConfigFile configFile = XlsReaderConfigurationFile.getInstance();
    [CODE]


    It is mostly due to some missing jar reference. But I am not sure which jar is missing.

  4. #4
    Petr's Avatar
    Petr is offline Senior Member
    Join Date
    Jan 2011
    Location
    Russia
    Posts
    620
    Rep Power
    4

    Default

    Could you show your spring-app.xml? and How you build your app? Do you use a ant or maven tools?
    Skype: petrarsentev
    http://TrackStudio.com

  5. #5
    amzeek is offline Member
    Join Date
    Mar 2011
    Posts
    3
    Rep Power
    0

    Default

    I am using maven to build the app. The app builds fine, but on server startup this exception occurs.

    action-servlet.xml contains the following:

    <bean name="uploadFileController"
    class="com.jpmam.client.smp.loader.web.UploadFileC ontroller">
    <constructor-arg ref="loadDao" />
    <constructor-arg ref="domainValueDao" />
    <constructor-arg ref="sqlMapSDWIlfTpd" />
    <constructor-arg ref="sqlMapODSIlfTpd" />
    <constructor-arg ref="sqlMapCrossholdingDAO" />
    <constructor-arg ref="sqlMapFunddata" />
    <constructor-arg ref="sqlMapProfitability" />
    <constructor-arg ref="csvProcessor" />
    <property name="validator">
    <ref bean="uploadFileValidator" />
    </property>
    <property name="formView">
    <value>loader/uploadFile</value>
    </property>
    <property name="commandName">
    <value>selectFile</value>
    </property>
    </bean>

    and the corresponding mapping is:
    <prop key="loader/uploadFile.do">uploadFileController</prop>

Similar Threads

  1. Replies: 5
    Last Post: 02-17-2010, 07:40 PM
  2. How to make Beans Lazily-instantiating beans
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 03-30-2008, 10:10 AM
  3. What are Custom Scopes in SpringFramework
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 09-28-2007, 12:48 PM
  4. How to make Beans Lazily-instantiating beans
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 09-26-2007, 08:41 PM
  5. Replies: 1
    Last Post: 06-06-2007, 03:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •