Skip to Content
0
Former Member
Jan 28, 2008 at 11:23 PM

java.lang.ClassCastException on Java Client Proxy

38 Views

Hi Guys.

I'm trying to call a Java Proxy Client from a J2SE application. The code I'm using is the following :

OaCuentasPorCobrarReplicar_PortTypeHome queryOutHome;
OaCuentasPorCobrarReplicar_PortTypeRemote queryOutRemote;
OaCuentasPorCobrarReplicar_PortType iaMaestroDeProveedoresReplicar_PortTypeHome;
Properties p = new Properties();
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sap.engine.services.jndi.InitialContextFactoryImpl");
p.put(Context.PROVIDER_URL,"devxi:50004");
p.put(Context.SECURITY_PRINCIPAL,"duztariz");
p.put(Context.SECURITY_CREDENTIALS,"inicio");


Context ctx = new InitialContext(p);
Object ref = ctx.lookup("java:comp/env/ejb/cuentasPorCobrar");
queryOutHome = (OaCuentasPorCobrarReplicar_PortTypeHome) PortableRemoteObject.narrow(ref,OaCuentasPorCobrarReplicar_PortTypeHome.class);
queryOutRemote = queryOutHome.create();

And when executed I'm getting this error :

java.lang.ClassCastException

at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(Unknown Source)

at javax.rmi.PortableRemoteObject.narrow(Unknown Source)

at cobeca.com.ve.traductor.api.Traductor.main(Traductor.java:114)

Caused by: java.lang.ClassCastException: com.sap.engine.services.jndi.persistent.UnsatisfiedReferenceImpl

... 3 more

The EJB is on a Unix machine, and my J2SE application is on my windows workstation.

Could u show me the light at the end of the tunnel?

Best Regards

David.