Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5172

JAXB-RI databinding issue. Axis2-wsdl2code-maven-plugin does not allow XJC compiler properties w/o providing some value

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.0, 1.6.1
    • Fix Version/s: None
    • Component/s: databinding, modules
    • Labels:
    • Environment:
      Windows 7 x64, Sun JDK 1.6

      Description

      Example plugin configuration (jaxbri databinding):

      <plugin>
      <groupId>org.apache.axis2</groupId>
      <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
      <version>1.6.1</version>
      <executions>
      <execution>
      <id>generate service skeleton</id>
      <phase>generate-sources</phase>
      <inherited>false</inherited>
      <goals>
      <goal>wsdl2code</goal>
      </goals>
      <configuration>
      <packageName>...</packageName>
      <generateAllClasses>false</generateAllClasses>
      <generateServerSide>true</generateServerSide>
      <databindingName>jaxbri</databindingName>
      <generateServerSideInterface>true</generateServerSideInterface>
      <skipMessageReceiver>true</skipMessageReceiver>
      <generateServicesXml>true</generateServicesXml>
      <wsdlFile>SomeService.wsdl</wsdlFile>
      <namespaceURIs>
      <namespaceURI>
      <uri>...</uri>
      <packageName>...</packageName>
      </namespaceURI>
      </namespaceURIs>
      <options>
      <property>
      <name>bindingFileName</name>
      <value>binding.jxb</value>
      </property>
      <!-- generate toString methods -->
      <property>
      <name>XtoString</name>
      <value>someString</value>
      </property>
      <!-- generate equals methods -->
      <property>
      <name>Xequals</name>
      <value>someString</value>
      </property>
      <!-- generate hashCode methods -->
      <property>
      <name>XhashCode</name>
      <value>someString</value>
      </property>
      </options>
      </configuration>
      </execution>
      </executions>
      <dependencies>
      <dependency>
      <groupId>org.apache.axis2</groupId>
      <artifactId>axis2-jaxbri</artifactId>
      <version>1.6.1</version>
      </dependency>
      <dependency>
      <groupId>org.apache.axis2</groupId>
      <artifactId>axis2-codegen</artifactId>
      <version>1.6.1</version>
      </dependency>
      <dependency>
      <groupId>org.jvnet.jaxb2_commons</groupId>
      <artifactId>jaxb2-basics</artifactId>
      <version>${jaxb2.basics.version}</version>
      </dependency>
      <dependency>
      <groupId>org.jvnet.jaxb2_commons</groupId>
      <artifactId>jaxb2-basics-annotate</artifactId>
      <version>${jaxb2.basics.annotate.version}</version>
      </dependency>
      <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>${jaxb.version}</version>
      </dependency>
      <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-xjc</artifactId>
      <version>${jaxb.version}</version>
      </dependency>
      </dependencies>
      </plugin>

      The properties XtoString, Xequals, XhashCode don't have any values.
      Because of the bug you must provide some string values and can't completely omit <value> element like this:

      <!-- generate toString methods -->
      <property>
      <name>XtoString</name>
      </property>
      <!-- generate equals methods -->
      <property>
      <name>Xequals</name>
      </property>
      <!-- generate hashCode methods -->
      <property>
      <name>XhashCode</name>
      </property>

      But now it throws the following exception:
      com.sun.tools.xjc.BadCommandLineException
      at com.sun.tools.xjc.Options.parseArguments(Options.java:779)
      at org.apache.axis2.jaxbri.CodeGenerationUtility.processSchemas(CodeGenerationUtility.java:239)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.axis2.wsdl.codegen.extension.JAXBRIExtension.engage(JAXBRIExtension.java:101)
      at org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:246)
      at org.apache.axis2.maven2.wsdl2code.WSDL2CodeMojo.execute(WSDL2CodeMojo.java:567)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
      at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

      I've attached a patch to fix this bug.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              anastyn Andrew Nastyn
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: