I have never tried to do what you are talking about, but you might want to
try using com.evermind.server.rmi.RMIInitialContextFactory as your
INITIAL_CONTEXT_FACTORY within your servlet.
so..........
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.rmi.RMIInitialContextFactory");
env.put(Context.PROVIDER_URL, "ormi://yourserver.com/yourapp");
env.put(Context.SECURITY_PRINCIPAL, myUser);
env.put(Context.SECURITY_CREDENTIALS, myPass);
Context initCtx = new InitialContext(env);
initCtx.lookup(.......etc.,etc.

-jason

>
> NOTE:  This is a repost.  The message now includes a subject (oops!) and
> more detail.
>
> A coworker and I are trying to create a servlet that will run on his
> computer under Tomcat.  This servlet is attempting to lookup and
> use an EJB
> deployed on my computer under Orion.  This servlet is using the
> com.evermind.server.ApplicationInitialContextFactory.
>
> When the servlet performs the context object's lookup method (using the
> String literal "java:com/env/fungi"), we get the following exception
> displayed on his computer:
>
>       "Exception: javax.naming.NamingException:  java:comp/env namespace
> is only available from within the J2EE environment ."
>
> A command-line client application run on the same coworker's computer IS
> able to successfully lookup the same EJB on my computer using the
> "java:com/env/fungi" String literal.  This command-line client is
> using the
> com.evermind.server.ApplicationClientInitialContextFactory.
>
> We have been unable to find any documentation about the NamingException
> described above.
>
> Please, would someone explain reasons we might be getting this exception
> and/or the proper way to access an Orion EJB from a Tomcat servlet?  We
> would appreciate any assistance that can be given.
>
> Thank you.
>
> Mark McLain
> Systems Developer
> Sybron Laboratory Products Corporation
>


Reply via email to