• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Can't find SerialContextProvider

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am getting this error in EJBClient while trying to get Home..

javax.naming.CommunicationException: Can't find SerialContextProvider
at com.sun.enterprise.naming.SerialContext.getProvider(SerialContext.java:63)
at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:120)
at javax.naming.InitialContext.lookup(InitialContext.java:350)

<mycode>
Context initial = new InitialContext();
Object objref = initial.lookup("MyJndiName");
MyEJBHome home = (MyEJBHome)PortableRemoteObject.narrow(objref, MyEJBHome.class);
</mycode>
Please help
 
Mohammed Zayed
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I changed the code and its working.
<mycode>
Properties env = new Properties();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
env.put(Context.PROVIDER_URL, "iiop://localhost:9010");
env.put(Context.SECURITY_PRINCIPAL, "myUserName 1234");
env.put(Context.SECURITY_CREDENTIALS, "myPassword 9876");
Context initial = new InitialContext(env);
Object objref = initial.lookup("MyJndiName");
MyEJBHome home = (MyEJBHome)PortableRemoteObject.narrow(objref, MyEJBHome.class);
</mycode>

Cheers!!
Zayed
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic