What is wrong with CMP 2.x versus CMP 1.x ?
arabinow Mar 6, 2003 2:27 PMI have an application that works OK under CMP 1.x and is compiled under xdoclet 1.1.2, with jboss 3.0.6, compiled with ant 1.5.1
When I change in the definition of my to change the tag inside this one:
to
it stops working.
It now brings the following exception on the server:
14:03:34,051 ERROR [LogInterceptor] EJBException, causedBy:
java.lang.InstantiationException: com.peerdirect.rmapplications.master.RemoteNod
eCMP
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:232)
at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.createBeanClassInst
ance(JAWSPersistenceManager.java:165)
at org.jboss.ejb.plugins.CMPPersistenceManager.createBeanClassInstance(C
MPPersistenceManager.java:165)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.crea
teBeanClassInstance(CachedConnectionInterceptor.java:251)
at org.jboss.ejb.EntityContainer.createBeanClassInstance(EntityContainer
.java:294)
at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
ava:184)
at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInst
anceInterceptor.java:78)
at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInte
rceptor.java:79)
at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCrea
tionInterceptor.java:44)
at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
rceptor.java:111)
at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
torCMT.java:201)
at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.ja
va:62)
at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityIntercep
tor.java:105)
at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:1
29)
at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:487)
at org.jboss.ejb.Container.invoke(Container.java:730)
at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1058)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
382)
at java.lang.reflect.Method.invoke(Native Method)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
at sun.rmi.transport.Transport$1.run(Transport.java:147)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
60)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
.java:701)
at java.lang.Thread.run(Thread.java:479)
And the following exception on the client, while trying to instantiate bean
C:\build\GUI2\ram\run_client>java -classpath ".;PeerdirectMasterClient.jar;Peerd
irectMasterServer.jar;jbossall-client.jar;jboss-j2ee.jar;jnp-client.jar;jnet.jar
;log4j.jar" com.peerdirect.rmapplications.master.gui.MainFrame
java.rmi.ServerException: RemoteException occurred in server thread; nested exce
ption is:
java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: Could not instantiate bean; CausedByException is
:
com.peerdirect.rmapplications.master.RemoteNodeCMP
java.rmi.ServerException: EJBException:; nested exception is:
javax.ejb.EJBException: Could not instantiate bean; CausedByException is
:
com.peerdirect.rmapplications.master.RemoteNodeCMP
javax.ejb.EJBException: Could not instantiate bean; CausedByException is:
com.peerdirect.rmapplications.master.RemoteNodeCMP
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
RemoteCall.java:240)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
215)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:117)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Sour
ce)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvo
kerProxy.java:138)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
a:108)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
java:77)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:8
0)
at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:198)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
at $Proxy2.findRoot(Unknown Source)
at com.peerdirect.rmapplications.master.gui.RemoteNodeProxy.findRoot(Rem
oteNodeProxy.java:90)
at com.peerdirect.rmapplications.master.gui.RamTree.(RamTree.java:
74)
at com.peerdirect.rmapplications.master.gui.MainFrame.createTreePane(Mai
nFrame.java:179)
at com.peerdirect.rmapplications.master.gui.MainFrame.createTopPanel(Mai
nFrame.java:155)
at com.peerdirect.rmapplications.master.gui.MainFrame.(MainFrame.j
ava:96)
at com.peerdirect.rmapplications.master.gui.MainFrame.main(MainFrame.jav
a:494)
java.lang.InstantiationException: com.peerdirect.rmapplications.master.RemoteNod
eCMP
<<no stack trace available>>
java.lang.NullPointerException
at com.peerdirect.rmapplications.master.gui.TreeNodeStatusScanner.scanNo
deHash(TreeNodeStatusScanner.java:64)
at com.peerdirect.rmapplications.master.gui.TreeNodeStatusScanner.run(Tr
eeNodeStatusScanner.java:44)
When I looked the the .jar file generated, I see the only differences in .java files (nothing in .xml files).
For RemoteNodeCMP bean the original file I used was RemoteNodeBean.java
xdoclet generated it into RemoteNodeCMP.java files.
And the differences between CMP1.x and CMP 2.x were the following for the filw RemoteNodeCMP.java (the one for which the exception was thrown out):
16c16
<CMP 1.x< public class RemoteNodeCMP
extends com.peerdirect.rmapplications.master.RemoteNodeBean
implements javax.ejb.EntityBean
---
>CMP 2.x> public abstract class RemoteNodeCMP
extends com.peerdirect.rmapplications.master.RemoteNodeBean
implements javax.ejb.EntityBean
21,173d20
// ** fileds were generated for CMP 1.x
<CMP 1.x< public int iD;
<CMP 1.x< public java.lang.String name;
<CMP 1.x< public java.lang.String description;
<CMP 1.x< public int parentID;
<CMP 1.x< public boolean isLeaf;
<CMP 1.x< public int sentCommandID;
<CMP 1.x< public int consumedCommandID;
<CMP 1.x< public int status;
<CMP 1.x< public java.lang.String host;
<CMP 1.x<
// ** methodes were generated for CMP 1.x
<CMP 1.x< public int getID()
<CMP 1.x< {
<CMP 1.x< return this.iD;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public void setID( int iD )
<CMP 1.x< {
<CMP 1.x< this.iD = iD;
<CMP 1.x<
<CMP 1.x< makeDirty();
<CMP 1.x<
<CMP 1.x< dataHolder = null;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public java.lang.String getName()
<CMP 1.x< {
<CMP 1.x< return this.name;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public void setName( java.lang.String name )
<CMP 1.x< {
<CMP 1.x< this.name = name;
<CMP 1.x<
<CMP 1.x< makeDirty();
<CMP 1.x<
<CMP 1.x< dataHolder = null;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public java.lang.String getDescription()
<CMP 1.x< {
<CMP 1.x< return this.description;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public void setDescription( java.lang.String description )
<CMP 1.x< {
<CMP 1.x< this.description = description;
<CMP 1.x<
<CMP 1.x< makeDirty();
<CMP 1.x<
<CMP 1.x< dataHolder = null;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public int getParentID()
<CMP 1.x< {
<CMP 1.x< return this.parentID;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public void setParentID( int parentID )
<CMP 1.x< {
<CMP 1.x< this.parentID = parentID;
<CMP 1.x<
<CMP 1.x< makeDirty();
<CMP 1.x<
<CMP 1.x< dataHolder = null;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public boolean getIsLeaf()
<CMP 1.x< {
<CMP 1.x< return this.isLeaf;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public void setIsLeaf( boolean isLeaf )
<CMP 1.x< {
<CMP 1.x< this.isLeaf = isLeaf;
<CMP 1.x<
<CMP 1.x< makeDirty();
<CMP 1.x<
<CMP 1.x< dataHolder = null;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public int getSentCommandID()
<CMP 1.x< {
<CMP 1.x< return this.sentCommandID;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public void setSentCommandID( int sentCommandID )
<CMP 1.x< {
<CMP 1.x< this.sentCommandID = sentCommandID;
<CMP 1.x<
<CMP 1.x< makeDirty();
<CMP 1.x<
<CMP 1.x< dataHolder = null;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public int getConsumedCommandID()
<CMP 1.x< {
<CMP 1.x< return this.consumedCommandID;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public void setConsumedCommandID( int consumedCommandID )
<CMP 1.x< {
<CMP 1.x< this.consumedCommandID = consumedCommandID;
<CMP 1.x<
<CMP 1.x< makeDirty();
<CMP 1.x<
<CMP 1.x< dataHolder = null;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public int getStatus()
<CMP 1.x< {
<CMP 1.x< return this.status;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public void setStatus( int status )
<CMP 1.x< {
<CMP 1.x< this.status = status;
<CMP 1.x<
<CMP 1.x< makeDirty();
<CMP 1.x<
<CMP 1.x< dataHolder = null;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public java.lang.String getHost()
<CMP 1.x< {
<CMP 1.x< return this.host;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< public void setHost( java.lang.String host )
<CMP 1.x< {
<CMP 1.x< this.host = host;
<CMP 1.x<
<CMP 1.x< makeDirty();
<CMP 1.x<
<CMP 1.x< dataHolder = null;
<CMP 1.x< }
<CMP 1.x<
// ** those methods exist only for CMP 1.x
<CMP 1.x< public boolean isModified()
<CMP 1.x< {
<CMP 1.x< return dirty;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< protected void makeDirty()
<CMP 1.x< {
<CMP 1.x< dirty = true;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< protected void makeClean()
<CMP 1.x< {
<CMP 1.x< dirty = false;
<CMP 1.x< }
<CMP 1.x<
<CMP 1.x< private boolean dirty;
<CMP 1.x<
208d54
public void ejbLoad()
{
<CMP 1.x< makeClean();
dataHolder = null;
}
public void ejbStore()
{
<CMP 1.x< makeClean();
}
244a90,125
>CMP 2.x>
// ** only definitions were generated for CMP 2.0
>CMP 2.x> public abstract int getID() ;
>CMP 2.x>
>CMP 2.x> public abstract void setID( int iD ) ;
>CMP 2.x>
>CMP 2.x> public abstract java.lang.String getName() ;
>CMP 2.x>
>CMP 2.x> public abstract void setName( java.lang.String name ) ;
>CMP 2.x>
>CMP 2.x> public abstract java.lang.String getDescription() ;
>CMP 2.x>
>CMP 2.x> public abstract void setDescription( java.lang.String description ) ;
>CMP 2.x>
>CMP 2.x> public abstract int getParentID() ;
>CMP 2.x>
>CMP 2.x> public abstract void setParentID( int parentID ) ;
>CMP 2.x>
>CMP 2.x> public abstract boolean getIsLeaf() ;
>CMP 2.x>
>CMP 2.x> public abstract void setIsLeaf( boolean isLeaf ) ;
>CMP 2.x>
>CMP 2.x> public abstract int getSentCommandID() ;
>CMP 2.x>
>CMP 2.x> public abstract void setSentCommandID( int sentCommandID ) ;
>CMP 2.x>
>CMP 2.x> public abstract int getConsumedCommandID() ;
>CMP 2.x>
>CMP 2.x> public abstract void setConsumedCommandID( int consumedCommandID ) ;
>CMP 2.x>
>CMP 2.x> public abstract int getStatus() ;
>CMP 2.x>
>CMP 2.x> public abstract void setStatus( int status ) ;
>CMP 2.x>
>CMP 2.x> public abstract java.lang.String getHost() ;
>CMP 2.x>
>CMP 2.x> public abstract void setHost( java.lang.String host ) ;