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.  [ 4 posts ] 
Author Message
 Post subject: java.io.InvalidClassException
PostPosted: Sun Sep 28, 2003 11:30 pm 
Newbie

Joined: Sun Sep 28, 2003 11:06 pm
Posts: 1
Hi,

I am querying from JBoss client. The query running on the server side returns a List (of Hibernate returned objects of class Person). The query text is:

"from org.rssb.entities.organization.Person per "

My Serverside method called from slsb (getting invoked) is:

public static List query(String name, Hashtable table) {
QueryHelper.getInstance();
Session session = SessionManager.getSession();
Query q1 = null;
String queryText = null;
try {
queryText = (String) queries.get(name);
q1 = session.createQuery(queryText);
} catch (HibernateException e) {
e.printStackTrace();
}
if ( table == null ) table = new Hashtable();
Enumeration en = table.keys();

while (en.hasMoreElements()) {
String key = (String) en.nextElement();
Object o = table.get(key);

if (o instanceof String) {
q1.setString(key, (String) o);
}

if (o instanceof Integer) {
q1.setInteger(key, ((Integer) o).intValue());
}

if (o instanceof Date) {
q1.setDate(key, (Date) o);
}
}

List rc = null;

try {
rc = q1.list();
session.close();
} catch (HibernateException e1) {
e1.printStackTrace();
}
catch (Exception e1) {
e1.printStackTrace();
}

return rc;
}


JBoss returns a list. However, on the client side I get the following exception as soon as my call comes back:

public static List query(String name, Hashtable table) {
String _url = "localhost:1099";
LightEjbProxy proxy =
new LightEjbProxy("org.jnp.interfaces.NamingContextFactory", _url);
List rc = null;
SLQueryHelper obj = (SLQueryHelper) proxy.getObj(JNDI_NAME);
try {
rc = obj.query(name, table);
} catch (RemoteException e) {
e.printStackTrace();
}

return rc;
}

Caused by: java.io.InvalidClassException: net.sf.hibernate.collection.PersistentCollection; local class incompatible:

What am I doing wrong? Class Person does have collection data members inside it. It is lazy tough.

I thought this was a natural way of doing client-server interaction with Hibernate.

I am still using 2.0B6

Any help is highly appreciated.

Thanks,

Vinay

=============Dump=on client side====================

java.lang.reflect.UndeclaredThrowableException
at $Proxy1.query(Unknown Source)
at org.rssb.utils.common.dbservice.client.DBSvc.query(DBSvc.java:42)
at org.rssb.utils.common.dbservice.client.DBSvc.main(DBSvc.java:50)
Caused by: java.io.InvalidClassException: net.sf.hibernate.collection.PersistentCollection; local class incompatible: stream classdesc serialVersionUID = -610623962369065059, local class serialVersionUID = -8318395321868084057
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.readNonProxyDesc(Unknown Source)
at java.io.ObjectInputStream.readClassDesc(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 java.rmi.MarshalledObject.get(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:139)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
... 3 more
Exception in thread "main"


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 29, 2003 5:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
At a guess, I'd say you have two different versions of Hibernate in your classpaths.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 25, 2004 10:55 pm 
Newbie

Joined: Tue Feb 24, 2004 11:43 pm
Posts: 4
I have a same problem.It isn't a problem of the version.

_________________
I'm a beginner.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 14, 2004 11:55 am 
Newbie

Joined: Tue Dec 14, 2004 11:49 am
Posts: 2
Location: Toulouse, France
I also had InvalidClassException when unit testing an Hibernate app deployed under JBoss 4.0. It was due to a Hibernate version conflict: 2.1.5 shipped with JBoss versus 2.1.6 in my local classpath. Updating JBoss Hibernate library to 2.1.6 solved the problem.

B.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.