If you are calling your ejb from another ejb you have to use the following
statement:
Object home = ctx.lookup("java:comp/env/ejb/test");
assuming you have linked your ejb to the other ejb in the deployment descriptor using
the following elements:
<ejb-ref>
<ejb-ref-name>ejb/test</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<home>package.testhome</home>
<remote>package.testremote</remote>
<ejb-link>test</ejb-link>
</ejb-ref>
Of course, you will have to replace package with the package of test and testhome with
what ever you called the home interface of test and testremote
whatever you
called the remote interface of test.
If you happen to call your ejb from a client running outside of jboss you will have to
use the following statements:
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL, "localhost:1099");
Context ctx = new InitialContext(props);
Object ref = ctx.lookup("test");
If your client is running on another machine, you have to replace localhost with the
name of the server.
I hope this helps!
Thomas Kirsch
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]