Link to home
Start Free TrialLog in
Avatar of amd2002a
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:wasdev3a:2810#ejb/com/xxxx/xxx/services/membersearch/ejb/MemberSearchServiceEjbBean");

I get this exception:

javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
      at com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:44)
      at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:453)
      at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
      at com.sun.jndi.toolkit.url.GenericURLContext.lookup(GenericURLContext.java:185)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at com.ibx.ecomm.mistool.Main2.main(Main2.java:54)
Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
      at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
      at org.omg.CosNaming._NamingContextStub.resolve(_NamingContextStub.java:251)
      at com.sun.jndi.cosnaming.CNCtx.callResolve(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.
ASKER CERTIFIED SOLUTION
Avatar of rama_krishna580
rama_krishna580
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial