aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Problem in getting handle on EJB Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Problem in getting handle on EJB Object" Watch "Problem in getting handle on EJB Object" New topic
Author

Problem in getting handle on EJB Object

Balaji Chopparapu
Greenhorn

Joined: Oct 13, 2005
Posts: 14
Hi All,

I am getting following exception when i try to get handle on my ejb object.

My Client Program:
////////////////////////////////////////////////////////////
import synch.*;
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import javax.ejb.*;
import java.io.*;
public class SearlizeClient
{
public static void main(String[] args) throws Exception
{
Context ic = new InitialContext();


Object o = ic.lookup("NameBean"); // replace with YOUR JNDI name for the bean

NameHome nameHome = (NameHome) PortableRemoteObject.narrow(o, NameHome.class);

synch.Name obj1 = nameHome.create();
obj1.setName("Balaji");
Handle myHandle= obj1.getHandle();// Getting exception at this place
FileOutputStream out = new FileOutputStream("MyHandle.txt");
ObjectOutputStream s = new ObjectOutputStream(out);
s.writeObject(obj1);
s.flush();
out.close();

}
}
///////////////////////////////////////////////////////
I got following excetion when i try to get handle on EJBObject
-------------------------------------------------------------
Dec 6, 2005 11:20:19 AM com.sun.corba.se.impl.encoding.CDRInputStream_1_0 read_value
WARNING: "IOP00810257: (MARSHAL) Could not find class"
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.se.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemExcep
tion.java:7756)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013
)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)

at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_
1_0.java:873)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_
1_0.java:863)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java
:269)
at synch._Name_Stub.getHandle(Unknown Source)
at SearlizeClient.main(SearlizeClient.java:20)
Caused by: java.lang.ClassNotFoundException
... 7 more
Exception in thread "main" java.rmi.MarshalException: CORBA MARSHAL 1398079745 Maybe; nested excepti
on is:
org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.se.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:197)
at javax.rmi.CORBA.Util.mapSystemException(Util.java:67)
at synch._Name_Stub.getHandle(Unknown Source)
at SearlizeClient.main(SearlizeClient.java:20)
Caused by: org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 257 completed: Maybe
at com.sun.corba.se.impl.logging.ORBUtilSystemException.couldNotFindClass(ORBUtilSystemExcep
tion.java:7756)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:1013
)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_value(CDRInputStream_1_0.java:879)

at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_
1_0.java:873)
at com.sun.corba.se.impl.encoding.CDRInputStream_1_0.read_abstract_interface(CDRInputStream_
1_0.java:863)
at com.sun.corba.se.impl.encoding.CDRInputStream.read_abstract_interface(CDRInputStream.java
:269)
at synch._Name_Stub.getHandle(Unknown Source)
... 1 more
Caused by: java.lang.ClassNotFoundException
... 7 more
----------------------------------------------------------

Enviroment: This bean is hosted on Sun J2ee Appserver 8.0 and normal client prg is working fine .. But it is failing when we are getting handle

Please suggest,
Thanks
Paymon Asadinia
Greenhorn

Joined: Jan 11, 2005
Posts: 8
Here is the root cause in your stack trace;

"Caused by: java.lang.ClassNotFoundException"
Check your classpath, The class(es) in question can not be loaded;
"import synch.*" start here. I hope this helps.
Balaji Chopparapu
Greenhorn

Joined: Oct 13, 2005
Posts: 14
Hi schrodingers Kat,

Thanks for you reply .. The same code worked in JBOSS ... I think this the problem with sun ri implementation

/Balaji
Devender Thareja
Ranch Hand

Joined: Jul 14, 2005
Posts: 187
Compare your comiletime classpath and runtime classpath. You might be supplying command line class path while compiling. Make sure you include required jar's when you run.
You can also try to compare it with Jboss env where it works to figure out differences in classpath.
Hope it helps.


Devender Thareja
SCEA, SCBCD, SCJP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in getting handle on EJB Object
 
Similar Threads
Running AdviseGuy Bean with JDK1.4 fails
java.rmi.MarshalException
IOP00810257: (MARSHAL) Could not load class <Class Name>
EJB3.0, mySQL, Queries & Entity Beans?
org.omg.CORBA.MARSHAL