Announcement Announcement Module
Collapse
No announcement yet.
Instantiation of bean failed Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Instantiation of bean failed

    Hi,

    I am trying to deploy my application on an OpenSuse 11 box with Tomcat 6.0.29. I'm using Oracle10g. But when I try and start my application, I get the following error:

    2010-11-12 13:08:28,935 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.instantiateBean(AbstractAutowireCapableBea nFactory.java:965)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.createBeanInstance(AbstractAutowireCapable BeanFactory.java:911)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.doCreateBean(AbstractAutowireCapableBeanFa ctory.java:485)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBean
    Factory.createBean(AbstractAutowireCapableBeanFact ory.java:456)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getOb
    ject(AbstractBeanFactory.java:291)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistr
    y.getSingleton(DefaultSingletonBeanRegistry.java:2 22)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBe
    an(AbstractBeanFactory.java:288)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean
    (AbstractBeanFactory.java:190)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.
    preInstantiateSingletons(DefaultListableBeanFactor y.java:580)
    at org.springframework.context.support.AbstractApplic ationContext.finish
    BeanFactoryInitialization(AbstractApplicationConte xt.java:895)
    at org.springframework.context.support.AbstractApplic ationContext.refres
    h(AbstractApplicationContext.java:425)
    at org.springframework.web.context.ContextLoader.crea teWebApplicationCon
    text(ContextLoader.java:276)
    at org.springframework.web.context.ContextLoader.init WebApplicationConte
    xt(ContextLoader.java:197)

    What is curious is that when I try and deploy the same .war on a Windows Server 2003 box, it works fine.

    My applicationContext.xml is attached and the definition of the db connection looks fine to me.

    Any ideas?

    Thanx

  • #2
    I am trying to deploy my application on an OpenSuse 11 box with Tomcat 6.0.29
    OK

    <property name="url" value="jdbc:oracle:thin:@redesbd01:1546:ROPERA"/>
    Linux has more strict control about ports and network access than Windows, try turning down the firewall and start the tomcat

    use code tags, BTW is the complete error stack trace?

    Comment


    • #3
      Bean failure

      Hi,

      The firewall is switched off already.

      I don't understand what you mean by 'use tags'.

      The complete error stack is:

      2010-12-10 12:25:35,326 [main] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
      org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:965)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBeanInstance(Abst ractAutowireCapableBeanFactory.java:911)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:485)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 91)
      at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
      at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:288 )
      at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:190)
      at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:580)
      at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:895)
      at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:425)
      at org.springframework.web.context.ContextLoader.crea teWebApplicationContext(ContextLoader.java:276)
      at org.springframework.web.context.ContextLoader.init WebApplicationContext(ContextLoader.java:197)
      at org.springframework.web.context.ContextLoaderListe ner.contextInitialized(ContextLoaderListener.java: 47)
      at org.apache.catalina.core.StandardContext.listenerS tart(StandardContext.java:4135)
      at org.apache.catalina.core.StandardContext.start(Sta ndardContext.java:4630)
      at org.apache.catalina.core.ContainerBase.addChildInt ernal(ContainerBase.java:791)
      at org.apache.catalina.core.ContainerBase.addChild(Co ntainerBase.java:771)
      at org.apache.catalina.core.StandardHost.addChild(Sta ndardHost.java:546)
      at org.apache.catalina.startup.HostConfig.deployWAR(H ostConfig.java:905)
      at org.apache.catalina.startup.HostConfig.deployWARs( HostConfig.java:740)
      at org.apache.catalina.startup.HostConfig.deployApps( HostConfig.java:500)
      at org.apache.catalina.startup.HostConfig.start(HostC onfig.java:1277)
      at org.apache.catalina.startup.HostConfig.lifecycleEv ent(HostConfig.java:321)
      at org.apache.catalina.util.LifecycleSupport.fireLife cycleEvent(LifecycleSupport.java:119)
      at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1053)
      at org.apache.catalina.core.StandardHost.start(Standa rdHost.java:785)
      at org.apache.catalina.core.ContainerBase.start(Conta inerBase.java:1045)
      at org.apache.catalina.core.StandardEngine.start(Stan dardEngine.java:445)
      at org.apache.catalina.core.StandardService.start(Sta ndardService.java:519)
      at org.apache.catalina.core.StandardServer.start(Stan dardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalin a.java:581)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:45)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:37)
      at java.lang.reflect.Method.invoke(Method.java:599)
      at org.apache.catalina.startup.Bootstrap.start(Bootst rap.java:289)
      at org.apache.catalina.startup.Bootstrap.main(Bootstr ap.java:414)
      Caused by: java.lang.ExceptionInInitializerError
      at java.lang.J9VMInternals.initialize(J9VMInternals.j ava:222)
      at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:45)
      at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:39)
      at java.lang.reflect.Constructor.newInstance(Construc tor.java:515)
      at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:126)
      at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:74)
      at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:958)
      ... 37 more
      Caused by: java.util.ConcurrentModificationException
      at java.util.AbstractList$SimpleListIterator.next(Abs tractList.java:64)
      at java.sql.DriverManager.getDrivers(DriverManager.ja va:412)
      at org.apache.commons.dbcp.BasicDataSource.<clinit>(B asicDataSource.java:57)
      at java.lang.J9VMInternals.initializeImpl(Native Method)
      at java.lang.J9VMInternals.initialize(J9VMInternals.j ava:200)
      ... 44 more
      10-dic-2010 12:25:35 org.apache.catalina.core.StandardContext start
      SEVERE: Error listenerStart
      10-dic-2010 12:25:35 org.apache.catalina.core.StandardContext start
      SEVERE: Falló en arranque del Contexto [/reporte] debido a errores previos
      10-dic-2010 12:25:35 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
      SEVERE: The web application [/reporte] registered the JBDC driver [oracle.jdbc.driver.OracleDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
      10-dic-2010 12:25:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
      SEVERE: The web application [/reporte] appears to have started a thread named [Thread-12] but has failed to stop it. This is very likely to create a memory leak.
      log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.

      Thanx

      Comment


      • #4
        I don't understand what you mean by 'use tags'.
        OK, when you have some code to show it must be wrapped between
        <code></code> replace < by [ and > by ] to have more readable material

        Code:
        Caused by: java.lang.ExceptionInInitializerError
        at java.lang.J9VMInternals.initialize(J9VMInternals.j ava:222)
        at sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:45)
        at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:39)
        at java.lang.reflect.Constructor.newInstance(Construc tor.java:515)
        at org.springframework.beans.BeanUtils.instantiateCla ss(BeanUtils.java:126)
        at org.springframework.beans.factory.support.SimpleIn stantiationStrategy.instantiate(SimpleInstantiatio nStrategy.java:74)
        at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.instantiateBean(Abstrac tAutowireCapableBeanFactory.java:958)
        ... 37 more
        Caused by: java.util.ConcurrentModificationException
        at java.util.AbstractList$SimpleListIterator.next(Abs tractList.java:64)
        at java.sql.DriverManager.getDrivers(DriverManager.ja va:412)
        at org.apache.commons.dbcp.BasicDataSource.<clinit>(B asicDataSource.java:57)
        at java.lang.J9VMInternals.initializeImpl(Native Method)
        at java.lang.J9VMInternals.initialize(J9VMInternals.j ava:200)
        ... 44 more
        Mmmm

        I see you have your tomcat in spanish
        Code:
        10-dic-2010 12:25:35 org.apache.catalina.core.StandardContext start
        SEVERE: Error listenerStart
        10-dic-2010 12:25:35 org.apache.catalina.core.StandardContext start
        SEVERE: Falló en arranque del Contexto [/reporte] debido a errores previos
        10-dic-2010 12:25:35 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
        SEVERE: The web application [/reporte] registered the JBDC driver[oracle.jdbc.driver.OracleDriver] 
        but failed to unregister it when the web application was stopped. 
        To prevent a memory leak, the JDBC Driver has been forcibly unregistered. 
        10-dic-2010 12:25:35 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
        SEVERE: The web application [/reporte] appears to have started a thread named [Thread-12] 
        but has failed to stop it. This is very likely to create a memory leak.
        log4j:ERROR LogMananger.repositorySelector was null likely due to error in class reloading, using NOPLoggerRepository.
        The bold part are interesting, in your tomcat's logs directory
        attach the two log files catalina-xxxx.log and localhost.-xxxx.log here

        Comment


        • #5
          Catalina and Localhost logs

          Here are the logs:

          I had to change the extensiones to .txt 'cos this URL does not accept .log files.



          P.S. My tomcat is in Spanish 'cos I am in Madrid, Spain.
          Last edited by jpatel; Dec 13th, 2010, 02:29 AM. Reason: additional data.

          Comment


          • #6
            Did you read your catalina.2010-12-10.log.txt file?

            you have problems not related with Spring

            Code:
            10-dic-2010 12:25:32 org.apache.catalina.loader.WebappClassLoader validateJarFile
            INFO: validateJarFile(/opt/apache-tomcat-6.0.29/webapps/reporte/WEB-INF/lib/gwt-dev.jar) - 
            jar not loaded. See Servlet Spec 2.3, section 9.7.2. 
            Offending class: javax/servlet/Servlet.class
            
            10-dic-2010 12:25:32 org.apache.catalina.loader.WebappClassLoader validateJarFile
            INFO: validateJarFile(/opt/apache-tomcat-6.0.29/webapps/reporte/WEB-INF/lib/gwt-user.jar) - 
            jar not loaded. See Servlet Spec 2.3, section 9.7.2. 
            Offending class: javax/servlet/Servlet.class
            10-dic-2010 12:25:35 org.apache.catalina.core.StandardContext start
            SEVERE: Error listenerStart
            In your war project be sure to not include two .jars already included in your Tomcat's lib directory, they should be something related with
            servlet***.jar and jsp***.jar

            You have a weird error
            Code:
            SEVERE: Error arrancando Recursos estticos
            Throwable occurred: java.lang.IllegalArgumentException: 
            El Documento base /opt/apache-tomcat-6.0.29/webapps/sgnd-job 
            no existe o no es un directorio legible
            	at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:142)
            did you delete the directory?

            HTH

            Comment


            • #7
              reporte project

              Hi Dr_pompeii,

              In the first case, I googled 'gwt-dev.jar' error and it said that it was not important because this .jar is already included in the JDK files. So this message maybe ignored.

              The directory 'sgnd-job' is not important at this moment because it is for another project. My project is 'reporte'. This is the one giving me so much problems about the 'dataSource' bean instantiation.

              Could it have something to do with the version of Tomcat?

              Saludos

              Jay

              Comment

              Working...
              X