1 Reply Latest reply on Jan 27, 2003 10:22 AM by f_kasper

    Binding and looking up an RMIService

    john_grater

      I'm using JBoss 3.0.2 and have what I thought was a simple task to achieve. Bind an RMI service and look it up from an external test program. How do I do it?!

      I create a user service by extending ServiceMBeanSupport and implementing startService() in which I bind my RMI Service.

      I've tried:
      new InitialContext().bind() - fails as object should be Serializable - doesn't make sense for RMI as whole point is to use the stubs etc
      org.jboss.naming.NonSerializableFactory.bind() - works fine in the server but looking up from the client just gives me null
      Naming.bind() - fails in the server with:
      java.rmi.MarshalException: Error marshaling transport header; nested exception is:
      java.net.SocketException: Connection aborted by peer: JVM_recv in socket input stream read
      java.net.SocketException: Connection aborted by peer: JVM_recv in socket input stream read
      at java.net.SocketInputStream.socketRead(Native Method)
      at java.net.SocketInputStream.readSocketInputStream.java:85)
      at java.io.BufferedInputStream.fill(BufferedInputStream.java:181)
      at java.io.BufferedInputStream.read(BufferedInputStream.java:199)
      at java.io.DataInputStream.readByte(DataInputStream.java:217)
      at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:201)
      at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:169)
      at sun.rmi.server.UnicastRef.newCall(UnicastRef.java:313)
      at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
      at java.rmi.Naming.bind(Naming.java:106)

      I've tried binding to "here" or "rmi://here", "jnp://here" etc

      The only "success" I can get is to bind as jnp with a Serializable object which comes down the wire to the client - but this isn't RMI which I'm trying to do.

      Apologies if this is a real newbie question but I'm coming from Weblogic and all this works in there.

      Thanks in advance for your help,
      John

        • 1. Re: Binding and looking up an RMIService
          f_kasper

          I have got the same kind of problem.
          I have searched the jboss forums and documentation without any luck.
          So now I ask here: how do i correctly set JBoss up to run RMI. eg. a RMI service used in a applet. (not ejb)
          Can anyone tell me the correct way of achieving this.

          Thanks in advert.
          Kasper