Uploaded image for project: 'JBoss Marshalling'
  1. JBoss Marshalling
  2. JBMAR-181

NullPointerException while deserializing an object whose class doesn't have a no-arg constructor

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.4.12.Final, 1.5.0.Beta1
    • 1.4.10.Final
    • None
    • None

      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
              jaikiran Jaikiran Pai (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: