Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: JiBX 1.2.1
-
Fix Version/s: JiBX 1.2.2
-
Component/s: core
-
Labels:None
-
Environment:java 6, linux
-
Number of attachments :
Description
I had a NullPointerException when Maven+Jibx2Wsdl converted a simple class with a custom mapping; stacktrace is:
[echo] Converting Java code to WSDL, xsd and binding.xml
[java] Exception in thread "main" java.lang.NullPointerException
[java] at org.jibx.custom.classes.ValueCustom.fillType(ValueCustom.java:491)
[java] at org.jibx.custom.classes.ClassCustom.apply(ClassCustom.java:831)
[java] at org.jibx.custom.classes.PackageCustom.apply(PackageCustom.java:147)
[java] at org.jibx.custom.classes.GlobalCustom.fillClasses(GlobalCustom.java:469)
[java] at org.jibx.ws.wsdl.tools.WsdlGeneratorCommandLine.applyOverrides(WsdlGeneratorCommandLine.java:187)
[java] at org.jibx.custom.CustomizationCommandLineBase.processArgs(CustomizationCommandLineBase.java:186)
[java] at org.jibx.ws.wsdl.tools.Jibx2Wsdl.main(Jibx2Wsdl.java:552)
Looking into the source code (fresh CVS checkout), I found the following lines:
ClassCustom.apply(), line 830+:
ValueCustom cust = (ValueCustom)namemap.get(name);
cust.fillType(null, req, style);
and ValueCustom.fillType(), line 490+:
/* package */void fillType(IClass info, Boolean req, Integer style) {
String type = info.getName();
So the ClassCustom line 831 call always leads a NPE, as info is null...
Due to use of get-method and set-method attributes on a <value> customization. Added test case for this.