Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-11095

(7.0.z) NullPointerException while deserializing an object whose class doesn't have a no-arg constructor

XMLWordPrintable

      On the client side, during deserialization of an object graph, if one of the object's class doesn't have a no-arg constructor, the deserialization runs into a NullPointerException which looks like:

      java.lang.NullPointerException
      	at org.jboss.marshalling.reflect.SerializableClass.invokeConstructorNoException(SerializableClass.java:510)
      	at org.jboss.marshalling.reflect.SerializableClass.callNonInitConstructor(SerializableClass.java:484)
      	at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1282)
      	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:276)
      	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:224)
      	at org.jboss.marshalling.river.RiverUnmarshaller.readFields(RiverUnmarshaller.java:1745)
      	at org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1658)
      	at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1285)
      	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:276)
      	at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)
      	at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
      
      

      The class within the object graph that triggered this, in this specific case was org.glassfish.json.JsonLocationImpl whose source is here https://java.net/projects/jsonp/sources/git/content/impl/src/main/java/org/glassfish/json/JsonLocationImpl.java

              dlloyd@redhat.com David Lloyd
              spyrkob Bartosz Spyrko-Smietanko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: