jaxb-ri icon indicating copy to clipboard operation
jaxb-ri copied to clipboard

JAXB throws NPE when wsgen from an object with <E extends Enum<E>

Open Tomas-Kraus opened this issue 12 years ago • 4 comments

Run wsgen.sh (from javaee6u4_ri-3.1.2-b21.zip) the following classes , it throws NPE exception :

Caused by: java.lang.NullPointerException at java.util.EnumMap.(EnumMap.java:113) at com.sun.xml.bind.v2.model.impl.RuntimeEnumLeafInfoImpl.(RuntimeEnumLeafInfoImpl.java:87) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createEnumLeafInfo(RuntimeModelBuilder.java:109) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.createEnumLeafInfo(RuntimeModelBuilder.java:85) at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:229) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:104) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:85) at com.sun.xml.bind.v2.model.impl.ModelBuilder.getClassInfo(ModelBuilder.java:214) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:99) at com.sun.xml.bind.v2.model.impl.RuntimeModelBuilder.getClassInfo(RuntimeModelBuilder.java:85)

Classes to reproduce this error:

--Service endpoint interface--

@javax.jws.WebService @XmlSeeAlso(Suit.class) public interface EnumTest { public <T extends Enum<T>> SomeObject<T> test2(SomeObject<T> o); }

---Service Endpoint Impl class-- @javax.jws.WebService(endpointInterface="foo.bar.EnumTest") public class EnumTestImpl implements EnumTest { public <T extends Enum<T>> SomeObject<T> test2(SomeObject<T> o)

{ return o; }

}

---SomeObject.class--

import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType;

@XmlAccessorType(XmlAccessType.FIELD) public class SomeObject<E extends Enum<E>> { private AnotherObject<E> obj;

public AnotherObject<E> getAnotherObject()

{ return obj; }

public void setAnotherObject(AnotherObject<E> obj)

{ this.obj = obj; }

}

-----AnotherObject.class---- import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*; @XmlAccessorType(XmlAccessType.FIELD) public class AnotherObject<E extends Enum<E>> { private E myEnum;

public E getMyEnum()

{ return myEnum; }

public void setMyEnum(E myEnum)

{ this.myEnum = myEnum; }

}

Affected Versions

[2.2.5]

Tomas-Kraus avatar Jan 29 '13 10:01 Tomas-Kraus

  • Issue Imported From: https://github.com/javaee/jaxb-v2/issues/946
  • Original Issue Raised By:@glassfishrobot
  • Original Issue Assigned To: @glassfishrobot

Tomas-Kraus avatar Sep 21 '18 16:09 Tomas-Kraus

@glassfishrobot Commented Reported by jimmajaxb

Tomas-Kraus avatar Jan 29 '13 10:01 Tomas-Kraus

@glassfishrobot Commented Was assigned to yaroska

Tomas-Kraus avatar Jan 29 '13 10:01 Tomas-Kraus

@glassfishrobot Commented This issue was imported from java.net JIRA JAXB-946

Tomas-Kraus avatar Apr 24 '17 12:04 Tomas-Kraus