You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Tom Davies <to...@atempo.com> on 2009/07/15 16:31:39 UTC
NullPointerException in wsdl2java on 2.2.2 and 2.2.3 SNAPSHOT
I am getting a NPE trying to parse the attached WSDL. I tried on 2.2.2 and
2.2.3 SNAPSHOT with same results. Could someone point me in the right
direction for what the issue might be?
Here is the stacktrace:
org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:260)
at
org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
Caused by: java.lang.NullPointerException
at
com.sun.xml.xsom.impl.util.SchemaWriter.complexType(SchemaWriter.java:413)
at com.sun.xml.xsom.impl.ComplexTypeImpl.visit(ComplexTypeImpl.java:236)
at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.addSchemaFragmentJavadoc(ClassSelector.java:422)
at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.access$300(ClassSelector.java:88)
at
com.sun.tools.xjc.reader.xmlschema.ClassSelector$Binding.build(ClassSelector.java:182)
at
com.sun.tools.xjc.reader.xmlschema.ClassSelector.executeTasks(ClassSelector.java:355)
at
com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:176)
at com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:114)
at com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:415)
at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:246)
at
com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:85)
at
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:331)
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaContainer.java:557)
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:208)
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:127)
at
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:252)
... 3 more
http://www.nabble.com/file/p24499113/plbm.wsdl plbm.wsdl
--
View this message in context: http://www.nabble.com/NullPointerException-in-wsdl2java-on-2.2.2-and-2.2.3-SNAPSHOT-tp24499113p24499113.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: NullPointerException in wsdl2java on 2.2.2 and 2.2.3 SNAPSHOT
Posted by Tom Davies <to...@atempo.com>.
dkulp wrote:
>
>
> JAXB is definitely giving a useless error here.
>
> The problem is with:
>
> <complexType name="Include">
> <complexContent>
> <restriction base="lbcm:FileData">
> </restriction>
> </complexContent>
> </complexType>
>
> That's not valid. FileData is defined as:
> <simpleType name="FileData">
> <restriction base="xsd:base64Binary">
> </restriction>
> </simpleType>
>
> You cannot have a complexContent that is a simpleType. If you change
> that
> to:
>
> <simpleType name="Include">
> <restriction base="lbcm:FileData">
> </restriction>
> </simpleType>
>
> It would probably work.
>
> Dan
>
>
Great. That was it. Is there a chance wsdl2java could display a more
helpful message such as the line number or element name that has the issue?
At least not a NPE if possible.
Thanks for your help.
Tom
--
View this message in context: http://www.nabble.com/NullPointerException-in-wsdl2java-on-2.2.2-and-2.2.3-SNAPSHOT-tp24499113p24500618.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: NullPointerException in wsdl2java on 2.2.2 and 2.2.3 SNAPSHOT
Posted by Daniel Kulp <dk...@apache.org>.
JAXB is definitely giving a useless error here.
The problem is with:
<complexType name="Include">
<complexContent>
<restriction base="lbcm:FileData">
</restriction>
</complexContent>
</complexType>
That's not valid. FileData is defined as:
<simpleType name="FileData">
<restriction base="xsd:base64Binary">
</restriction>
</simpleType>
You cannot have a complexContent that is a simpleType. If you change that
to:
<simpleType name="Include">
<restriction base="lbcm:FileData">
</restriction>
</simpleType>
It would probably work.
Dan
On Wed July 15 2009 10:31:39 am Tom Davies wrote:
> I am getting a NPE trying to parse the attached WSDL. I tried on 2.2.2 and
> 2.2.3 SNAPSHOT with same results. Could someone point me in the right
> direction for what the issue might be?
>
> Here is the stacktrace:
>
> org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
> at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>.java:260) at
> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:83)
> at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:103)
> at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:173)
> Caused by: java.lang.NullPointerException
> at
> com.sun.xml.xsom.impl.util.SchemaWriter.complexType(SchemaWriter.java:413)
> at com.sun.xml.xsom.impl.ComplexTypeImpl.visit(ComplexTypeImpl.java:236)
> at
> com.sun.tools.xjc.reader.xmlschema.ClassSelector.addSchemaFragmentJavadoc(C
>lassSelector.java:422) at
> com.sun.tools.xjc.reader.xmlschema.ClassSelector.access$300(ClassSelector.j
>ava:88) at
> com.sun.tools.xjc.reader.xmlschema.ClassSelector$Binding.build(ClassSelecto
>r.java:182) at
> com.sun.tools.xjc.reader.xmlschema.ClassSelector.executeTasks(ClassSelector
>.java:355) at
> com.sun.tools.xjc.reader.xmlschema.BGMBuilder._build(BGMBuilder.java:176)
> at
> com.sun.tools.xjc.reader.xmlschema.BGMBuilder.build(BGMBuilder.java:114) at
> com.sun.tools.xjc.ModelLoader.annotateXMLSchema(ModelLoader.java:415) at
> com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.j
>ava:246) at
> com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.j
>ava:85) at
> org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.initialize(JAX
>BDataBinding.java:331) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.generateTypes(WSDLToJavaCon
>tainer.java:557) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaConta
>iner.java:208) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>.java:127) at
> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>.java:252) ... 3 more
>
> http://www.nabble.com/file/p24499113/plbm.wsdl plbm.wsdl
--
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog