1 Reply Latest reply on May 30, 2006 8:53 AM by Peter Klauser

    Problem hot-deploying EJB/Spring/Hibernate app on JBoss 4.0.

    msmolyak Newbie

      Hello,

      I have an application which uses Hibernate in the data access tier fronted with Spring DAOs. On top of this standard architecture I added a thin EJB layer: Stateless Session EJBs wrapping the Spring business objects. The application deploys and runs fine. I am able to run a client Java program calling a method on a session bean which works correctly.

      When I try to redeploy this application without restarting JBoss, and run my client again I get the error below. Restarting the server fixes the problem.

      Any help in resolving the hot deployment issue is greatly appreciated.

      Michael Smolyak

      17:19:27,684 INFO [STDOUT] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'CruiseSessionFactory' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Cannot configure CacheManager: null
      17:19:27,731 INFO [STDOUT] org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Cannot configure CacheManager: null
      at org.hibernate.cache.EhCacheProvider.start(EhCacheProvider.java:127)
      at org.hibernate.impl.SessionFactoryImpl.(SessionFactoryImpl.java:167)
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:767)
      at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:693)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1003)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:348)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:176)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:105)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:957)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:768)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:330)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:317)
      at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:80)
      at org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:65)
      at org.springframework.context.access.ContextJndiBeanFactoryLocator.createBeanFactory(ContextJndiBeanFactoryLocator.java:86)
      at org.springframework.context.access.ContextJndiBeanFactoryLocator.useBeanFactory(ContextJndiBeanFactoryLocator.java:70)
      at org.springframework.ejb.support.AbstractEnterpriseBean.loadBeanFactory(AbstractEnterpriseBean.java:117)
      at org.springframework.ejb.support.AbstractStatelessSessionBean.ejbCreate(AbstractStatelessSessionBean.java:63)
      at com.jetson.test.biz.CustomerManagerBean.ejbCreate(CustomerManagerBean.java:58)
      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.ejb.StatelessSessionEnterpriseContext.(StatelessSessionEnterpriseContext.java:63)
      at org.jboss.ejb.plugins.StatelessSessionInstancePool.create(StatelessSessionInstancePool.java:35) at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:161) at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:78)

        • 1. Re: Problem hot-deploying EJB/Spring/Hibernate app on JBoss
          Peter Klauser Newbie

          i am experiencing this problem too. I have jBoss4.0.3SP1 and my spring configuration of the session factory is below. On hot (re)deployment, the exception is thrown on startup saying that the cache manager lookup returns (null) etc. etc. Rebooting the server works! I think its likely a classpath / classloader issue. Reflection is not managing to instantiate either org.hibernate.transaction.JBossTransactionManagerLookup or it is not managing itself to instantiate something. Any ideas or solutions anyone?







          org.hibernate.dialect.Oracle9Dialect
          org.hibernate.cache.EhCacheProvider
          ppf.SessionFactory
          true
          org.hibernate.transaction.JTATransactionFactory
          org.hibernate.transaction.JBossTransactionManagerLookup
          true
          after_statement