When my Message Driven Bean gets activated during JBoss startup then i get "Could not instantiate bean" when it want to save the parsed data to the DB. The same happens to Session Beans which gets activated through the timerservice in restart time (in this case it's task is to localize old data and to delete it). Both Beans works very well when they get activated normally after JBoss has completely started.
With jboss-4.0.3SP1 i don't have those problems. In the case of the MDB following code is processed. The Exception occurt with the find instructions: | /** | * createEntity | * | * @param logItem LogItem | */ | private void createEntity(LogItem logItem) { | try { | CatComplexHome complexHome = (CatComplexHome) env.getHome(CatComplexHome.JNDI_HOME); | CatCpuHome cpuHome = (CatCpuHome) env.getHome(CatCpuHome.JNDI_HOME); | CatLogHome logHome = (CatLogHome) env.getHome(CatLogHome.JNDI_HOME); | DetailHome detailHome = (DetailHome) env.getHome(DetailHome.JNDI_HOME); | | CatComplex complexEntity; | try { | complexEntity = complexHome.findByPrimaryKey(logItem.getComplex()); | } catch (ObjectNotFoundException ex) { | complexEntity = complexHome.create(logItem.getComplex()); | } | | CatCpu cpuEntity; | try { | cpuEntity = cpuHome.findByPrimaryKey(logItem.getComplex() + logItem.getCpu()); | } catch (ObjectNotFoundException ex) { | cpuEntity = cpuHome.create(logItem.getComplex() + logItem.getCpu(), complexEntity); | } | | try { | CatLog catlog = logHome.findByTimeStamp_CatIndex_System(logItem.getDate(), | logItem.getIndex(), | logItem.getComplex()+logItem.getCpu() ); | catlog.remove(); // delete if it already exists | } catch (FinderException ex) { | // do nothing | } finally { | Detail detail = null; | if (logItem.getPsw()!=null) { | | detail = detailHome.create(logItem.getRegisters().get(0), | logItem.getRegisters().get(1), | logItem.getRegisters().get(2), | logItem.getRegisters().get(3), | logItem.getRegisters().get(4), | logItem.getRegisters().get(5), | logItem.getRegisters().get(6), | logItem.getRegisters().get(7), | logItem.getRegisters().get(8), | logItem.getRegisters().get(9), | logItem.getRegisters().get(10), | logItem.getRegisters().get(11), | logItem.getRegisters().get(12), | logItem.getRegisters().get(13), | logItem.getRegisters().get(14), | logItem.getRegisters().get(15), | logItem.getPsw(), | logItem.getCsect(), | logItem.getDisplacement()); | | } | logHome.create(new UID().toString(), | logItem.getDate(), | logItem.getEventType(), | logItem.getComment(), | logItem.getIndex(), | logItem.getDumpType(), | logItem.getDumpNumber(), | logItem.getDumpSeqNumber(), | logItem.getTapeNumber(), | cpuEntity, | detail); | | env.getLogger().debug("Log created : " + "\n" + | "Date : " + logItem.getDate() + "\n" + | "EventType : " + logItem.getEventType() + "\n" + | "Comment : " + logItem.getComment() + "\n" + | "Index : " + logItem.getIndex() + "\n" + | "DumpType : " + logItem.getDumpType() + "\n" + | "DumpNumber : " + logItem.getDumpNumber() + "\n" + | "DumpSeqNumber : " + logItem.getDumpSeqNumber() + "\n" + | "TapeNumber : " + logItem.getTapeNumber() | ); | } | | } catch (CreateException ex) { | env.getLogger().error("CreateException: ", ex); | } catch (FinderException ex) { | env.getLogger().error("CreateException: ", ex); | } catch (NamingException ex) { | env.getLogger().error("NamingException: ", ex); | } catch (Exception ex) { | env.getLogger().error("Exception: ", ex); | } | Following the stack trace: | 2006-07-04 11:15:11,269 34012 INFO [org.jboss.ejb.EjbModule] (main:) Deploying CatComplex | 2006-07-04 11:15:12,131 34874 INFO [org.jboss.ejb.EjbModule] (main:) Deploying CatCpu | 2006-07-04 11:15:12,147 34890 INFO [org.jboss.ejb.EjbModule] (main:) Deploying CatLog | 2006-07-04 11:15:12,178 34921 INFO [org.jboss.ejb.EjbModule] (main:) Deploying Detail | 2006-07-04 11:15:12,194 34937 INFO [org.jboss.ejb.EjbModule] (main:) Deploying XMLreader | 2006-07-04 11:15:12,209 34952 INFO [org.jboss.ejb.EjbModule] (main:) Deploying CatlogBrowser | 2006-07-04 11:15:12,225 34968 INFO [org.jboss.ejb.EjbModule] (main:) Deploying CatlogMDB | 2006-07-04 11:15:12,726 35469 INFO [org.jboss.ejb.plugins.local.BaseLocalProxyFactory] (main:) Bound EJB LocalHome 'CatComplex' to jndi 'entities/CatComplex' | 2006-07-04 11:15:12,726 35469 INFO [org.jboss.ejb.plugins.local.BaseLocalProxyFactory] (main:) Bound EJB LocalHome 'CatCpu' to jndi 'entities/CatCpu' | 2006-07-04 11:15:12,742 35485 INFO [org.jboss.ejb.plugins.local.BaseLocalProxyFactory] (main:) Bound EJB LocalHome 'CatLog' to jndi 'entities/CatLog' | 2006-07-04 11:15:12,789 35532 INFO [org.jboss.ejb.plugins.local.BaseLocalProxyFactory] (main:) Bound EJB LocalHome 'Detail' to jndi 'entities/Detail' | 2006-07-04 11:15:12,789 35532 INFO [org.jboss.ejb.plugins.local.BaseLocalProxyFactory] (main:) Bound EJB LocalHome 'XMLreader' to jndi 'session/XMLreaderLocal' | 2006-07-04 11:15:13,165 35908 INFO [org.jboss.proxy.ejb.ProxyFactory] (main:) Bound EJB Home 'CatlogBrowser' to jndi 'session/CatlogBrowser' | 2006-07-04 11:15:13,964 36707 WARN [org.jboss.jms.asf.StdServerSessionPool] (main:) Using a non-XA QueueConnection. It will not be able to participate in a Global UOW | 2006-07-04 11:15:14,638 37381 ERROR [org.jboss.ejb.plugins.LogInterceptor] (JMS SessionPool Worker-0:) TransactionRolledbackLocalException in method: public abstract ch.eds.catlog.CatComplex ch.eds.catlog.CatComplexHome.findByPrimaryKey(java.lang.String) throws javax.ejb.FinderException, causedBy: | java.lang.IllegalStateException: createBeanClassInstanceCommand == null | at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:575) | at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:139) | at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:238) | at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:183) | at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:113) | at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:76) | at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:43) | at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56) | at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125) | at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350) | at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161) | at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:145) | at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132) | at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107) | at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:514) | at org.jboss.ejb.Container.invoke(Container.java:975) | at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:359) | at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:133) | at $Proxy58.findByPrimaryKey(Unknown Source) | at ch.eds.catlog.XMLreaderBean.createEntity(XMLreaderBean.java:249) | at ch.eds.catlog.XMLreaderBean.readXML(XMLreaderBean.java:221) | 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:585) | at org.jboss.invocation.Invocation.performCall(Invocation.java:359) | at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237) | at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158) | at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169) | at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64) | at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63) | at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121) | at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350) | at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181) | at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168) | at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205) | at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136) | at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648) | at org.jboss.ejb.Container.invoke(Container.java:954) | at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430) | at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103) | at $Proxy67.readXML(Unknown Source) | at ch.eds.catlog.CatlogMDBBean.onMessage(CatlogMDBBean.java:37) | 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:585) | at org.jboss.invocation.Invocation.performCall(Invocation.java:359) | at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495) | at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158) | at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116) | at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63) | at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121) | at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350) | at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181) | at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109) | at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205) | at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136) | at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402) | at org.jboss.ejb.Container.invoke(Container.java:954) | at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987) | at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287) | at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266) | at com.ibm.mq.jms.MQSession.run(MQSession.java:1136) | at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196) | at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743) | at java.lang.Thread.run(Thread.java:595) | 2006-07-04 11:15:14,653 37396 ERROR [ch.eds.catlog] (JMS SessionPool Worker-0:) Exception: | javax.ejb.TransactionRolledbackLocalException: Could not instantiate bean | at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:262) | at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350) | at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:161) | at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:145) | at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:132) | at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:107) | at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:514) | at org.jboss.ejb.Container.invoke(Container.java:975) | at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invokeHome(BaseLocalProxyFactory.java:359) | at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java:133) | at $Proxy58.findByPrimaryKey(Unknown Source) | at ch.eds.catlog.XMLreaderBean.createEntity(XMLreaderBean.java:249) | at ch.eds.catlog.XMLreaderBean.readXML(XMLreaderBean.java:221) | 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:585) | at org.jboss.invocation.Invocation.performCall(Invocation.java:359) | at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:237) | at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158) | at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:169) | at org.jboss.ws.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:64) | at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63) | at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121) | at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350) | at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181) | at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:168) | at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205) | at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136) | at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:648) | at org.jboss.ejb.Container.invoke(Container.java:954) | at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:430) | at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:103) | at $Proxy67.readXML(Unknown Source) | at ch.eds.catlog.CatlogMDBBean.onMessage(CatlogMDBBean.java:37) | 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:585) | at org.jboss.invocation.Invocation.performCall(Invocation.java:359) | at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:495) | at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158) | at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116) | at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63) | at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121) | at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350) | at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181) | at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109) | at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205) | at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136) | at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:402) | at org.jboss.ejb.Container.invoke(Container.java:954) | at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987) | at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287) | at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266) | at com.ibm.mq.jms.MQSession.run(MQSession.java:1136) | at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196) | at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:743) | at java.lang.Thread.run(Thread.java:595) | Caused by: javax.ejb.EJBException: Could not instantiate bean | at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:206) | at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInterceptor.java:113) | at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor.java:76) | at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInterceptor.java:43) | at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:56) | at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:125) | ... 58 more | Caused by: java.lang.IllegalStateException: createBeanClassInstanceCommand == null | at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createBeanClassInstance(JDBCStoreManager.java:575) | at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(CMPPersistenceManager.java:139) | at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer.java:238) | at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:183) | ... 63 more | It seems that the Beans activated through the Timerservice and the Message Driven Service are not ready yet! View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3955262#3955262 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3955262 Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user