Accessing Sun App Server JNDI context from j2se client
The following client's code snippet is raising javax.naming.NameNotFoundException.
publicstaticvoid main(String[] args)
{
try
{
Context jndiContex = getInitialContext();
Object ref = jndiContex.lookup("java:comp/env/ejb/ru.srpu.jtest.service.UserRemote");
UserRemote user = (UserRemote)PortableRemoteObject.narrow(ref,UserRemote.class);
//logic goes here...
catch (NamingException e)
{
e.printStackTrace();
}
}
publicstatic Context getInitialContext( )throws javax.naming.NamingException
{
Properties p =new Properties( );
p.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.cosnaming.CNCtxFactory");
p.put(Context.PROVIDER_URL,"iiop://localhost:3700/");
returnnew javax.naming.InitialContext(p);
}
Beans are packed into the ejb-jar module of the EAR and deployed successfully. EJB's jndi-name is correct as well.
Help to find a bug, please!

