2 Replies Latest reply on Feb 11, 2002 10:47 AM by kevin alexander

    servlet not finding an ejb..

    kevin alexander Newbie

      We've been able to write a servlet that resides within a Tomcat 4.0 container talk to an EJB we've written that sits in the JBoss3 EJB container..

      However, when we run the same servlet on another box (another IP addy) it (the servlet) poops out giving us the following stack trace:


      Root exception is java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is:
      java.net.ConnectException: Connection refused
      java.net.ConnectException: Connection refused
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
      at java.net.Socket.(Socket.java:273)
      at java.net.Socket.(Socket.java:100)
      at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:25)
      at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:120)
      at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:83)
      at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:365)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:349)
      at javax.naming.InitialContext.lookup(InitialContext.java:354)
      at net.trapdoor.webom.servlet.JavaWebOMServlet.doPost(Unknown Source)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)

      . . . (you get the idea)

      Prior to running this, we've set the property

      java.naming.provider.url=xxx.xx.xx.xxx:1099

      which is the address of the machine where JBOSS is running but we seem to be stuck (and trying to RTFM)..

      Anyone know what elementary mistake we're making? It's got to be simple and I'm not seeing it...

      It looks to me like the servlet thinks that the jndi lookup url is 127.0.0.1..

      thanks,
      kevin alexander