-->
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: Can't get Session on client
PostPosted: Fri Feb 20, 2009 8:35 am 
Newbie

Joined: Fri Mar 02, 2007 6:31 am
Posts: 19
I'm trying to get Hibernate to work on a Swing client but I fail.

When I try to return the Session from the application server (Weblogic 8.1 SP6) to the client I get a stacktrace in the client logs. There are no stacktraces on the server.

Any thoughts on what might be wrong?

Hibernate version: 3.3.1

Full stack trace of any exception that occurs:
Code:
Exception in thread "Main Thread" java.lang.NoSuchMethodError: trace
   at org.hibernate.impl.SessionImpl.readObject(SessionImpl.java:1916)
   at com.sun.corba.se.internal.io.IIOPInputStream.readObject(Native Method)
   at com.sun.corba.se.internal.io.IIOPInputStream.invokeObjectReader(IIOPInputStream.java:1298)
   at com.sun.corba.se.internal.io.IIOPInputStream.inputObject(IIOPInputStream.java:908)
   at com.sun.corba.se.internal.io.IIOPInputStream.simpleReadObject(IIOPInputStream.java:261)
   at com.sun.corba.se.internal.io.ValueHandlerImpl.readValueInternal(ValueHandlerImpl.java:247)
   at com.sun.corba.se.internal.io.ValueHandlerImpl.readValue(ValueHandlerImpl.java:209)
   at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1084)
   at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
   at com.jnj.gtsc.agent.business.bankdir.session._BankDirDAOBLMgr_Stub.getSession(Unknown Source)
   at com.jnj.gtsc.agent.business.bankdir.decorator.BankDirDAOBLMgrDecorator.getSession(BankDirDAOBLMgrDecorator.java:49)
   at com.jnj.gtsc.agent.client.Agent.<init>(Agent.java:153)
   at com.jnj.gtsc.agent.client.Agent.getInstance(Agent.java:167)
   at com.jnj.gtsc.agent.client.Agent.main(Agent.java:146)
Exception in thread "Main Thread" com.jnj.framework2.exceptions.GeneralFailureException: java.rmi.MarshalException: CORBA MARSHAL 1398079699
Maybe; nested exception is:
   org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Serializable readObject method failed internally  vmcid: SUN  minor cod
e: 211 completed: Maybe; cause=CORBA MARSHAL 1398079699 Maybe; nested exception is:
   org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Serializable readObject method failed internally  vmcid: SUN  minor cod
e: 211 completed: Maybe
   at com.jnj.gtsc.agent.business.bankdir.decorator.BankDirDAOBLMgrDecorator.getSession(BankDirDAOBLMgrDecorator.java:52)
   at com.jnj.gtsc.agent.client.Agent.<init>(Agent.java:153)
   at com.jnj.gtsc.agent.client.Agent.getInstance(Agent.java:167)
   at com.jnj.gtsc.agent.client.Agent.main(Agent.java:146)
Caused by: java.rmi.MarshalException: CORBA MARSHAL 1398079699 Maybe; nested exception is:
   org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Serializable readObject method failed internally  vmcid: SUN  minor cod
e: 211 completed: Maybe
   at com.sun.corba.se.internal.iiop.ShutdownUtilDelegate.mapSystemException(ShutdownUtilDelegate.java:100)
   at javax.rmi.CORBA.Util.mapSystemException(Util.java:65)
   at com.jnj.gtsc.agent.business.bankdir.session._BankDirDAOBLMgr_Stub.getSession(Unknown Source)
   at com.jnj.gtsc.agent.business.bankdir.decorator.BankDirDAOBLMgrDecorator.getSession(BankDirDAOBLMgrDecorator.java:49)
   ... 3 more
Caused by: org.omg.CORBA.MARSHAL: Unable to read value from underlying bridge : Serializable readObject method failed internally  vmcid: SUN
minor code: 211 completed: Maybe
   at com.sun.corba.se.internal.iiop.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1089)
   at com.sun.corba.se.internal.iiop.CDRInputStream.read_value(CDRInputStream.java:293)
   ... 5 more


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2009 12:42 pm 
Senior
Senior

Joined: Tue Aug 01, 2006 9:24 pm
Posts: 120
I can't say I fully understand what's going on in your stacktrace.

But from what your saying it seems like you are trying to serialize your session and send it to your client.

If that's what your trying to do you can't do that. You have to get the pojo's and serialize those you will lose any connection to the session. You can't send the session..


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2009 1:07 pm 
Newbie

Joined: Fri Mar 02, 2007 6:31 am
Posts: 19
Ah, so I can't get a Session on the server and return that to the client. I didn't know that.
That's what I was trying to do: the client asks the EJB to get a Session so it can then do some DB stuff.
So either the client creates a SessionFactory itself and get the Session from there, or it asks the server to do the DB stuff and gets only the POJOs. Correct?

The 2nd method seems the better of the two. I think I'll go with that.

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 20, 2009 2:17 pm 
Senior
Senior

Joined: Tue Aug 01, 2006 9:24 pm
Posts: 120
yes that is correct. I would keep the db calls off the client because that will introduce unneeded complexity. Make calls to the main app server and ask that for the data, it will make security and a whole host of issues which occur if the client is physically running on a users computer much simpler.

As side note if your going to be doing this a lot you might want to look into soap or rest. As security will be an issue when you open up a piece of code like that to the internet.


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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.