6 Replies Latest reply on Oct 17, 2013 10:24 PM by Tao Lu

    Error: class is not available to the marshaller framework

    Tao Lu Newbie

      Hi, Experts,

       

      I am using Errai with RPC, so my objects are not marked as Portable, instead they are marked as old IsSerializable. But I keep getting Error: class is not available to the marshaller framework. Why is that? I am assuming the old RPC is fully supported by Errai.  Do I have to mark my objects as "Portable" even for RPC?

       

      Thanks a lot in advance!

       

      Tao

        • 1. Re: Error: class is not available to the marshaller framework
          Christian Sadilek Master

          Hi Tao,

           

          I assume you want to use plain GWT/RPC not Errai/RPC? Errai RPC definitely requires @Portable. Can you share the stacktrace with us?

           

          Cheers,

          Christian

          • 2. Re: Error: class is not available to the marshaller framework
            Tao Lu Newbie

            Thanks, Christian for your response!

             

            Yes, I want to do plain RPC. Here is the stacktrace:

             

            org.jboss.errai.bus.client.api.base.MessageDeliveryFailure: error invoking endpoint

              at org.jboss.errai.bus.server.io.ConversationalEndpointCallback.callback(ConversationalEndpointCallback.java:135)

              at org.jboss.errai.bus.server.io.RemoteServiceCallback.callback(RemoteServiceCallback.java:54)

              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)

            Caused by: org.jboss.errai.marshalling.client.api.exceptions.MarshallingException: class is not available to the marshaller framework: org.company.firestorm.client.shared.model.UserModel

              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.MessageQueueImpl.offer(MessageQueueImpl.java:186)

              at org.jboss.errai.bus.server.ServerMessageBusImpl.enqueueForDelivery(ServerMessageBusImpl.java:739)

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

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

              at org.jboss.errai.bus.client.api.base.ConversationMessageWrapper.sendNowWith(ConversationMessageWrapper.java:228)

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

              at org.jboss.errai.bus.server.io.ConversationalEndpointCallback.callback(ConversationalEndpointCallback.java:122)

              ... 26 more

            *** Message delivery failure ***

            Bus: org.jboss.errai.bus.server.ServerMessageBusImpl@d35fc47

            Message: CommandType=loadUserModelByEmail:java.lang.String:, ErrorTo=org.company.firestorm.client.local.delegate.UserAccountService:RPC.loadUserModelByEmail:java.lang.String::Errors:2, ReplyTo=org.company.firestorm.client.local.delegate.UserAccountService:RPC.loadUserModelByEmail:java.lang.String::RespondTo:2, ToSubject=org.company.firestorm.client.local.delegate.UserAccountService:RPC, MethodParms=[lynn2002@gmail.com]

            errorMessage: Error calling remote service: org.company.firestorm.client.local.delegate.UserAccountService:RPC

            exception: org.jboss.errai.bus.client.api.base.MessageDeliveryFailure: error invoking endpoint

            disconnect: false

             

             

             

            .... and FYI...

             

            <properties>

              <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

              <maven.compiler.source>1.6</maven.compiler.source>

              <maven.compiler.target>1.6</maven.compiler.target>

              <errai.version>2.3.0.Final</errai.version>

              <gwt.version>2.4.0</gwt.version>

              <weld.version>1.1.6.Final</weld.version>

              <gwt.maven.version>2.4.0</gwt.maven.version>

              <mvel.version>2.1.Beta8</mvel.version>

              <jetty.version>6.1.25</jetty.version>

              <slf4j.version>1.6.1</slf4j.version>

              <uel.impl.version>2.1.2-b04</uel.impl.version>

            </properties>



            • 3. Re: Error: class is not available to the marshaller framework
              Christian Sadilek Master

              Hi,

               

              Your stacktrace indicates that you are in fact using Errai RPC (not plain GWT/RPC) for the UserAccountService (loadUserModelByEmail). In this case your UserModel needs to be annotated with @Portable.

               

              Here are the details for Errai/RPC: http://docs.jboss.org/errai/2.4.0.Final/errai/reference/html_single/#sid-5931313

               

              and GWT/RPC: http://www.gwtproject.org/doc/latest/tutorial/RPC.html

               

              Errai/RPC uses our message bus and provides a programming model with less boilerplate. So, I'd recommend using it of course .

               

              Cheers,

              Christian

              • 4. Re: Error: class is not available to the marshaller framework
                Tao Lu Newbie

                Thanks a lot Christian!

                Yes, you are right, I am actually doing Errai RPC.

                 

                I have concern marking my objects as "Portable", cause my object graph has circular scenario. Does Errai marshall framework handle it ?

                Thanks again!

                Tao

                • 5. Re: Error: class is not available to the marshaller framework
                  Christian Sadilek Master

                  Hi Tao,

                   

                  Yes, Errai marshalling can deal with cycles in your object graph using object references in the payload.

                   

                  Cheers,

                  Christian

                  1 of 1 people found this helpful