6 Replies Latest reply on Jun 26, 2012 4:16 AM by Dave Fr

    NullPointerException in Marshalling.fromJSON(Marshalling.java:157)

    Dave Fr Newbie

      Hi all,

       

      I'm using the current SNAPSHOT of the errai JAXRS and I get the following exception:

       

      13:56:39.286 [ERROR] [App] Uncaught exception escaped
      java.lang.NullPointerException: null
          at org.jboss.errai.marshalling.client.Marshalling.fromJSON(Marshalling.java:157)
          at org.jboss.errai.enterprise.client.jaxrs.MarshallingWrapper.fromJSON(MarshallingWrapper.java:56)
          at org.jboss.errai.enterprise.client.jaxrs.JaxrsProxyLoaderImpl$1ISupplierServiceRemoteImpl$1.onResponseReceived(JaxrsProxyLoaderImpl.java:587)
          at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
          at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
          at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:601)
          at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
          at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
          at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
          at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
          at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
          at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
          at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
          at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
          at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
          at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke(Method.java:601)
          at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
          at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
          at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
          at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
          at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
          at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
          at java.lang.Thread.run(Thread.java:722)
      

       

      it's in

       

      public static <T> T fromJSON(String json, Class<T> type, Class<?> assumedElementType) {
          EJValue parsedValue = ParserFactory.get().parse(json);
          MarshallingSession session = MarshallingSessionProviderFactory.getDecoding();
          if (assumedElementType != null) {
            session.setAssumedElementType(assumedElementType.getName());
          }
          Marshaller<Object> marshallerInstance = session.getMarshallerInstance(type.getName());
          return (T) marshallerInstance.demarshall(parsedValue, session);
        }
      

       

      the marshallerInstance becomes null

       

      I can't debug into the MarshallerFactoryImpl class but it is generate inside the .errai folder as well as the JaxrsProxyLoaderImpl class

       

      what could be the problem?