All,
The platform is Hibernate3 with MySQL2000 database and Jboss 4.0.2. Our application holds multiple databases (thereby multiple datasources configured in JNDI) and numerous ear files deployed and are linked internally by building requisite jars into each other.
We are encountering this exception when the sessionFactory is first created. It seems like on server startup 2 different scheduler threads from different modules (ears/wars) are trying to initialize the sessionFactory which I presume creates the ehcaches as well. Due to race condition, it tries to duplicate the ehcache cache creation.
Question:
Is sessionFactory created at classloader level or at JVM level?. since we have many application modules (ears,wars), how is sessionFactory setup to be visible to all apps/classloaders?
org.hibernate.HibernateException: Could not instantiate cache implementation
at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:64)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:214)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at com.xxx.utils.HibernateContainerUtil.openSession(HibernateContainerUtil.java:99)
at com.xxx.ldap.ejb.LDAPFacadeBean.findUserByUserName(LDAPXxxBean.java:250)
at com.xxx.ldap.ejb.LDAPFacadeBean.findUserByUserName(LDAPFacadeBean.java:218)
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.invocation.Invocation.performCall(Invocation.java:345)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
at org.jboss.ejb.Container.invoke(Container.java:873)
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.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
at org.jboss.invocation.InvokerInterceptor.invokeMarshalled(InvokerInterceptor.java:201)
at org.jboss.invocation.MarshallingInvokerInterceptor.invoke(MarshallingInvokerInterceptor.java:35)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
at $Proxy143.findUserByUserName(Unknown Source)
at com.xxx.ldap.LDAPFacadeDelegateRemoteImpl.findUserByUserName(LDAPFacadeDelegateRemoteImpl.java:84)
at com.xxx.notifications.Notification.getUserFromLDAPFacade(Notification.java:360)
at com.xxx.notifications.Notification.notifyUsers(Notification.java:260)
at com.xxx.notifications.WorkSummaryEmailNotification.execute(WorkSummaryEmailNotification.java:46)
at com.xxx.jobs.WorkSummaryEmailJob.execute(WorkSummaryEmailJob.java:45)
at org.quartz.core.JobRunShell.run(JobRunShell.java:151)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:466)
Caused by: org.hibernate.cache.CacheException: net.sf.ehcache.ObjectExistsException: Cache com.xxx.xx.domain.User already exists
at net.sf.ehcache.hibernate.SingletonEhCacheProvider.buildCache(SingletonEhCacheProvider.java:99)
at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:61)
... 48 more
Caused by: net.sf.ehcache.ObjectExistsException: Cache com.xxx.xx.domain.User already exists
at net.sf.ehcache.CacheManager.addCache(CacheManager.java:492)
at net.sf.ehcache.hibernate.SingletonEhCacheProvider.buildCache(SingletonEhCacheProvider.java:93)
... 49 more
|