Wednesday, March 31, 2010

NullPointerException org.gjt.xpp.sax2.Driver.getIndex with cxf-codegen-plugin

If you faced with stacktrace as below:


mvn clean install -X -e



PROBLEM:

Caused by: java.lang.NullPointerException
<------>at org.gjt.xpp.sax2.Driver.getIndex(Driver.java:98)
<------>at com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor$AttributesImpl.getIndex(InterningXmlVisitor.java:112)
<------>at com.sun.xml.bind.v2.runtime.unmarshaller.XsiNilLoader.selectLoader(XsiNilLoader.java:62)
<------>at com.sun.xml.bind.v2.runtime.unmarshaller.ProxyLoader.startElement(ProxyLoader.java:53)
<------>at com.sun.xml.bind.v2.runtime.ElementBeanInfoImpl$IntercepterLoader.startElement(ElementBeanInfoImpl.java:231)
<------>at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:455)
<------>at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:433)
<------>at com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:71)
<------>at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:137)
<------>at org.gjt.xpp.sax2.Driver.parseSubTree(Driver.java:362)
<------>at org.gjt.xpp.sax2.Driver.parse(Driver.java:310)
<------>at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:211)
<------>at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:184)
<------>at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137)
<------>at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:184)
<------>at org.apache.cxf.tools.wsdlto.core.PluginLoader.getPlugin(PluginLoader.java:253)
<------>at org.apache.cxf.tools.wsdlto.core.PluginLoader.getPlugin(PluginLoader.java:212)
<------>at org.apache.cxf.tools.wsdlto.core.PluginLoader.loadPlugin(PluginLoader.java:140)
<------>at org.apache.cxf.tools.wsdlto.core.PluginLoader.loadPlugins(PluginLoader.java:115)
<------>at org.apache.cxf.tools.wsdlto.core.PluginLoader.init(PluginLoader.java:84)
<------>at org.apache.cxf.tools.wsdlto.core.PluginLoader.(PluginLoader.java:72)
<------>at org.apache.cxf.tools.wsdlto.core.PluginLoader.getInstance(PluginLoader.java:121)
<------>at org.apache.cxf.tools.wsdlto.WSDLToJava.(WSDLToJava.java:45)


By using the plugin


org.apache.cxf
cxf-codegen-plugin



SOLUTION:
To exclude the dom4j dependency!


mvn dependency:tree > tree.txt


To find where dom4j comes.

Exclude the dependency:



found_dependency
found_dependency
test


dom4j
dom4j





And fuck off the "pull-parser".
Add it to the exclusions.

1 comment:

Ben Carson said...

Fixed my problem.
Thanks for posting this!