2 Replies Latest reply on Jan 11, 2006 6:47 PM by Milt Grinberg

    question using Remoting TransportServer/Client

    Milt Grinberg Newbie

      I have a very complex object that I am trying to communicate between server and client. I have used the example in section 3. "Transporter sample - JBoss serialization" as my guide. If I return a null value it works fine. However if I try to return a real object I get a complex serialization error:

      org.jboss.serial.exception.SerializationException
      at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:82)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:72)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:131)
      .....

      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      ... 110 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:72)
      ... 120 more
      Caused by: org.jboss.serial.exception.SerializationException
      at org.jboss.serial.persister.PrivateWritePersister.writeData(PrivateWritePersister.java:82)
      at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.describeObject(ObjectDescriptorFactory.java:72)
      at org.jboss.serial.objectmetamodel.DataContainer$DataContainerOutput.writeObject(DataContainer.java:131)
      ... 124 more
      Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      ... 139 more
      Caused by: java.rmi.MarshalException: Invalid remote object
      at java.rmi.server.RemoteObject.writeObject(RemoteObject.java:347)
      ... 144 more


      I have only built the interface/implementation for the highest level object that I was trying to pass between client/server. Here is the code that sets up the server

      String locatorURI = "socket://localhost:5401/?serializationtype=jboss";
      TransporterServer server = null;
      server = TransporterServer.createTransporterServer(locatorURI, new ProviderInterfaceImpl());
      info.transporter = server;

      Do I need to build intefaces for all the objects that get indirectly passed and do I need to indicate to the transferServer all of these implementations?

      Any help would be appreciated.


        • 1. Re: question using Remoting TransportServer/Client
          Tom Elrod Master

          Sorry for the delay (been working on getting out the next release). I am a little lost as to the changes you've made. Would it be possible to send the source to the chagnes you've made (tom@jboss.org) and I'll look into it. I do know that we fixed a bug where we were looking at the type of the object passed and not it's declared interface, which was causing a limitation (although does not seem to be what you are seeing).

          Thanks.

          -Tom

          • 2. Re: question using Remoting TransportServer/Client
            Milt Grinberg Newbie

            I think I figured out the problem I was having. There appeared to be two issues. The first being that I didn't have empty constructors (i.e.,
            public x (){}) for some of the variables that were being serialized. The second problem was that some of the constructors of variables being serialized were actually trying to use the main object that I was trying to ship. This wasn't a problem on the server since they were instantiated after the object was created. But on pulling them over this caused a recursive instantiation of the main object (which was suppose to be a singleton).

            I now seem to have everything working using the 1.4.0 beta version. I will continue to test and report back any problems.