JiBX
  1. JiBX
  2. JIBX-324

NPE in ValueCustom.fillType()

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major 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 :
      0

      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...

        Activity

        Hide
        Dennis Sosnoski added a comment -

        Due to use of get-method and set-method attributes on a <value> customization. Added test case for this.

        Show
        Dennis Sosnoski added a comment - Due to use of get-method and set-method attributes on a <value> customization. Added test case for this.
        Dennis Sosnoski made changes -
        Field Original Value New Value
        Assignee Dennis Sosnoski [ dsosnoski ]
        Resolution Fixed [ 1 ]
        Fix Version/s JiBX 1.2.2 [ 15120 ]
        Status Open [ 1 ] Resolved [ 5 ]
        Dennis Sosnoski made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Dennis Sosnoski
            Reporter:
            Jean-Pierre Ragey
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: