12 Replies Latest reply on Jan 7, 2006 6:49 PM by Philip Ives

    4.0.2 and Spring and hot deployment of SLSB

    Chris Gummer Newbie

      We've just updgraded from jboss 4.0.0 to 4.0.2.

      Previously in 4.0.0 hot deployment was working fine, but now it fails. When hot deploying the bean, the deployment seems fine. But when attempting to create it, everything falls over. Here is the relevant stack trace:

      10:21:41,256 INFO [SessionFactoryImpl] building session factory
      10:21:41,271 WARN [Configurator] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: null
      10:21:41,271 INFO [DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [...]; root of BeanFactory hierarchy}
      10:21:41,271 INFO [DefaultListableBeanFactory] Destroying singletons in factory {org.springframework.beans.factory.support.DefaultListableBeanFactory defining beans [...]; root of BeanFactory hierarchy}
      10:21:41,287 ERROR [LogInterceptor] EJBException in method: public abstract com.some.Bean com.some.BeanHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException:
      javax.ejb.EJBException: Could not instantiate bean
       at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:180)
       at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:78)
       at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
       at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
       at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
       at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
       at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
       at org.jboss.ejb.Container.invoke(Container.java:894)
       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:324)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
       at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
       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:324)
       at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
       at sun.rmi.transport.Transport$1.run(Transport.java:148)
       at java.security.AccessController.doPrivileged(Native Method)
       at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
       at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:534)

      The interesting part is that it appears ehcache can't find its failsafe .xml. However, it is in the ehcache jar, so I can't figure out why it won't pick it up. When doing a fresh start of jboss, this file is picked up fine.

      After ehcache fails all the spring beans are destroyed and I'm guessing this is why the create of the bean fails.

      We are using Spring's SimpleRemoteStatelessSessionProxyFactoryBean to create the bean.

      Any help much appreciated.

        • 1. Re: 4.0.2 and Spring and hot deployment of SLSB
          worldheart Newbie

          where have you placed spring-related jars?

          • 2. Re: 4.0.2 and Spring and hot deployment of SLSB
            Chris Gummer Newbie

            They are in a jar file in the application's ear file. ehcache is also in a jar in the same ear.

            • 3. Re: 4.0.2 and Spring and hot deployment of SLSB
              Michael Newbie

              I just upgraded to 4.0.2 from 4.0.1 because my SAR was unable to load jdom.jar (issue with manifest in jdom, i found a forum thread on that..). That problem was fixed when i moved to 4.0.2, but now I'm also stuck on ehcache with a class not found error..
              my SAR has the jar.. see below..

              Caused by: java.lang.NoClassDefFoundError: net/sf/ehcache/Element
              at net.sf.ehcache.Cache.put(Cache.java:317)
              at org.hibernate.cache.EhCache.put(EhCache.java:153)
              at org.hibernate.cache.ReadOnlyCache.put(ReadOnlyCache.java:59)
              at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:126)
              at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:510)
              at org.hibernate.loader.Loader.doQuery(Loader.java:419)
              at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:210)
              at org.hibernate.loader.Loader.loadEntity(Loader.java:1311)
              at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:116)
              at org.hibernate.loader.entity.EntityLoader.load(EntityLoader.java:101)

              my SAR archive lhas the ehcache jar:
              [mmoores@localhost proto]$ jar -tf dist/canopic.sar
              META-INF/
              META-INF/MANIFEST.MF
              META-INF/jboss-service.xml
              c3p0-0.9.0-pre5.jar
              c3p0-oracle-thin-extras-0.9.0-pre5.jar
              commons-logging.jar
              ebi.jar
              jdom.jar
              junit.jar
              junitperf-1.9.1.jar
              log4j.jar
              ojdbc14.jar
              aopalliance.jar
              cglib-nodep-2.1.jar
              commons-collections.jar
              dom4j-1.6.jar
              spring-aop.jar
              spring.jar
              ehcache-1.1.jar
              hibernate3.jar
              canopic-common.jar
              canopic-shared.jar
              canopic-sar.jar

              • 4. Re: 4.0.2 and Spring and hot deployment of SLSB
                Tom Newbie

                These are probably all because you are using hibernate 2 and 4.0.2 upgraded to hibernate 3

                • 5. Re: 4.0.2 and Spring and hot deployment of SLSB
                  Chris Gummer Newbie

                   

                  "tomansley" wrote:
                  These are probably all because you are using hibernate 2 and 4.0.2 upgraded to hibernate 3


                  I'm using hibernate 3 and 4.0.2.

                  • 6. Re: 4.0.2 and Spring and hot deployment of SLSB
                    Reiner Kappenberger Newbie

                    I'm getting the exact same error in my application using 4.0.2. Using JBoss 3.2.6 everything is working fine in there. The problem occurs everytime the Session Bean is trying to access one of the CMP EJB's. Doesn't matter which one.

                    Any help is appreciated since I want to migrate over to the 4.0 release quickly.

                    • 7. Re: 4.0.2 and Spring and hot deployment of SLSB
                      Reiner Kappenberger Newbie

                      Sine there seems no reply to this thread a different approach might help.

                      Is there any tool available that can be used to validate the META files for correct syntax? I've used XDoclet to generate them, but experience has tought that there might be a couple of problems in there.

                      Such a tool could help eliminate those problems.

                      Thanks,
                      Reiner

                      • 8. Re: 4.0.2 and Spring and hot deployment of SLSB
                        w wright Newbie

                        I am seeing the same type of problem

                        I note that Cache provider: org.hibernate.cache.EhCacheProvider

                        with SessionFactory creation failed NoClassFound i.e. net/sf/ehcache/CacheException

                        I have just started looking into this...If I find it or if some one else finds it please post here.

                        • 9. Re: 4.0.2 and Spring and hot deployment of SLSB
                          w wright Newbie


                          I included the ehcache-1.1.jar in my xyz.ejb3 and progressed past the Exception Class not found net/sf/ehcache/CacheException

                          I found no reference to the cache in the xml config or away to disable the cache cache reference in the hibernate text....I suppose it uses it by default.

                          I will have to go back and research this later.



                          10:58:30,184 INFO [SettingsFactory] Cache provider: org.hibernate.cache.EhCacheProvider
                          10:58:30,194 INFO [STDOUT] Initial SessionFactory creation failed.java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException
                          10:58:30,202 INFO [STDOUT] java.lang.ExceptionInInitializerError
                          10:58:30,203 INFO [STDOUT] at com.rathlinfoyle.utils.HibernateUtil.(HibernateUtil.java:46)
                          10:58:30,203 INFO [STDOUT] at com.rathlinfoyle.svc.postal.PostalService.getStateAbbrvList(PostalService.java:113)
                          10:58:30,204 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)



                          after including the ehcache-1.1.jar

                          12:10:30,273 INFO [SettingsFactory] Default entity-mode: pojo
                          12:10:30,283 INFO [SessionFactoryImpl] building session factory
                          12:10:30,442 WARN [Configurator] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/opt/jboss-4.0.2/server/mybox/tmp/deploy/tmp20067Dallas.ejb3-contents/ehcache-1.1.jar!/ehcache-failsafe.xml
                          12:10:30,494 INFO [SessionFactoryObjectFactory] Factory name: java:hibernate/SessionFactory
                          12:10:30,495 INFO [NamingHelper] JNDI InitialContext properties:{}
                          12:10:30,497 INFO [NamingHelper] Creating subcontext: java:hibernate
                          12:10:30,498 INFO [SessionFactoryObjectFactory] Bound factory to JNDI name: java:hibernate/SessionFactory
                          12:10:30,500 WARN [SessionFactoryObjectFactory] InitialContext did not implement EventContext
                          12:10:30,500 INFO [SessionFactoryImpl] Checking 0 named queries
                          12:10:32,368 ERROR [PARSER] UsStates is not mapped.
                          12:10:32,446 INFO [STDOUT] javax.ejb.EJBException: null; CausedByException is:
                          UsStates is not mapped. [from UsStates]




                          So i have a couple of other confige issues.

                          • 10. Re: 4.0.2 and Spring and hot deployment of SLSB
                            w wright Newbie

                            I am using

                            jboss-ejb3 beta

                            jboss-4.0.2

                            • 11. Re: 4.0.2 and Spring and hot deployment of SLSB
                              w wright Newbie


                              Okay so the failsafe error is due to not having the ehcache.xml file also jar'd with my file. one more error gone. The ehcache.xml file is in the ehcache-1.1.tar.gz file. I just used it as is.

                              • 12. Re: 4.0.2 and Spring and hot deployment of SLSB
                                Philip Ives Newbie

                                I'm using hibernate in a war/ear inside of jboss and having the same problem. Where does that xml file go? at the root of the war or some INF directory?