• Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassCastExceptions using CXS process in iPlanet 6.0 SP3.  RSS feed

saryu mehta
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

ClassCastExceptions using CXS process in iPlanet 6.0 SP3.
Topic: EJB
Luke Potter, Oct 30, 2001 [replies:4]
Does anyone know how to eliminate the error pasted below? I am accessing an EJB running in iPlanet AppServer 6.0 SP3 from a Rich Client using the CXS process. Both are running on Solaris. This error is generated repeatedly after first attempted access.
at java.lang.Throwable.fillInStackTrace(Native Method)
at java.lang.Throwable.<init>(Throwable.java:82)
at java.lang.Exception.<init>(Exception.java:33)
at java.lang.RuntimeException.<init>(RuntimeException.java:37)
at java.lang.ClassCastException.<init>(ClassCastException.java:36)
at com.sun.corba.ee.internal.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:296)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at com.netscape.ejb.KivaToCorbaObjectInputStream.resolveObject(Unknown Source)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:383)
at java.io.ObjectInputStream.inputArray(ObjectInputStream.java:951)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:357)
at java.io.ObjectInputStream.inputClassFields(ObjectInputStream.java:1831)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:502)
at java.io.ObjectInputStream.inputObject(ObjectInputStream.java:1166)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:232)
at com.kivasoft.ebfp.FPSerializable.unserialize(Unknown Source)
at com.kivasoft.ebfp.FPReply.getPayloadObjnative(Native Method)
at com.kivasoft.ebfp.FPReply.getPayloadObjnative(Native Method)
at com.kivasoft.ebfp.FPReply.getPayloadObj(Unknown Source)
at com.kivasoft.eb.boot.ejb_kcp_stub_IEBBootstrap.getHome(ejb_kcp_stub_IEBBootstrap.java:331)
at com.kivasoft.eb.boot.ejb_stub_IEBBootstrap.getHome(ejb_stub_IEBBootstrap.java:73)
at com.netscape.server.ejb.EjbContext.createHomeRef(Unknown Source)
at com.netscape.server.ejb.EjbContext.getHomeRef(Unknown Source)
at com.netscape.server.ejb.EjbContext.lookup(Unknown Source)
at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
at com.netscape.server.jndi.RootContext.lookup(Unknown Source)
at javax.naming.InitialContext.lookup(InitialContext.java:357)
at com.netscape.ejb.CorbaHomeFactoryImpl.ConstructEJBHome(Unknown Source)
at com.netscape.CosNaming.NamingContextImpl.resolve(Unknown Source)
at org.omg.CosNaming._NamingContextImplBase.invoke(_NamingContextImplBase.java:233)
at com.sun.corba.ee.internal.corba.ServerDelegate.dispatch(ServerDelegate.java:236)
at com.sun.corba.ee.internal.iiop.ORB.process(ORB.java:227)
at com.sun.corba.ee.internal.iiop.CachedWorkerThread.doWork(IIOPConnection.java:262)
at com.sun.corba.ee.internal.iiop.CachedWorkerThread.run(IIOPConnection.java:230)

Re: ClassCastExceptions using CXS process in iPlanet 6.0 SP3.
Topic: EJB
Bozidar Dangubic, Oct 30, 2001 [replies:3]
need the source. you are casting to a wrong type but what the actual problems is cannot be determined from the stack trace alone. send the source.

Re: Re: ClassCastExceptions using CXS process in iPlanet 6.0 SP3.
Topic: EJB
Luke Potter, Oct 30, 2001 [replies:2]
Here is the source that I believe is responsible, but I can't tell since there is no application-level call in the stack trace. It might also be worth saying that the same deployed ear file doesn't seem to cause the error on an NT machine.

this.sIPAddress = sIPAddress.trim();
this.sPortNumber = sPortNumber.trim();

user = new User();

Properties env = new Properties();

env.put("java.naming.provider.url", "iiop://" +sIPAddress +":"
+ sPortNumber);

Context jndiContext = new javax.naming.InitialContext(env);

cvHome = (CustViewsHome)jndiContext.lookup("ejb/CustViewsSB");
uHome =(UserHome)jndiContext.lookup("ejb/UserSB");
cvRemote = cvHome.create();
uRemote = uHome.create();

user = uRemote.getAuthorizedUser(sUserID);
}catch(AccuiException ee){
System.out.println("Accui Exception :"+ee.getMessage());
ee.printStackTrace() ;
}catch(Exception ed){
System.out.println("General Exception :"+ed.getMessage());
ed.printStackTrace() ;

Re: Re: Re: ClassCastExceptions using CXS process in iPlanet 6.0 SP3.
Topic: EJB
Bozidar Dangubic, Oct 30, 2001 [replies:1]
here is where the problem is (unless you are still working with EJB 1.0 which I doubt since you are using iPlanet 6).
cvHome = (CustViewsHome)jndiContext.lookup("ejb/CustViewsSB");
uHome =(UserHome)jndiContext.lookup("ejb/UserSB");
you have to use PortableRemoteObject to cast. you cannot cast directly as you are doing using java cast. so change the code to
Object ref = jndiContext.lookup("ejb/CustViewsSB");
cvHome = (CustViewsHome) PortableRemoteObject.narrow(ref,CustViewsHome.class);
ref =jndiContext.lookup("ejb/UserSB");
uHome = (UserHome) PortableRemoteObject.narrow(ref,UserHome.class);

Re: Re: Re: Re: ClassCastExceptions using CXS process in iPlanet 6.0 SP3.
Topic: EJB
Luke Potter, Oct 30, 2001
Thanks Bozidar. We made the suggested code change, as well as added lines of output that would help us trace how far the client app was getting. It is still getting hung up in this code, and the server is still throwing the same exceptions. It is also still working on the Application Server installed on the NT machine. Any other thoughts

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!