-->
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.  [ 3 posts ] 
Author Message
 Post subject: java.rmi.UnmarshalException (once more)...
PostPosted: Fri Nov 17, 2006 5:22 am 
Newbie

Joined: Mon Oct 23, 2006 6:54 am
Posts: 15
Hi,

Hibernate version:
Hibernate 3.2.0 - jdk 1.3

Full stack trace of any exception that occurs:
Exception: java.rmi.UnmarshalException: failed to unmarshal interface Exception: java.rmi.UnmarshalException: failed to unmarshal interface java.util.
List; nested exception is:
java.lang.ClassNotFoundException: long
java.lang.ClassNotFoundException: long
at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClass
Loader.java:179)
at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAw
areClassLoader.java:65)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAw
areClassLoader.java:43)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:195)
at weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager.java:12
6)
at weblogic.j2ee.ApplicationManager.loadClass(ApplicationManager.java:10
6)
at weblogic.common.internal.WLObjectInputStream.resolveClass(WLObjectInp
utStream.java:49)
at java.io.ObjectInputStream.inputClassDescriptor(ObjectInputStream.java
:918)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:366)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
at java.io.ObjectInputStream.inputArray(ObjectInputStream.java:1142)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:374)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:226
3)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:51
9)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:226
3)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:51
9)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1412)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at java.util.ArrayList.readObject(ArrayList.java:531)
at java.lang.reflect.Method.invoke(Native Method)
at java.io.ObjectInputStream.invokeObjectReader(ObjectInputStream.java:2
214)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1411)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:386)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:236)
at weblogic.rmi.internal.CBVInputStream.readObjectInternal(CBVInputStrea
m.java:191)
at weblogic.rmi.internal.CBVInputStream.readObject(CBVInputStream.java:1
82)
at weblogic.rmi.internal.CBVInputStream.readObject(CBVInputStream.java:1
69)
at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:56)
at weblogic.rmi.internal.BasicRemoteRef.unmarshalReturn(BasicRemoteRef.j
ava:232)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:263)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteR
ef.java:229)
at weblogic.rmi.internal.ProxyStub.invoke(ProxyStub.java:35)
at $Proxy201.searchTop(Unknown Source)
at no.xlink.client.web.control.invoice.InvoiceAdminProcessControl.doBusi
ness(InvoiceAdminProcessControl.java:260)
at no.xlink.client.web.control.AbstractProcessControl.process(AbstractPr
ocessControl.java:322)
at jsp_servlet._jsp._no._no._bokmaal._invoice.__invoiceadmin._jspService
(__invoiceadmin.java:177)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispat
cherImpl.java:466)
at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispat
cherImpl.java:296)
at weblogic.servlet.jsp.PageContextImpl.include(PageContextImpl.java:116
)
at jsp_servlet._jsp.__index._jspService(__index.java:379)
at weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
pl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
rvletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
pl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)


Name and version of the database you are using:
MSSQL 2000
weblogic mssqlserver4v65.jar jdbc driver

Warning, Hibernate noob... :)
I am using webligic server and a session bean in a transaction.
I am trying to return a list of Persistent Classes to the client(bean in jsp page), but gets UnmarshalException. This works fine if I try to query directly from the client so I dont think its missing jar files?? I could move the queried data to data holder classes but do not really want to do that. I guess the transient state is not the same at the detached state?

Code between sessionFactory.openSession() and session.close():
Do not work...
Session ses = HibernateUtil.getSessionFactory().getCurrentSession();
Query q = ses.createQuery("select i from XInvoice i order by i.insertedDate");
q.setFirstResult(1);
q.setMaxResults(top);
return q.list();

Works....
Session ses = HibernateUtil.getSessionFactory().getCurrentSession();
Query q = ses.createQuery("select i from XInvoice i order by i.insertedDate");
q.setFirstResult(1);
q.setMaxResults(top);
List l = q.list();
Iterator i = l.iterator();
ArrayList al = new ArrayList();
while(i.hasNext()) {
XInvoice iv = new XInvoice();
XInvoice ivD = (XInvoice)i.next();
iv.setPk(ivD.getPk());
iv.setInvoiceNumber(ivD.getInvoiceNumber());
al.add(iv);
}
return al;


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 17, 2006 4:41 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Sorry, I don't know weblogic, so maybe that's why I don't understand all you say :
Quote:
I am trying to return a list of Persistent Classes to the client(bean in jsp page), but gets UnmarshalException. This works fine if I try to query directly from the client so I dont think its missing jar files?? I could move the queried data to data holder classes but do not really want to do that. I guess the transient state is not the same at the detached state?


Could you explain a bit more what you do, what works, and what doesn't ? When you say client, you speak about a client that's networkly separated, or on the same machine ?

Quote:
Works....
Code:
Session ses = HibernateUtil.getSessionFactory().getCurrentSession();
Query q = ses.createQuery("select i from XInvoice i order by i.insertedDate");
q.setFirstResult(1);
q.setMaxResults(top);
List l = q.list();
Iterator i = l.iterator();
ArrayList al = new ArrayList();
while(i.hasNext()) {
XInvoice iv = new XInvoice();
XInvoice ivD = (XInvoice)i.next();
iv.setPk(ivD.getPk());
iv.setInvoiceNumber(ivD.getInvoiceNumber());
al.add(iv);
}
return al;


Are you saying that iterating on the list make your code work ? If so, i could be because you're triggering the proxy select, so you would be getting a kind of LazyInitException if not doing this, but I don't understand your stacktrace :-/.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 17, 2006 5:02 pm 
Expert
Expert

Joined: Tue Jul 11, 2006 10:21 am
Posts: 457
Location: Columbus, Ohio
The key line looks to be this one:
Code:
java.lang.ClassNotFoundException: long


You cannot marshal/unmarshal primitive types. Wrap any primitives with appropriate Object class (i.e. Long). My guess is that the PK on XInvoice is a long, not a Long.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.