These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: serialVersionUID not matching
PostPosted: Sun Dec 26, 2004 4:44 pm 
Newbie

Joined: Sun Dec 26, 2004 4:39 pm
Posts: 14
JBoss version:4.0.1RC1

Hibernate Version:I believe is 2.6 that ships with JBoss 4.0.1RC1

Hello,

In an attempt to stop Hibernate from dropping and recreating tables with actual data I changed the setting in hibernate.properties from the default
hibernate.hbm2ddl.auto=create-drop to hibernate.hbm2ddl.auto=update.

That worked and Hibernate doesn't touch the tables however now I have the following problem:

-When JBoss 4 initially comes up everything is fine. The Entity beans return the data
-If I redeploy the .ejb3 file I get the following error:

Caused by: java.io.InvalidClassException: local class incompatible: stream classdesc serialVersionUID = -7521933163152988638, local class serialVersionUID = -5000941548770925426

I've checked to make sure that the client and the server reference the same version of the hibernate jar files and that both use the JRE of Java 5.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 26, 2004 6:24 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what class is throwing the exception ?

i normally see this stuff when one have different VM's or even compiled with different compilers.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 26, 2004 7:03 pm 
Newbie

Joined: Sun Dec 26, 2004 4:39 pm
Posts: 14
Thanks for the response.

It appears to be the @Entity class/bean. I also tried to hard code the serialVersionUID with
private static final long serialVersionUID = 1

to no avail. All it does is display that 7521933163152988638 (or something like it) doesn't match 1

Code:
Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
   at $Proxy0.findAll(Unknown Source)
   at Client_1.main(Client_1.java:29)
Caused by: java.io.InvalidClassException: ApplicationType; local class incompatible: stream classdesc serialVersionUID = -7521933163152988638, local class serialVersionUID = -5000941548770925426
   at java.io.ObjectStreamClass.initNonProxy(Unknown Source)
   at java.io.ObjectInputStream.readNonProxyDesc(Unknown Source)
   at java.io.ObjectInputStream.readClassDesc(Unknown Source)
   at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
   at java.io.ObjectInputStream.readObject0(Unknown Source)
   at java.io.ObjectInputStream.defaultReadFields(Unknown Source)
   at java.io.ObjectInputStream.readSerialData(Unknown Source)
   at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
   at java.io.ObjectInputStream.readObject0(Unknown Source)
   at java.io.ObjectInputStream.readObject(Unknown Source)
   at java.util.ArrayList.readObject(Unknown Source)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at java.io.ObjectStreamClass.invokeReadObject(Unknown Source)
   at java.io.ObjectInputStream.readSerialData(Unknown Source)
   at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
   at java.io.ObjectInputStream.readObject0(Unknown Source)
   at java.io.ObjectInputStream.readObject(Unknown Source)
   at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:109)
   at java.io.ObjectInputStream.readExternalData(Unknown Source)
   at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
   at java.io.ObjectInputStream.readObject0(Unknown Source)
   at java.io.ObjectInputStream.readObject(Unknown Source)
   at org.jboss.remoting.AbstractInvoker.unmarshal(AbstractInvoker.java:287)
   at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:161)
   at org.jboss.remoting.Client.invoke(Client.java:175)
   at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:39)
   at org.jboss.ejb3.EJBInvocation.invokeNext(EJBInvocation.java:51)
   at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:44)
   at org.jboss.ejb3.EJBInvocation.invokeNext(EJBInvocation.java:51)
   at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:42)
   at org.jboss.ejb3.EJBInvocation.invokeNext(EJBInvocation.java:51)
   at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:38)
   ... 2 more


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 26, 2004 7:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
so you have done that on ApplicationType, recompiled and redeployed on both sides ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 26, 2004 10:12 pm 
Newbie

Joined: Sun Dec 26, 2004 4:39 pm
Posts: 14
Correct. I'm using the same ant sciprt (same exact classpath) to compile build the server ejb3 file and to run the Client_1.

I've narrowed it down to this:

1. If Hibernate creates the table (you start out by not having the table in Oracle) with a setting of create or create-drop, it is fine. I can change the setting to update and redeploy as many times as I need without any Exceptions.

2. If I start out with a tables in Oracle with an "update" setting, than the problem happens.

The problem with this is that my business requirement is to start out with Oracle tables that already have data.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 27, 2004 7:04 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
sounds very weird that changing that should have affect...what if you just change another variable in your properties/cfg.xml resource ? (hinting that it might just be the fact you change something in the archive)

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.