1 Reply Latest reply on Jun 3, 2013 9:47 AM by Jonathan Fuerth

    Marshal Exception

    Mike Dennis Newbie

      Hey Folks - we are progressing along on Errai ... now we have hit this issue:

       

      Error calling remote service: HelloWorldService -- Additional Details:

      org.jboss.errai.marshalling.client.api.exceptions.MarshallingException: class is not available to the marshaller framework: com.mytest.erraibus.client.Tick

          at org.jboss.errai.marshalling.server.MappingContextSingleton$4.getMarshaller(MappingContextSingleton.java:292)

          at org.jboss.errai.marshalling.client.api.AbstractMarshallingSession.getMarshallerInstance(AbstractMarshallingSession.java:67)

          at org.jboss.errai.marshalling.client.util.MarshallUtil.getMarshaller(MarshallUtil.java:125)

          at org.jboss.errai.marshalling.client.marshallers.ErraiProtocolEnvelopeMarshaller.marshall(ErraiProtocolEnvelopeMarshaller.java:97)

          at org.jboss.errai.marshalling.client.protocols.ErraiProtocol.encodePayload(ErraiProtocol.java:40)

          at org.jboss.errai.marshalling.server.protocol.ErraiProtocolServer.encodePayloadToByteArrayInputStream(ErraiProtocolServer.java:31)

          at org.jboss.errai.bus.server.io.BufferHelper.encodeAndWrite(BufferHelper.java:88)

          at org.jboss.errai.bus.server.ServerMessageBusImpl$RemoteMessageCallback.callback(ServerMessageBusImpl.java:1023)

          at org.jboss.errai.bus.client.framework.DeliveryPlan.deliver(DeliveryPlan.java:43)

          at org.jboss.errai.bus.server.ServerMessageBusImpl.sendGlobal(ServerMessageBusImpl.java:632)

          at org.jboss.errai.bus.server.ServerMessageBusImpl.send(ServerMessageBusImpl.java:682)

          at org.jboss.errai.bus.client.api.base.CommandMessage.sendNowWith(CommandMessage.java:328)

          at org.jboss.errai.bus.client.api.base.DefaultMessageBuilder$1.sendNowWith(DefaultMessageBuilder.java:78)

          at com.mytest.erraibus.server.HelloWorldService.callback(HelloWorldService.java:59)

          at org.jboss.errai.bus.client.framework.DeliveryPlan.deliver(DeliveryPlan.java:43)

          at org.jboss.errai.bus.server.ServerMessageBusImpl.sendGlobal(ServerMessageBusImpl.java:632)

          at org.jboss.errai.bus.server.SimpleDispatcher.dispatchGlobal(SimpleDispatcher.java:46)

          at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:93)

          at org.jboss.errai.bus.server.service.ErraiServiceImpl.store(ErraiServiceImpl.java:107)

          at org.jboss.errai.bus.server.servlet.DefaultBlockingServlet.doPost(DefaultBlockingServlet.java:117)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

          at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

          at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)

          at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)

          at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

          at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)

          at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)

          at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

          at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)

          at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

          at org.mortbay.jetty.Server.handle(Server.java:324)

          at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)

          at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)

          at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)

          at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

          at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

          at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)

          at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488

       

       

       

      We are on 2.3.0 final.

       

      The Tick class implements Serializable and we are using google inject since we are trying to refactor an existing gwt app.

       

      Will this work? or do we need to make it @Portable and bring in CDI? We do not want to bring in CDI right now ... too many moving parts.

       

      Pls advise.

       

      HelloWorldService code to send the message to the client - it works for simple cases like String etc.

       

        MessageBuildSubject<MessageBuildSendableWithReply> aMsg =  MessageBuilder.createMessage();
        MessageBuildCommand<MessageBuildSendableWithReply> cmdMsg = aMsg.toSubject("HelloWorldClient");
        MessageBuildParms<MessageBuildSendableWithReply> msgParams = cmdMsg.with("InternalTick", tick1);
        msgParams.with("InternalTick2", tick2); 
        MessageBuildSendableWithReply noErrMsg = msgParams.noErrorHandling();
        noErrMsg.sendNowWith(msgBus22);
        • 1. Re: Marshal Exception
          Jonathan Fuerth Master

          Yes, all objects you send across the bus must meet all of these requirements:

           

          1. be marked @Portable or listed as a portable type in ErraiApp.properties

          2. be in a GWT source package

          3. be deployed to the server as well (you normally meet requirements 2 and 3 by placing the type in a "shared" package)

          4. be in a classpath location (jar or filesystem directory) that includes an ErraiApp.properties at its root

           

          The @Portable annotation is defined in the Errai Marshalling module. It does not depend on Errai CDI, but both ErraiCDI and ErraiBus do depend on Errai Marshalling. If you're using Maven and depending on errai-bus, errai-marshalling should already be on your project's classpath.

           

          -Jonathan