[
http://jira.codehaus.org/browse/MAXISTOOLS-4?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Dennis Lundberg moved MOJO-500 to MAXISTOOLS-4:
-----------------------------------------------
Component/s: (was: axistools)
Key: MAXISTOOLS-4 (was: MOJO-500)
Project: Maven 2.x Axis Tools Plugin (was: Mojo)
> Emitter NPE when no nsExcludes or nsIncludes supplied
> -----------------------------------------------------
>
> Key: MAXISTOOLS-4
> URL: http://jira.codehaus.org/browse/MAXISTOOLS-4
> Project: Maven 2.x Axis Tools Plugin
> Issue Type: Bug
> Reporter: Mike Laurie
> Assignee: Dan Tran
>
> When trying to use the <useEmitter>true</useEmitter> setting, I kept getting
> this NPE:
> {noformat}
> Caused by: java.lang.NullPointerException
> at
> org.apache.axis.wsdl.toJava.JavaGeneratorFactory.include(JavaGeneratorFactory.java:1643)
> at
> org.apache.axis.wsdl.toJava.JavaGeneratorFactory.getGenerator(JavaGeneratorFactory.java:317)
> at org.apache.axis.wsdl.gen.Parser.generateTypes(Parser.java:545)
> at org.apache.axis.wsdl.gen.Parser.generate(Parser.java:432)
> at org.apache.axis.wsdl.gen.Parser.access$000(Parser.java:45)
> at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:362)
> at java.lang.Thread.run(Thread.java:595)}}
> {noformat}
> I tracked this down to the fact that I hadn't specified any nsIncludes or
> nsExcludes. Nor do I want to - I just want to generate everything.
> Anyway - it's down to this code in Axis's JavaGeneratorFactory:
> {code}
> if (qName == null
> || emitter == null
> || emitter.getNamespaceIncludes().contains(selector)
> || (emitter.getNamespaceIncludes().size() == 0
> && !emitter.getNamespaceExcludes().contains(selector))) {
> doInclude = true;
> }
> {code}
> so the JavaGeneratorFactory is expecting the nsIncludes and nsExcludes to be
> non-null, although they can be empty.
> An easy fix in org.codehaus.mojo.axistools.wsdl2java.DefaultWSDL2JavaPlugin
> is to make sure the values of nsIncludes and nsExcludes are non-null:
> {noformat}
> $ svn diff
> Index:
> src/main/java/org/codehaus/mojo/axistools/wsdl2java/DefaultWSDL2JavaPlugin.java
> ===================================================================
> ---
> src/main/java/org/codehaus/mojo/axistools/wsdl2java/DefaultWSDL2JavaPlugin.java
> (revision 2342)
> +++
> src/main/java/org/codehaus/mojo/axistools/wsdl2java/DefaultWSDL2JavaPlugin.java
> (working copy)
> @@ -795,9 +795,9 @@
> // ?? is it correct ?
> emitter.setImports( !noImports );
> // TODO: is it comma separated in the mojo -> no documentation provided
> - emitter.setNamespaceExcludes( nsExcludes );
> + emitter.setNamespaceExcludes( nsExcludes == null ?
> java.util.Collections.EMPTY_LIST : nsExcludes );
> // TODO: is it comma separated in the mojo -> no documentation provided
> - emitter.setNamespaceIncludes( nsIncludes );
> + emitter.setNamespaceIncludes( nsIncludes == null ?
> java.util.Collections.EMPTY_LIST : nsIncludes );
> emitter.setNowrap( noWrapped );
> if ( StringUtils.isNotEmpty( namespaceToPackage ) )
> {noformat}
> I've fixed this in a local version and tested successfully.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email