What is wrong with CMP 2.x versus CMP 1.x ?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Alexander_Rabinowitz
Posted On:   Thursday, March 6, 2003 11:43 AM

I 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.CMPP   More>>

I 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: uildGUI2
am
un_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
< >
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
< 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

< public int iD;
< public java.lang.String name;
< public java.lang.String description;
< public int parentID;
< public boolean isLeaf;
< public int sentCommandID;
< public int consumedCommandID;
< public int status;
< public java.lang.String host;
<

// ** methodes were generated for CMP 1.x

< public int getID()
< {
< return this.iD;
< }
<
< public void setID( int iD )
< {
< this.iD = iD;
<
< makeDirty();
<
< dataHolder = null;
< }
<
< public java.lang.String getName()
< {
< return this.name;
< }
<
< public void setName( java.lang.String name )
< {
< this.name = name;
<
< makeDirty();
<
< dataHolder = null;
< }
<
< public java.lang.String getDescription()
< {
< return this.description;
< }
<
< public void setDescription( java.lang.String description )
< {
< this.description = description;
<
< makeDirty();
<
< dataHolder = null;
< }
<
< public int getParentID()
< {
< return this.parentID;
< }
<
< public void setParentID( int parentID )
< {
< this.parentID = parentID;
<
< makeDirty();
<
< dataHolder = null;
< }
<
< public boolean getIsLeaf()
< {
< return this.isLeaf;
< }
<
< public void setIsLeaf( boolean isLeaf )
< {
< this.isLeaf = isLeaf;
<
< makeDirty();
<
< dataHolder = null;
< }
<
< public int getSentCommandID()
< {
< return this.sentCommandID;
< }
<
< public void setSentCommandID( int sentCommandID )
< {
< this.sentCommandID = sentCommandID;
<
< makeDirty();
<
< dataHolder = null;
< }
<
< public int getConsumedCommandID()
< {
< return this.consumedCommandID;
< }
<
< public void setConsumedCommandID( int consumedCommandID )
< {
< this.consumedCommandID = consumedCommandID;
<
< makeDirty();
<
< dataHolder = null;
< }
<
< public int getStatus()
< {
< return this.status;
< }
<
< public void setStatus( int status )
< {
< this.status = status;
<
< makeDirty();
<
< dataHolder = null;
< }
<
< public java.lang.String getHost()
< {
< return this.host;
< }
<
< public void setHost( java.lang.String host )
< {
< this.host = host;
<
< makeDirty();
<
< dataHolder = null;
< }
<

// ** those methods exist only for CMP 1.x

< public boolean isModified()
< {
< return dirty;
< }
<
< protected void makeDirty()
< {
< dirty = true;
< }
<
< protected void makeClean()
< {
< dirty = false;
< }
<
< private boolean dirty;
<
208d54
public void ejbLoad()
{
< makeClean();
dataHolder = null;

}

public void ejbStore()
{
< 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 ) ;

   <<Less
About | Sitemap | Contact