4 Replies Latest reply on Jan 24, 2006 9:46 AM by Jason Lee

    SocketException and Remote Session Beans

    Jason Lee Newbie

      I'm trying to get started with JBoss and session beans, remote beans to be specific. I have the bean successfully deployed to JBoss 4.0.3, and my client successfully executes a method on the remote bean. When my client exits, however, the server dumps the following exception to the console:

      09:26:09,518 ERROR [ServerThread] failed
      java.net.SocketException: Connection reset
       at java.net.SocketInputStream.read(SocketInputStream.java:168)
       at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
       at java.io.BufferedInputStream.read(BufferedInputStream.java:235)
       at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2200)
       at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2380)
       at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2447)
       at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2519)
       at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2668)
       at java.io.ObjectInputStream.readByte(ObjectInputStream.java:864)
       at org.jboss.remoting.transport.socket.ServerSocketWrapper.checkConnection(ServerSocketWrapper.java:54)
       at org.jboss.remoting.transport.socket.ServerThread.acknowledge(ServerThread.java:217)
       at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:298)
       at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:169)
      


      The server appears to be fine, as I can run my client over and over (it's a simple "Hello, world" test), but I'd like to clean up that exception. In case it is significant, if I comment out the call to the bean from client (i.e., leave the InitialContext acquisition, etc), I don't get the exception. Also, for what it's worth, here's my client code:

      try {
       Hashtable env = new Hashtable();
       Context context = new InitialContext(env);
       HelloWorld hw = (HelloWorld)context.lookup(HelloWorldRemote.class.getName());
       System.out.println(hw.sayHello("Jason"));
       }
       catch(Throwable ex)
       {
       ex.printStackTrace();
       }


      and here's my jndi.properites:

      java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
      java.naming.provider.url=jnp://it06:1099
      java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
      java.naming.factory.url.pkgs=org.jnp.interfaces


      Thanks! :)