on 01-28-2008 11:23 PM
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.
That error occurs when the line of code above is executed :
queryOutHome = (OaCuentasPorCobrarReplicar_PortTypeHome) PortableRemoteObject.narrow(ref,OaCuentasPorCobrarReplicar_PortTypeHome.class);
I´ve included the .jar file containing the stub classes into my NWDS project.
Best Regards
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In this case, write:
Object ref = ctx.lookup("cuentasPorCobrar");
nothing else.
See also this guide for more details:
Regards
Stefan
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.