You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by _Eric_ <E....@d-trust.net> on 2008/10/21 15:47:56 UTC
Re: wsdl2java NullPointer
Sorry for answering so late, other important things could'nt wait in the cue.
howerver, it seems to be a problem of JAXB.
<xs:complexType name="ExecuteType">
<xs:sequence>
<xs:element name="Payload" >
<xs:complexType>
<xs:choice>
<xs:element name="test" type="xs:string" />
<xs:element name="test" type="xs:string" />
</xs:choice>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
If I replace the complex type of Payload to a simple type like string. It
works well. Are there any sugestions how to solve this problem?
dkulp wrote:
>
>
> I think I'll need to see the wsdl. Looking at the code, I cannot see how
> a
> NPE could occur there. The line in question is:
> if (names.containsKey(element.getElementName())
>
> names is defined as:
> Map<QName, QName> names = new HashMap<QName, QName>();
> just a few lines earlier. Thus, it cannot be null.
>
> element is from a List<WrapperElement>, but I checked the method that
> generates that List and all the adds are of the form:
> list.add(new WrapperElement(.....));
> (creating it as part of the add line)
> thus, there isn't a way for add(null) to be called. :-(
>
> Anyway, I'd like to see the wsdl.
> Dan
>
>
> On Monday 29 September 2008 4:47:27 am _Eric_ wrote:
>> When I run the wsdl2java tool I get an NullPointerexception.
>>
>> E:\Eric\_Projects\TK\wsdl2java>C:\temp\apache-cxf-2.1.2\bin\wsdl2java
>> -verbose QesService.wsdl
>> Loading FrontEnd jaxws ...
>> Loading DataBinding jaxb ...
>> wsdl2java -verbose QesService.wsdl
>> wsdl2java - Apache CXF 2.1.2
>>
>>
>> WSDLToJava Error: java.lang.NullPointerException
>>
>> org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
>> at
>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>.java:240) 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
>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameCollis
>>ionValidator.isValidOperation(WrapperStyleNameCollisionValidator.java:120)
>> at
>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameCollis
>>ionValidator.checkNameColllision(WrapperStyleNameCollisionValidator.java:58)
>> at
>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameCollis
>>ionValidator.isValid(WrapperStyleNameCollisionValidator.java:51) at
>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.validate(WSDLToJavaContaine
>>r.java:547) at
>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>.java:193) at
>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>.java:232) ... 3 more
>>
>>
>> Google brought me some posting that sugest it is a mixture of problem in
>> CXF and in the wsdl. How can I find a workaround for the problem?
>>
>> Grettings
>> Eric
>
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
>
>
--
View this message in context: http://www.nabble.com/wsdl2java-NullPointer-tp19720254p20090683.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: wsdl2java NullPointer
Posted by Daniel Kulp <dk...@apache.org>.
OK. Figured this out and have a fix for it that I'm testing now. One
workaround WAS to change the Payload to a top level complexType instead of an
anonymous type, but that exposed another problem: if the "Service" name
is "Service", the generated code doesn't compile. I'm fixing that as
well.
Dan
On Friday 31 October 2008 11:17:56 am _Eric_ wrote:
> Sorry for answering late, I got some priority confusion. Howerver, I tried
> version 2.1.3 and so I will provide the WSDL and XSDs in a very simplified
> form.
>
> http://www.nabble.com/file/p20268101/service.wsdl service.wsdl
> http://www.nabble.com/file/p20268101/transport.xsd transport.xsd
>
> dkulp wrote:
> > 1) Any chance you can try with 2.1.3 (released yesterday)?
> >
> > 2) If not, can you send the wsdl/schemas? We can then run it in the
> > debugger
> > to figure out what is going on.
> >
> > Dan
> >
> > On Tuesday 21 October 2008 10:35:27 am _Eric_ wrote:
> >> good hint, but does'nt help anything :-(
> >>
> >> Andrew Clegg wrote:
> >> > My first thought is, how can you have a 'choice' between two elements
> >> > with the same name and type?
> >> >
> >> > Does it still cause the error if you change the name and/or type of
> >> > one of them?
> >> >
> >> > Andrew.
> >> >
> >> > 2008/10/21 _Eric_ <E....@d-trust.net>:
> >> >> Sorry for answering so late, other important things could'nt wait in
> >>
> >> the
> >>
> >> >> cue.
> >> >>
> >> >> howerver, it seems to be a problem of JAXB.
> >> >> <xs:complexType name="ExecuteType">
> >> >> <xs:sequence>
> >> >> <xs:element name="Payload" >
> >> >> <xs:complexType>
> >> >> <xs:choice>
> >> >> <xs:element
> >> >> name="test" type="xs:string" />
> >> >> <xs:element
> >> >> name="test" type="xs:string" />
> >> >> </xs:choice>
> >> >> </xs:complexType>
> >> >> </xs:element>
> >> >> </xs:sequence>
> >> >> </xs:complexType>
> >> >>
> >> >> If I replace the complex type of Payload to a simple type like
> >> >> string. It works well. Are there any sugestions how to solve this
> >> >> problem?
> >> >>
> >> >> dkulp wrote:
> >> >>> I think I'll need to see the wsdl. Looking at the code, I cannot
> >>
> >> see
> >>
> >> >>> how
> >> >>> a
> >> >>> NPE could occur there. The line in question is:
> >> >>> if (names.containsKey(element.getElementName())
> >> >>>
> >> >>> names is defined as:
> >> >>> Map<QName, QName> names = new HashMap<QName, QName>();
> >> >>> just a few lines earlier. Thus, it cannot be null.
> >> >>>
> >> >>> element is from a List<WrapperElement>, but I checked the method
> >> >>> that generates that List and all the adds are of the form:
> >> >>> list.add(new WrapperElement(.....));
> >> >>> (creating it as part of the add line)
> >> >>> thus, there isn't a way for add(null) to be called. :-(
> >> >>>
> >> >>> Anyway, I'd like to see the wsdl.
> >> >>> Dan
> >> >>>
> >> >>> On Monday 29 September 2008 4:47:27 am _Eric_ wrote:
> >> >>>> When I run the wsdl2java tool I get an NullPointerexception.
> >>
> >> E:\Eric\_Projects\TK\wsdl2java>C:\temp\apache-cxf-2.1.2\bin\wsdl2java
> >>
> >> >>>> -verbose QesService.wsdl
> >> >>>> Loading FrontEnd jaxws ...
> >> >>>> Loading DataBinding jaxb ...
> >> >>>> wsdl2java -verbose QesService.wsdl
> >> >>>> wsdl2java - Apache CXF 2.1.2
> >> >>>>
> >> >>>>
> >> >>>> WSDLToJava Error: java.lang.NullPointerException
> >> >>>>
> >> >>>> org.apache.cxf.tools.common.ToolException:
> >> >>>> java.lang.NullPointerException
> >> >>>> at
> >>
> >> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCont
> >>
> >> >>>>ainer .java:240) at
> >>
> >> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.jav
> >>
> >> >>>>a: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
> >>
> >> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameC
> >>
> >> >>>>ollis
> >>
> >> ionValidator.isValidOperation(WrapperStyleNameCollisionValidator.java:
> >> >>>>120) at
> >>
> >> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameC
> >>
> >> >>>>ollis
> >>
> >> ionValidator.checkNameColllision(WrapperStyleNameCollisionValidator.ja
> >>
> >> >>>>va:58) at
> >>
> >> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameC
> >>
> >> >>>>ollis
> >>
> >> ionValidator.isValid(WrapperStyleNameCollisionValidator.java:51)
> >>
> >> >>>> at
> >>
> >> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.validate(WSDLToJavaCon
> >>
> >> >>>>taine r.java:547) at
> >>
> >> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCont
> >>
> >> >>>>ainer .java:193) at
> >>
> >> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCont
> >>
> >> >>>>ainer .java:232) ... 3 more
> >> >>>>
> >> >>>>
> >> >>>> Google brought me some posting that sugest it is a mixture of
> >>
> >> problem
> >>
> >> >>>> in
> >> >>>> CXF and in the wsdl. How can I find a workaround for the problem?
> >> >>>>
> >> >>>> Grettings
> >> >>>> Eric
> >> >>>
> >> >>> --
> >> >>> Daniel Kulp
> >> >>> dkulp@apache.org
> >> >>> http://www.dankulp.com/blog
> >> >>
> >> >> --
> >> >> View this message in context:
> >> >> http://www.nabble.com/wsdl2java-NullPointer-tp19720254p20090683.html
> >> >> Sent from the cxf-user mailing list archive at Nabble.com.
> >
> > --
> > Daniel Kulp
> > dkulp@apache.org
> > http://dankulp.com/blog
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Re: wsdl2java NullPointer
Posted by _Eric_ <er...@web.de>.
Sorry for answering late, I got some priority confusion. Howerver, I tried
version 2.1.3 and so I will provide the WSDL and XSDs in a very simplified
form.
http://www.nabble.com/file/p20268101/service.wsdl service.wsdl
http://www.nabble.com/file/p20268101/transport.xsd transport.xsd
dkulp wrote:
>
>
> 1) Any chance you can try with 2.1.3 (released yesterday)?
>
> 2) If not, can you send the wsdl/schemas? We can then run it in the
> debugger
> to figure out what is going on.
>
> Dan
>
>
> On Tuesday 21 October 2008 10:35:27 am _Eric_ wrote:
>> good hint, but does'nt help anything :-(
>>
>> Andrew Clegg wrote:
>> > My first thought is, how can you have a 'choice' between two elements
>> > with the same name and type?
>> >
>> > Does it still cause the error if you change the name and/or type of one
>> > of them?
>> >
>> > Andrew.
>> >
>> > 2008/10/21 _Eric_ <E....@d-trust.net>:
>> >> Sorry for answering so late, other important things could'nt wait in
>> the
>> >> cue.
>> >>
>> >> howerver, it seems to be a problem of JAXB.
>> >> <xs:complexType name="ExecuteType">
>> >> <xs:sequence>
>> >> <xs:element name="Payload" >
>> >> <xs:complexType>
>> >> <xs:choice>
>> >> <xs:element
>> >> name="test" type="xs:string" />
>> >> <xs:element
>> >> name="test" type="xs:string" />
>> >> </xs:choice>
>> >> </xs:complexType>
>> >> </xs:element>
>> >> </xs:sequence>
>> >> </xs:complexType>
>> >>
>> >> If I replace the complex type of Payload to a simple type like string.
>> >> It works well. Are there any sugestions how to solve this problem?
>> >>
>> >> dkulp wrote:
>> >>> I think I'll need to see the wsdl. Looking at the code, I cannot
>> see
>> >>> how
>> >>> a
>> >>> NPE could occur there. The line in question is:
>> >>> if (names.containsKey(element.getElementName())
>> >>>
>> >>> names is defined as:
>> >>> Map<QName, QName> names = new HashMap<QName, QName>();
>> >>> just a few lines earlier. Thus, it cannot be null.
>> >>>
>> >>> element is from a List<WrapperElement>, but I checked the method that
>> >>> generates that List and all the adds are of the form:
>> >>> list.add(new WrapperElement(.....));
>> >>> (creating it as part of the add line)
>> >>> thus, there isn't a way for add(null) to be called. :-(
>> >>>
>> >>> Anyway, I'd like to see the wsdl.
>> >>> Dan
>> >>>
>> >>> On Monday 29 September 2008 4:47:27 am _Eric_ wrote:
>> >>>> When I run the wsdl2java tool I get an NullPointerexception.
>> >>>>
>> >>>>
>> E:\Eric\_Projects\TK\wsdl2java>C:\temp\apache-cxf-2.1.2\bin\wsdl2java
>> >>>> -verbose QesService.wsdl
>> >>>> Loading FrontEnd jaxws ...
>> >>>> Loading DataBinding jaxb ...
>> >>>> wsdl2java -verbose QesService.wsdl
>> >>>> wsdl2java - Apache CXF 2.1.2
>> >>>>
>> >>>>
>> >>>> WSDLToJava Error: java.lang.NullPointerException
>> >>>>
>> >>>> org.apache.cxf.tools.common.ToolException:
>> >>>> java.lang.NullPointerException
>> >>>> at
>> >>>>
>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCont
>> >>>>ainer .java:240) at
>> >>>>
>> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.jav
>> >>>>a: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
>> >>>>
>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameC
>> >>>>ollis
>> >>>>
>> ionValidator.isValidOperation(WrapperStyleNameCollisionValidator.java:
>> >>>>120) at
>> >>>>
>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameC
>> >>>>ollis
>> >>>>
>> ionValidator.checkNameColllision(WrapperStyleNameCollisionValidator.ja
>> >>>>va:58) at
>> >>>>
>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameC
>> >>>>ollis
>> ionValidator.isValid(WrapperStyleNameCollisionValidator.java:51)
>> >>>> at
>> >>>>
>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.validate(WSDLToJavaCon
>> >>>>taine r.java:547) at
>> >>>>
>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCont
>> >>>>ainer .java:193) at
>> >>>>
>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCont
>> >>>>ainer .java:232) ... 3 more
>> >>>>
>> >>>>
>> >>>> Google brought me some posting that sugest it is a mixture of
>> problem
>> >>>> in
>> >>>> CXF and in the wsdl. How can I find a workaround for the problem?
>> >>>>
>> >>>> Grettings
>> >>>> Eric
>> >>>
>> >>> --
>> >>> Daniel Kulp
>> >>> dkulp@apache.org
>> >>> http://www.dankulp.com/blog
>> >>
>> >> --
>> >> View this message in context:
>> >> http://www.nabble.com/wsdl2java-NullPointer-tp19720254p20090683.html
>> >> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>
>
--
View this message in context: http://www.nabble.com/wsdl2java-NullPointer-tp19720254p20268101.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: wsdl2java NullPointer
Posted by Daniel Kulp <dk...@apache.org>.
1) Any chance you can try with 2.1.3 (released yesterday)?
2) If not, can you send the wsdl/schemas? We can then run it in the debugger
to figure out what is going on.
Dan
On Tuesday 21 October 2008 10:35:27 am _Eric_ wrote:
> good hint, but does'nt help anything :-(
>
> Andrew Clegg wrote:
> > My first thought is, how can you have a 'choice' between two elements
> > with the same name and type?
> >
> > Does it still cause the error if you change the name and/or type of one
> > of them?
> >
> > Andrew.
> >
> > 2008/10/21 _Eric_ <E....@d-trust.net>:
> >> Sorry for answering so late, other important things could'nt wait in the
> >> cue.
> >>
> >> howerver, it seems to be a problem of JAXB.
> >> <xs:complexType name="ExecuteType">
> >> <xs:sequence>
> >> <xs:element name="Payload" >
> >> <xs:complexType>
> >> <xs:choice>
> >> <xs:element
> >> name="test" type="xs:string" />
> >> <xs:element
> >> name="test" type="xs:string" />
> >> </xs:choice>
> >> </xs:complexType>
> >> </xs:element>
> >> </xs:sequence>
> >> </xs:complexType>
> >>
> >> If I replace the complex type of Payload to a simple type like string.
> >> It works well. Are there any sugestions how to solve this problem?
> >>
> >> dkulp wrote:
> >>> I think I'll need to see the wsdl. Looking at the code, I cannot see
> >>> how
> >>> a
> >>> NPE could occur there. The line in question is:
> >>> if (names.containsKey(element.getElementName())
> >>>
> >>> names is defined as:
> >>> Map<QName, QName> names = new HashMap<QName, QName>();
> >>> just a few lines earlier. Thus, it cannot be null.
> >>>
> >>> element is from a List<WrapperElement>, but I checked the method that
> >>> generates that List and all the adds are of the form:
> >>> list.add(new WrapperElement(.....));
> >>> (creating it as part of the add line)
> >>> thus, there isn't a way for add(null) to be called. :-(
> >>>
> >>> Anyway, I'd like to see the wsdl.
> >>> Dan
> >>>
> >>> On Monday 29 September 2008 4:47:27 am _Eric_ wrote:
> >>>> When I run the wsdl2java tool I get an NullPointerexception.
> >>>>
> >>>> E:\Eric\_Projects\TK\wsdl2java>C:\temp\apache-cxf-2.1.2\bin\wsdl2java
> >>>> -verbose QesService.wsdl
> >>>> Loading FrontEnd jaxws ...
> >>>> Loading DataBinding jaxb ...
> >>>> wsdl2java -verbose QesService.wsdl
> >>>> wsdl2java - Apache CXF 2.1.2
> >>>>
> >>>>
> >>>> WSDLToJava Error: java.lang.NullPointerException
> >>>>
> >>>> org.apache.cxf.tools.common.ToolException:
> >>>> java.lang.NullPointerException
> >>>> at
> >>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCont
> >>>>ainer .java:240) at
> >>>> org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.jav
> >>>>a: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
> >>>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameC
> >>>>ollis
> >>>> ionValidator.isValidOperation(WrapperStyleNameCollisionValidator.java:
> >>>>120) at
> >>>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameC
> >>>>ollis
> >>>> ionValidator.checkNameColllision(WrapperStyleNameCollisionValidator.ja
> >>>>va:58) at
> >>>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameC
> >>>>ollis ionValidator.isValid(WrapperStyleNameCollisionValidator.java:51)
> >>>> at
> >>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.validate(WSDLToJavaCon
> >>>>taine r.java:547) at
> >>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCont
> >>>>ainer .java:193) at
> >>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaCont
> >>>>ainer .java:232) ... 3 more
> >>>>
> >>>>
> >>>> Google brought me some posting that sugest it is a mixture of problem
> >>>> in
> >>>> CXF and in the wsdl. How can I find a workaround for the problem?
> >>>>
> >>>> Grettings
> >>>> Eric
> >>>
> >>> --
> >>> Daniel Kulp
> >>> dkulp@apache.org
> >>> http://www.dankulp.com/blog
> >>
> >> --
> >> View this message in context:
> >> http://www.nabble.com/wsdl2java-NullPointer-tp19720254p20090683.html
> >> Sent from the cxf-user mailing list archive at Nabble.com.
--
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog
Re: wsdl2java NullPointer
Posted by _Eric_ <E....@d-trust.net>.
good hint, but does'nt help anything :-(
Andrew Clegg wrote:
>
> My first thought is, how can you have a 'choice' between two elements
> with the same name and type?
>
> Does it still cause the error if you change the name and/or type of one of
> them?
>
> Andrew.
>
> 2008/10/21 _Eric_ <E....@d-trust.net>:
>>
>> Sorry for answering so late, other important things could'nt wait in the
>> cue.
>>
>> howerver, it seems to be a problem of JAXB.
>> <xs:complexType name="ExecuteType">
>> <xs:sequence>
>> <xs:element name="Payload" >
>> <xs:complexType>
>> <xs:choice>
>> <xs:element
>> name="test" type="xs:string" />
>> <xs:element
>> name="test" type="xs:string" />
>> </xs:choice>
>> </xs:complexType>
>> </xs:element>
>> </xs:sequence>
>> </xs:complexType>
>>
>> If I replace the complex type of Payload to a simple type like string. It
>> works well. Are there any sugestions how to solve this problem?
>>
>>
>> dkulp wrote:
>>>
>>>
>>> I think I'll need to see the wsdl. Looking at the code, I cannot see
>>> how
>>> a
>>> NPE could occur there. The line in question is:
>>> if (names.containsKey(element.getElementName())
>>>
>>> names is defined as:
>>> Map<QName, QName> names = new HashMap<QName, QName>();
>>> just a few lines earlier. Thus, it cannot be null.
>>>
>>> element is from a List<WrapperElement>, but I checked the method that
>>> generates that List and all the adds are of the form:
>>> list.add(new WrapperElement(.....));
>>> (creating it as part of the add line)
>>> thus, there isn't a way for add(null) to be called. :-(
>>>
>>> Anyway, I'd like to see the wsdl.
>>> Dan
>>>
>>>
>>> On Monday 29 September 2008 4:47:27 am _Eric_ wrote:
>>>> When I run the wsdl2java tool I get an NullPointerexception.
>>>>
>>>> E:\Eric\_Projects\TK\wsdl2java>C:\temp\apache-cxf-2.1.2\bin\wsdl2java
>>>> -verbose QesService.wsdl
>>>> Loading FrontEnd jaxws ...
>>>> Loading DataBinding jaxb ...
>>>> wsdl2java -verbose QesService.wsdl
>>>> wsdl2java - Apache CXF 2.1.2
>>>>
>>>>
>>>> WSDLToJava Error: java.lang.NullPointerException
>>>>
>>>> org.apache.cxf.tools.common.ToolException:
>>>> java.lang.NullPointerException
>>>> at
>>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>>>.java:240) 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
>>>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameCollis
>>>>ionValidator.isValidOperation(WrapperStyleNameCollisionValidator.java:120)
>>>> at
>>>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameCollis
>>>>ionValidator.checkNameColllision(WrapperStyleNameCollisionValidator.java:58)
>>>> at
>>>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameCollis
>>>>ionValidator.isValid(WrapperStyleNameCollisionValidator.java:51) at
>>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.validate(WSDLToJavaContaine
>>>>r.java:547) at
>>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>>>.java:193) at
>>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>>>.java:232) ... 3 more
>>>>
>>>>
>>>> Google brought me some posting that sugest it is a mixture of problem
>>>> in
>>>> CXF and in the wsdl. How can I find a workaround for the problem?
>>>>
>>>> Grettings
>>>> Eric
>>>
>>>
>>>
>>> --
>>> Daniel Kulp
>>> dkulp@apache.org
>>> http://www.dankulp.com/blog
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/wsdl2java-NullPointer-tp19720254p20090683.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
>
>
--
View this message in context: http://www.nabble.com/wsdl2java-NullPointer-tp19720254p20091626.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: wsdl2java NullPointer
Posted by Andrew Clegg <an...@gmail.com>.
My first thought is, how can you have a 'choice' between two elements
with the same name and type?
Does it still cause the error if you change the name and/or type of one of them?
Andrew.
2008/10/21 _Eric_ <E....@d-trust.net>:
>
> Sorry for answering so late, other important things could'nt wait in the cue.
>
> howerver, it seems to be a problem of JAXB.
> <xs:complexType name="ExecuteType">
> <xs:sequence>
> <xs:element name="Payload" >
> <xs:complexType>
> <xs:choice>
> <xs:element name="test" type="xs:string" />
> <xs:element name="test" type="xs:string" />
> </xs:choice>
> </xs:complexType>
> </xs:element>
> </xs:sequence>
> </xs:complexType>
>
> If I replace the complex type of Payload to a simple type like string. It
> works well. Are there any sugestions how to solve this problem?
>
>
> dkulp wrote:
>>
>>
>> I think I'll need to see the wsdl. Looking at the code, I cannot see how
>> a
>> NPE could occur there. The line in question is:
>> if (names.containsKey(element.getElementName())
>>
>> names is defined as:
>> Map<QName, QName> names = new HashMap<QName, QName>();
>> just a few lines earlier. Thus, it cannot be null.
>>
>> element is from a List<WrapperElement>, but I checked the method that
>> generates that List and all the adds are of the form:
>> list.add(new WrapperElement(.....));
>> (creating it as part of the add line)
>> thus, there isn't a way for add(null) to be called. :-(
>>
>> Anyway, I'd like to see the wsdl.
>> Dan
>>
>>
>> On Monday 29 September 2008 4:47:27 am _Eric_ wrote:
>>> When I run the wsdl2java tool I get an NullPointerexception.
>>>
>>> E:\Eric\_Projects\TK\wsdl2java>C:\temp\apache-cxf-2.1.2\bin\wsdl2java
>>> -verbose QesService.wsdl
>>> Loading FrontEnd jaxws ...
>>> Loading DataBinding jaxb ...
>>> wsdl2java -verbose QesService.wsdl
>>> wsdl2java - Apache CXF 2.1.2
>>>
>>>
>>> WSDLToJava Error: java.lang.NullPointerException
>>>
>>> org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
>>> at
>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>>.java:240) 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
>>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameCollis
>>>ionValidator.isValidOperation(WrapperStyleNameCollisionValidator.java:120)
>>> at
>>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameCollis
>>>ionValidator.checkNameColllision(WrapperStyleNameCollisionValidator.java:58)
>>> at
>>> org.apache.cxf.tools.wsdlto.frontend.jaxws.validator.WrapperStyleNameCollis
>>>ionValidator.isValid(WrapperStyleNameCollisionValidator.java:51) at
>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.validate(WSDLToJavaContaine
>>>r.java:547) at
>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>>.java:193) at
>>> org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer
>>>.java:232) ... 3 more
>>>
>>>
>>> Google brought me some posting that sugest it is a mixture of problem in
>>> CXF and in the wsdl. How can I find a workaround for the problem?
>>>
>>> Grettings
>>> Eric
>>
>>
>>
>> --
>> Daniel Kulp
>> dkulp@apache.org
>> http://www.dankulp.com/blog
>>
>>
>
> --
> View this message in context: http://www.nabble.com/wsdl2java-NullPointer-tp19720254p20090683.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>