jboss 3.0 alpha cmp2-one-to-many-bi-like test failing
emptybell Feb 4, 2002 5:12 PMHi everybody!
(Hi, Doctor Nick!)
I am deploying two entity beans in a one-to-many-bidirectional relationship, using the provided cmp2 relationship test deployment descriptors as a template. (My beans are catholic and child.) (I was tired and very short of inspiration.)
There is a stateless session bean sitting between the Catholic bean and the client. The Catholic bean creates the Child bean in its addB method.
I have checked and checked and there seems to be no good reason - not that I've bothered to compile and run the cmp2 test - for this not working. Please would someone therefore help?
On deployment, the first thing I'm seeing is this:
[21:47:15,521,ContainerFactory] Deploying:file:/G:/jboss-3.0.0alpha/deploy/Defau
lt/catholic.jar
[21:47:15,721,ContainerFactory] Verifying file:/G:/jboss-3.0.0alpha/deploy/Defau
lt/catholic.jar/ejb1001.jar
[21:47:15,761,ContainerFactory]
Bean : CatholicE
Section: 9.2.2
Warning: The entity bean class must not be defined as abstract.
[21:47:15,761,ContainerFactory]
Bean : CatholicE
Section: 9.2.2
Warning: The entity bean class must define a public constructor that takes no ar
guments.
[21:47:15,781,ContainerFactory]
Bean : CatholicE
Section: 9.4.7.1
Warning: The primkey-field element must name a public field in the bean implemen
tation class.
[21:47:15,791,ContainerFactory]
Bean : ChildE
Section: 9.2.2
Warning: The entity bean class must not be defined as abstract.
[21:47:15,801,ContainerFactory]
Bean : ChildE
Section: 9.2.2
Warning: The entity bean class must define a public constructor that takes no ar
guments.
[21:47:15,821,ContainerFactory]
Bean : ChildE
Section: 9.4.7.1
Warning: The primkey-field element must name a public field in the bean implemen
tation class.
This all seems a bit odd. Then, if they don't already exist, the two tables are created in the hsql database. This is the second odd bit: on inspection, the two tables only show the cmp fields; the cmr fields have not been created.
Things go downhill from this stage. In the stateless session bean method addCatholic, the Catholic home interface is recovered fine from JNDI, but the ensuing create goes wrong bigtime, as follows:
[21:50:14,949,LogInterceptor] TransactionRolledbackException, causedBy:
java.rmi.ServerException: Could not instantiate bean; nested exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.CatholicEBe
an
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(C
MPPersistenceManager.java:155)
at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer
.java:276)
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
ava:153)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst
anceInterceptor.java:142)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte
rceptor.java:104)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:100)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:233)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
va:56)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
tor.java:106)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
09)
at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:441)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(Base
LocalContainerInvoker.java:255)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$HomeProxy.invok
e(BaseLocalContainerInvoker.java:406)
at $Proxy2.create(Unknown Source)
at org.tidders.cmp.catholic.ejb.beans.CatholicSLSBean.addCatholic(Unknow
n Source)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
tatelessSessionContainer.java:569)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
elessSessionInstanceInterceptor.java:67)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:98)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:156)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
5)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:131)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
ner.java:280)
at org.jboss.ejb.Container.invoke(Container.java:528)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPCon
tainerInvoker.java:411)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
65)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:706)
at java.lang.Thread.run(Thread.java:484)
[21:50:14,949,CatholicSLSLog] D'oh!
javax.ejb.TransactionRolledbackLocalException: Could not instantiate bean; neste
d exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
java.rmi.ServerException: Could not instantiate bean; nested exception i
s:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
Embedded Exception
Could not instantiate bean; nested exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
java.rmi.ServerException: Could not instantiate bean; nested exception i
s:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(Base
LocalContainerInvoker.java:272)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$HomeProxy.invok
e(BaseLocalContainerInvoker.java:406)
at $Proxy2.create(Unknown Source)
at org.tidders.cmp.catholic.ejb.beans.CatholicSLSBean.addCatholic(Unknow
n Source)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
tatelessSessionContainer.java:569)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
elessSessionInstanceInterceptor.java:67)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:98)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:156)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
5)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:131)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
ner.java:280)
at org.jboss.ejb.Container.invoke(Container.java:528)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPCon
tainerInvoker.java:411)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
65)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:706)
at java.lang.Thread.run(Thread.java:484)
javax.transaction.TransactionRolledbackException: Could not instantiate bean; ne
sted exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
java.rmi.ServerException: Could not instantiate bean; nested exception i
s:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
java.rmi.ServerException: Could not instantiate bean; nested exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.CatholicEBe
an
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(C
MPPersistenceManager.java:155)
at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer
.java:276)
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
ava:153)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst
anceInterceptor.java:142)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte
rceptor.java:104)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:100)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:233)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
va:56)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
tor.java:106)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
09)
at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:441)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(Base
LocalContainerInvoker.java:255)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$HomeProxy.invok
e(BaseLocalContainerInvoker.java:406)
at $Proxy2.create(Unknown Source)
at org.tidders.cmp.catholic.ejb.beans.CatholicSLSBean.addCatholic(Unknow
n Source)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
tatelessSessionContainer.java:569)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
elessSessionInstanceInterceptor.java:67)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:98)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:156)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
5)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:131)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
ner.java:280)
at org.jboss.ejb.Container.invoke(Container.java:528)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPCon
tainerInvoker.java:411)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
65)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:706)
at java.lang.Thread.run(Thread.java:484)
[21:50:14,969,StatelessSessionContainer] invoke returned an exception
java.rmi.ServerException: Could not instantiate bean; nested exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
java.rmi.ServerException: Could not instantiate bean; nested exception i
s:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
Embedded Exception
Could not instantiate bean; nested exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
java.rmi.ServerException: Could not instantiate bean; nested exception i
s:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
javax.ejb.TransactionRolledbackLocalException: Could not instantiate bea
n; nested exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
java.rmi.ServerException: Could not instantiate bean; nested exception i
s:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
Embedded Exception
Could not instantiate bean; nested exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
java.rmi.ServerException: Could not instantiate bean; nested exception i
s:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
javax.ejb.TransactionRolledbackLocalException: Could not instantiate bean; neste
d exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
java.rmi.ServerException: Could not instantiate bean; nested exception i
s:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
Embedded Exception
Could not instantiate bean; nested exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
java.rmi.ServerException: Could not instantiate bean; nested exception i
s:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(Base
LocalContainerInvoker.java:272)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$HomeProxy.invok
e(BaseLocalContainerInvoker.java:406)
at $Proxy2.create(Unknown Source)
at org.tidders.cmp.catholic.ejb.beans.CatholicSLSBean.addCatholic(Unknow
n Source)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
tatelessSessionContainer.java:569)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
elessSessionInstanceInterceptor.java:67)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:98)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:156)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
5)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:131)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
ner.java:280)
at org.jboss.ejb.Container.invoke(Container.java:528)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPCon
tainerInvoker.java:411)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
65)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:706)
at java.lang.Thread.run(Thread.java:484)
javax.transaction.TransactionRolledbackException: Could not instantiate bean; ne
sted exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean; nested exception is:
java.rmi.ServerException: Could not instantiate bean; nested exception i
s:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
java.rmi.ServerException: Could not instantiate bean; nested exception is:
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.Cat
holicEBean
java.lang.InstantiationException: org.tidders.cmp.catholic.ejb.beans.CatholicEBe
an
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(C
MPPersistenceManager.java:155)
at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer
.java:276)
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
ava:153)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst
anceInterceptor.java:142)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte
rceptor.java:104)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:100)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:233)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
va:56)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
tor.java:106)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
09)
at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:441)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invokeHome(Base
LocalContainerInvoker.java:255)
at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$HomeProxy.invok
e(BaseLocalContainerInvoker.java:406)
at $Proxy2.create(Unknown Source)
at org.tidders.cmp.catholic.ejb.beans.CatholicSLSBean.addCatholic(Unknow
n Source)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
tatelessSessionContainer.java:569)
at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
elessSessionInstanceInterceptor.java:67)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:98)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:156)
at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
5)
at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
java:131)
at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
ner.java:280)
at org.jboss.ejb.Container.invoke(Container.java:528)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
55)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:15
23)
at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPCon
tainerInvoker.java:411)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241)
at sun.rmi.transport.Transport$1.run(Transport.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:148)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
65)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:706)
at java.lang.Thread.run(Thread.java:484)
I have tried a lot of aimless tweaks and nothing seems to resolve this.
In asking for help, I would like to restate that I have based both the deployment descriptors and the code on the cmp2 test and have checked my efforts against these templates over and over.
Thanks in advance for any assistance.
M
PS Pardon the long trace - I'd only cut out the wrong bit if I tried to shorten it :-)