Hi Al,
I have changed my code to do that, instead of jndi.properties, I setup a
hashtable when create context.
In my orionconsole, I can see
ormi://p400.cheapdull.mine.nu->Applications->stamp->Context->Stamp
THe application which has the bean is called 'stamp', what i did...
props.put("java.naming.factory.initial",
"com.evermind.server.rmi.RMIInitialContextFactory");
props.put("java.naming.provider.url",
"ormi://p400.cheapdull.mine.nu");
props.put("java.naming.security.principal", "admin");
props.put("java.naming.security.credentials", "123");
context = new InitialContext(props);
Object boundObject = context.lookup("stamp/Stamp");
But what I got was:
javax.naming.NameNotFoundException: stamp/Stamp not found
at com.evermind.server.rmi.RMIContext.lookup(JAX)
I have also been trying do use ApplicationClientInitialContextFactory,
and set url="ormi://p400.cheapdull.mine.nu/stamp"
and did a context.lookup("Stamp")
but I get "java.lang.NullPointerException: domain was null" when I was
initiating the context....
Can anyone suggests what might be wrong here? is there *something* I
have to set in order to allow EJBs to be access from remote servers??
or is there some permission problem?
Thanks again!
Regards, James
Al Fogleson wrote:
>
> interesting, I connect to a remote server all the time using my clients. I
> just set up a jndi.properties file, but it would be similar to your setup.
> About the only thing I see is the /stamp after your remoteserver. I have
> never had anything after the ormi://remoteserver, Doing all the lookup in
> the jndi context. (I assume stamp is a subcontext you are looking in)
>
> thus if I had a bean (thisHome) that i bound to context stamp/myHomeObject I
> would go about it this way.... (using your env.....
>
> env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialC
> ontextFactory");
> env.put(Context.PROVIDER_URL,"ormi://remoteserver");
> env.put(Context.SECURITY_PRINCIPAL,"admin");
> env.put(Context.SECURITY_CREDENTIALS,"123");
> context = new InitialContext(env);
>
> thisHome home;
>
> home = (thisHome)
> PortableRemoteObject.narrow(context.lookup("stamp/myHomeObject"),
> thisHome.class);
>
> and so on... maybe I am totally missing what you want to do though. :)
>
> Al
>
> ----- Original Message -----
> From: "James Ho" <[EMAIL PROTECTED]>
> To: "Orion-Interest" <[EMAIL PROTECTED]>
> Sent: Sunday, October 08, 2000 3:10 AM
> Subject: How does orionconsole do it?? (remote EJBs)
>
> > Hi everyone,
> >
> > I am currently trying to access an remote EJB from a servlet. I had
> > this, in my code..
> >
> >
> >
> env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialC
> ontextFactory");
> > env.put(Context.PROVIDER_URL,"orim://remoteserver/stamp");
> > env.put(Context.SECURITY_PRINCIPAL,"admin");
> > env.put(Context.SECURITY_CREDENTIALS,"123");
> > context = new InitialContext(env);
> >
> > When I tried to lookup the EJB, it kept on saying 'domain was null'.
> > WHat happened was that it actually tried to look for 'stamp' in the
> > local orion server (and of course failed).
> >
> > What I wanted to do, is basically like orionconsole.jar, let u add a
> > server in, and then search the EJBs on the server, and mine is
> > web-based. How does orionconsole do it? How come the orion console
> > doesn't need the remote EJBs' home/remote interface?? I have been
> > having a lot of problem with servlets accessing remote EJBs.. :(
> >
> > Any help much appreciated.
> >
> > Thanks heaps...
> >
> > Regards, James.
> >