geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Janko Heilgeist <geronimo-2...@dalighe.de>
Subject Re: Entity with generic base interface results in VerifyError
Date Tue, 18 Sep 2007 20:46:03 GMT
Hi Jarek,

thanks for your help. I just compiled, deployed and tested the modified
code. The previous VerifyError is now replaced by another exception (see
surefire-report below), but I guess the problem is the same and it's
just java 1.5's way of expressing it. Looks like David was right with
his first guess, that the enhancement changes the SUID of the entity.

I already tried your code with a manually inserted serialVersionUID, but
the result is identical.

If the enhancement changes the SUID, then I should be able to enhance
the entities before deployment and have client and appserver use the
same pre-enhanced jar, correct?

Regards, Janko

-------------------------------------------------------------------------------
Test set: mypackage.client.DummyTest
-------------------------------------------------------------------------------
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.143
sec <<< FAILURE!
testFoo(mypackage.client.DummyTest)  Time elapsed: 0.104 sec  <<< ERROR!
javax.naming.NamingException: Cannot lookup
'/generic-entity-ejb-1.0/DummyDAO/mypackage.dao.DummyDAORemote'. [Root
exception is java.rmi.RemoteException: Cannot read the response from the
server (OEJP/2.0) : org.apache.openejb.client.EJBMetaDataImpl; local
class incompatible: stream classdesc serialVersionUID =
-7734383756981201981, local class serialVersionUID =
2128092884552388429; nested exception is:
	java.io.InvalidClassException:
org.apache.openejb.client.EJBMetaDataImpl; local class incompatible:
stream classdesc serialVersionUID = -7734383756981201981, local class
serialVersionUID = 2128092884552388429]
	at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:205)
	at javax.naming.InitialContext.lookup(InitialContext.java:392)
	at mypackage.client.DummyTest.testFoo(DummyTest.java:26)
Caused by: java.rmi.RemoteException: Cannot read the response from the
server (OEJP/2.0) : org.apache.openejb.client.EJBMetaDataImpl; local
class incompatible: stream classdesc serialVersionUID =
-7734383756981201981, local class serialVersionUID =
2128092884552388429; nested exception is:
	java.io.InvalidClassException:
org.apache.openejb.client.EJBMetaDataImpl; local class incompatible:
stream classdesc serialVersionUID = -7734383756981201981, local class
serialVersionUID = 2128092884552388429
	at org.apache.openejb.client.Client.processRequest(Client.java:197)
	at org.apache.openejb.client.Client.request(Client.java:43)
	at org.apache.openejb.client.JNDIContext.request(JNDIContext.java:74)
	at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:199)
	... 28 more
Caused by: java.io.InvalidClassException:
org.apache.openejb.client.EJBMetaDataImpl; local class incompatible:
stream classdesc serialVersionUID = -7734383756981201981, local class
serialVersionUID = 2128092884552388429
	at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:562)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
	at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
	at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1667)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
	at
org.apache.openejb.client.JNDIResponse.readExternal(JNDIResponse.java:64)
	at org.apache.openejb.client.Client.processRequest(Client.java:192)
	... 31 more

-------------------------------------------------------------------------------


Jarek Gawor wrote:
> Janko,
> 
> Try the attached sample. It's the sample you sent us just cleaned it
> up a bit. Changed the compiler option to 1.5 and integrated the
> DummyClient as a test. This deployed and worked fine for me - didn't
> see any exceptions.
> 
> Jarek
> 
> On 9/18/07, Janko Heilgeist <geronimo-2007@dalighe.de> wrote:
>> Hi David,
>>
>> no, a fixed SUID results in the same exceptions.
>>
>> -Janko
>>
>> David Jencks wrote:
>>> This is a wild guess, but I wonder if there is some problem with the
>>> SUID changing during enhancement (I know this isn't supposed to happen,
>>> but...).  Do you get different results if you supply the SUID in code?
>>>
>>> thanks
>>> david jencks
>>>
>>> On Sep 18, 2007, at 4:55 AM, Janko Heilgeist wrote:
>>>
>>>> Hi,
>>>>
>>>> I am trying to deploy an EAR which contains entity beans derived from a
>>>> generic base interface. Basically the structure looks like this:
>>>>
>>>> public interface GenericEntity<PK extends Serializable> {
>>>>     PK getEntityId();
>>>>     void setEntityId(PK entityId);
>>>> }
>>>>
>>>> public interface Dummy extends GenericEntity<Long> {
>>>> }
>>>>
>>>> public class DummyImpl implements Dummy, Serializable {
>>>>     private Long entityId;
>>>>     @Override Long getEntityId() {
>>>>         return entityId;
>>>>     }
>>>>     @Override void setEntityId(Long entityId) {
>>>>         this.entityId = entityId;
>>>>     }
>>>> }
>>>>
>>>> A minimal sample with Maven2 is at
>>>> http://dalighe.de/geronimo/generic-entity.tar.gz
>>>>
>>>> The DummyImpl-entity is accessed via a DAO (stateless session bean).
>>>> While everything deploys just fine into Geronimo, I get an exception
>>>> when I try to access the DAO with a stand-alone client. The exception
>>>> thrown is:
>>>>
>>>> 07:13:50,483 FATAL [remote] Error caught during request processing
>>>> java.lang.VerifyError: (class: mypackage/DummyImpl, method: getEntityId
>>>> signature: ()Ljava/lang/Long;) Wrong return type in function
>>>>         at java.lang.Class.getDeclaredFields0(Native Method)
>>>>         at java.lang.Class.privateGetDeclaredFields(Class.java:2291)
>>>>         at java.lang.Class.getDeclaredField(Class.java:1880)
>>>>         at
>>>> java.io.ObjectStreamClass.getDeclaredSUID(ObjectStreamClass.java:1610)
>>>>         at
>>>> java.io.ObjectStreamClass.access$700(ObjectStreamClass.java:52)
>>>>         at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:425)
>>>>         at java.security.AccessController.doPrivileged(Native Method)
>>>>         at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:413)
>>>>         at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310)
>>>>         at
>>>> java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:547)
>>>>         at
>>>> java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1583)
>>>>         at
>>>> java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
>>>>         at
>>>> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
>>>>         at
>>>> java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
>>>>         at
>>>> java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
>>>>         at
>>>> org.apache.openejb.client.EJBRequest$Body.readMethodParameters(EJBRequest.java:385)
>>>>
>>>>         at
>>>> org.apache.openejb.client.EJBRequest$Body.readExternal(EJBRequest.java:199)
>>>>
>>>>         at
>>>> org.apache.openejb.server.ejbd.EjbRequestHandler.processRequest(EjbRequestHandler.java:91)
>>>>
>>>>         at
>>>> org.apache.openejb.server.ejbd.EjbDaemon.processEjbRequest(EjbDaemon.java:163)
>>>>
>>>>         at
>>>> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:121)
>>>>         at
>>>> org.apache.openejb.server.ejbd.EjbDaemon.service(EjbDaemon.java:83)
>>>>         at
>>>> org.apache.openejb.server.ejbd.EjbServer.service(EjbServer.java:60)
>>>>         at
>>>> org.apache.openejb.server.ServiceLogger.service(ServiceLogger.java:75)
>>>>         at
>>>> org.apache.openejb.server.ServiceAccessController.service(ServiceAccessController.java:55)
>>>>
>>>>         at
>>>> org.apache.openejb.server.ServiceDaemon$1.run(ServiceDaemon.java:117)
>>>>         at java.lang.Thread.run(Thread.java:619)
>>>>
>>>> During a previous test-run I had the member variable of DummyImpl
>>>> defined as the primitive "long" and relied on auto-boxing. In that
>>>> test-run the call to the session bean's create-method was executed but
>>>> an identical exception was thrown somewhere deep in the bowels of
>>>> OpenJPA during the parsing of the entity's meta-data.
>>>>
>>>> Can someone help me out with this problem?
>>>>
>>>> Thanks a lot in advance!
>>>>
>>>> Regards, Janko
>>>>
>>


Mime
View raw message