Hi all,
Is it possible to access a stateless session bean or any other bean type from outside the
EJB container?
I tried to do a look-up of a deployed ejb in Weblogic from a standalone
Java program and had some problems, below is the stack trace of exception:
Exception in
thread "main" java.lang.ClassCastException: Cannot narrow remote object weblogic.rmi.internal.BasicRemoteRef - hostID: '-5351748351393873728S:127.0.0.1:[7001,7001,-1,-1,-1,-1,-1]:myDomain10:AdminServer', oid: '286', channel: 'null' to com.titan.travelagent.TravelAgentRemote
at weblogic.corba.server.naming.ReferenceHelperImpl.narrow(ReferenceHelperImpl.java:206)
at weblogic.rmi.extensions.PortableRemoteObject.narrow(PortableRemoteObject.java:88)
at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:32)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at com.titan.clients.Client.main(Client.java:30)
Below is the code that seems to cause the excepption:
TravelAgentRemote dao = (TravelAgentRemote)
PortableRemoteObject.narrow(ref,TravelAgentRemote.class);
I would like to know if this should be possible and if so is it good practice to use EJB from outside the application server where its deployed?
Thanks,
J.C