Hello,
I am trying to access EJBs from servlets. jBoss and Catalina are running as independent processes.
I can access EJBs through the following code in my servlet:
Properties _props = new Properties();
_props.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
_props.setProperty(Context.URL_PKG_PREFIXES, "org.jnp.interfaces");
_props.setProperty(Context.PROVIDER_URL, "192.168.1.101:1099");
Object ref = new InitialContext(_props).lookup("first/First");
Although I have seen in the docs that it is possible to define an ejb-ref in catalina's web.xml file:
<ejb-ref>
Example EJB Reference
<ejb-ref-name>ejb/FirstHome</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
firstbean.bean.FirstHome
firstbean.bean.First
</ejb-ref>
With this solution, where can I pass the other parameters (IP, port, ...)?
Which is the best solution for this?
TIA,
Victor Batista