amd2002a
asked on
Accessing EJB Component from non j2ee application
I am trying to access a stateless session bean on a remote Websphere server from a java application. This is not a servlet and does not run in a web container, it's a plain old java app. Here is the code that is giving me trouble:
Context initial = new InitialContext();
Object o = initial.lookup("corbaname: iiop:wasde v3a:2810#e jb/com/xxx x/xxx/serv ices/membe rsearch/ej b/MemberSe archServic eEjbBean") ;
I get this exception:
javax.naming.NameNotFoundE xception [Root exception is org.omg.CosNaming.NamingCo ntextPacka ge.NotFoun d: IDL:omg.org/CosNaming/Nami ngContext/ NotFound:1 .0]
at com.sun.jndi.cosnaming.Exc eptionMapp er.mapExce ption(Exce ptionMappe r.java:44)
at com.sun.jndi.cosnaming.CNC tx.callRes olve(CNCtx .java:453)
at com.sun.jndi.cosnaming.CNC tx.lookup( CNCtx.java :492)
at com.sun.jndi.toolkit.url.G enericURLC ontext.loo kup(Generi cURLContex t.java:185 )
at javax.naming.InitialContex t.lookup(I nitialCont ext.java:3 47)
at com.ibx.ecomm.mistool.Main 2.main(Mai n2.java:54 )
Caused by: org.omg.CosNaming.NamingCo ntextPacka ge.NotFoun d: IDL:omg.org/CosNaming/Nami ngContext/ NotFound:1 .0
at org.omg.CosNaming.NamingCo ntextPacka ge.NotFoun dHelper.re ad(NotFoun dHelper.ja va:72)
at org.omg.CosNaming._NamingC ontextStub .resolve(_ NamingCont extStub.ja va:251)
at com.sun.jndi.cosnaming.CNC tx.callRes olve(CNCtx .java:440)
... 4 more
Exception in thread "main"
Can anyone give me any pointers on invoking an ejb from a plain old java app. First solution that actually works wins the points.
Thanks.
Context initial = new InitialContext();
Object o = initial.lookup("corbaname:
I get this exception:
javax.naming.NameNotFoundE
at com.sun.jndi.cosnaming.Exc
at com.sun.jndi.cosnaming.CNC
at com.sun.jndi.cosnaming.CNC
at com.sun.jndi.toolkit.url.G
at javax.naming.InitialContex
at com.ibx.ecomm.mistool.Main
Caused by: org.omg.CosNaming.NamingCo
at org.omg.CosNaming.NamingCo
at org.omg.CosNaming._NamingC
at com.sun.jndi.cosnaming.CNC
... 4 more
Exception in thread "main"
Can anyone give me any pointers on invoking an ejb from a plain old java app. First solution that actually works wins the points.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.