JNDI Lookup / Struts / EJB
dmwayland Apr 12, 2002 6:23 PMHi,
I am running Tomcat and JBoss from the bundled download, that is i have a directory with both in.
i have to start them separately, jboss then tomcat and all is well.
but, for some reason the Struts Action class can no longer find the EJB, when i try and locate the one and only session bean, i get the following stack trace...
[...
BaseEventResult Constructor
LoginAction : Getting Home Reference
EJBUtils - getBaseHome()
Created InitialContext JNDI, LOOKING UP EJBEAN...
here's where things go wrong...
Received throwable with Message: jnp
getBaseHome() NamingExceptionjavax.naming.ServiceUnavailableException: jnp. Roo
t exception is java.net.UnknownHostException: jnp
at java.net.InetAddress.getAllByName0(InetAddress.java:571)
at java.net.InetAddress.getAllByName0(InetAddress.java:540)
at java.net.InetAddress.getByName(InetAddress.java:449)
at java.net.Socket.(Socket.java:100)
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:102)
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:776)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:340)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:333)
at javax.naming.InitialContext.lookup(InitialContext.java:350)
at com.deloitte.utils.EJBUtil.getBaseHome(EJBUtil.java:52)
at com.deloitte.web.LoginAction.handleEvent(LoginAction.java:119)
at com.deloitte.web.LoginAction.perform(LoginAction.java:68)
at org.apache.struts.action.ActionServlet.processActionPerform(ActionSer
vlet.java:1787)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:158
6)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
...]
I have a jboss.xml file whih binds the TestEJB to TestEJB,
I have the following JNDI properties set up:
[...
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
p.put(Context.PROVIDER_URL, "jnp://localhost:1099");
p.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
return new javax.naming.InitialContext(p);
...]
it was working, but now its not, i have tried all i can really think of.
...dmw
i would greatly appreciate some help or ideas.