|
Problem |
How do you specify a remote EJB on another Application
Server? |
|
Solution |
If the EJB is on another Application Server within the
same domain, there is no special action required. Because of WebSphere's
distributed name space, a JNDI lookup for an EJB to any admininstration
server will return the correct home as long as the EJB exists anywhere in
that domain.
If the EJB is in another domain, then set the Context.PROVIDER_URL in the
code where you do the EJB lookup as follows:
Hashtable env = new Hashtable();
env.put(Context.PROVIDER_URL, "iiop://EJBHost");
Context context = new InitialContext(env);
where EJBHost is the host where the callee EJB resides. The
default value of Context.PROVIDER_URL is localhost. You can also choose to
use some other naming service by setting the
Context.INITIAL_CONTEXT_FACTORY. |
|
|
|
|
|
|