• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in getting handle on EJB Object

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi schrodingers Kat,

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

/Balaji
 
Ranch Hand
Posts: 187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic