You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by ja...@external.t-mobile.at on 2008/05/19 20:30:54 UTC

wsdl2java NPE for complex types with no fields under some circum stances [Virus checked]

Hello,

i have a situation which produces

Caused by: org.apache.maven.plugin.MojoExecutionException: 
java.lang.NullPointerException
        at 
org.apache.cxf.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:296)
        at 
org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java:202)
        at 
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:447)
        at 
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
        ... 16 more
Caused by: 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.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:292)
        ... 19 more
Caused by: java.lang.NullPointerException
        at 
org.apache.cxf.tools.wsdlto.databinding.jaxb.JAXBDataBinding.getWrappedElementType(JAXBDataBinding.java:365)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ParameterProcessor.getParameterFromQName(ParameterProcessor.java:428)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ParameterProcessor.processWrappedAbstractOutput(ParameterProcessor.java:394)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ParameterProcessor.processWrappedOutput(ParameterProcessor.java:285)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ParameterProcessor.buildParamModelsWithoutOrdering(ParameterProcessor.java:504)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ParameterProcessor.process(ParameterProcessor.java:81)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.OperationProcessor.processMethod(OperationProcessor.java:91)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.OperationProcessor.process(OperationProcessor.java:63)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.PortTypeProcessor.process(PortTypeProcessor.java:128)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.wsdlDefinitionToJavaModel(WSDLToJavaProcessor.java:88)
        at 
org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.process(WSDLToJavaProcessor.java:60)
        at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:197)
        at 
org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:232)
        ... 22 more


atm i'm trying to simplify situation to be able to send a simple sample 
wsdl + bindings

problem occurs only when i'm using XJC to generate episode file from 
common xsd and then using this file as input ... but it doesn't work only 
for one wsdl and works for 40 other wsdls.

problem is with output message 
        <wsdl:message name="manageServicesOutput">
                <wsdl:part name="parameters" 
element="tns:manageServicesOutput"/>
        </wsdl:message>
where
        <xsd:element name="manageServicesOutput" 
type="ei_messaging_datatypes:EIEmptyResponse"/>

and where these are from external xsd processed by XJC.
        <complexType name="EIEmpty">
                <sequence>
                        <!-- Note: EMPTY SEQUENCE ! --></sequence>
        </complexType>
        <complexType name="EIEmptyResponse">
                <sequence>
                        <element name="eiMessageContext" 
type="tns:EIMessageContext"/>
                        <element name="data" type="tns:EIEmpty"/>
                </sequence>
        </complexType>

hopefully i'll be able to make simple example soon

best regards
jano

Antwort: Re: wsdl2java NPE for complex types with no fields under some circum stances [Virus checked]

Posted by ja...@external.t-mobile.at.
Hello Dan,

i tried to send my test wsdl + bindings + pom, but it always returned as 
spam.

is it enough to skip the loop in this method in case of null? (I have to 
fix my local version now, to continue working)

Thank you!

best regards
jano




Daniel Kulp <dk...@apache.org> 
05/19/2008 21:07
Bitte antworten an
users@cxf.apache.org


An
users@cxf.apache.org
Kopie

Thema
Re: wsdl2java NPE for complex types with no fields under some circum 
stances  [Virus checked]







Looking at the code at that line number, we aren't checking if the 
dilldown is null.   I've added a null check to the code for that case 
which may fix the issue in the next snapshots.

Dan



On May 19, 2008, at 2:30 PM, jan.minaroviech@external.t-mobile.at wrote:

> Hello,
>
> i have a situation which produces
>
> Caused by: org.apache.maven.plugin.MojoExecutionException:
> java.lang.NullPointerException
>        at
> org 
> .apache 
> .cxf.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:296)
>        at
> org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java: 
> 202)
>        at
> org 
> .apache 
> .maven 
> .plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java: 
> 447)
>        at
> org 
> .apache 
> .maven 
> .lifecycle 
> .DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java: 
> 539)
>        ... 16 more
> Caused by: 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.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:292)
>        ... 19 more
> Caused by: java.lang.NullPointerException
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .databinding 
> .jaxb.JAXBDataBinding.getWrappedElementType(JAXBDataBinding.java:365)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal 
> .ParameterProcessor.getParameterFromQName(ParameterProcessor.java:428)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal 
> .ParameterProcessor 
> .processWrappedAbstractOutput(ParameterProcessor.java:394)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal 
> .ParameterProcessor.processWrappedOutput(ParameterProcessor.java:285)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal 
> .ParameterProcessor 
> .buildParamModelsWithoutOrdering(ParameterProcessor.java:504)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal.ParameterProcessor.process(ParameterProcessor.java:81)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal.OperationProcessor.processMethod(OperationProcessor.java:91)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal.OperationProcessor.process(OperationProcessor.java:63)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor.internal.PortTypeProcessor.process(PortTypeProcessor.java: 
> 128)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .WSDLToJavaProcessor 
> .wsdlDefinitionToJavaModel(WSDLToJavaProcessor.java:88)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor.WSDLToJavaProcessor.process(WSDLToJavaProcessor.java:60)
>        at
> org 
> .apache 
> .cxf 
> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 
> 197)
>        at
> org 
> .apache 
> .cxf 
> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 
> 232)
>        ... 22 more
>
>
> atm i'm trying to simplify situation to be able to send a simple 
> sample
> wsdl + bindings
>
> problem occurs only when i'm using XJC to generate episode file from
> common xsd and then using this file as input ... but it doesn't work 
> only
> for one wsdl and works for 40 other wsdls.
>
> problem is with output message
>        <wsdl:message name="manageServicesOutput">
>                <wsdl:part name="parameters"
> element="tns:manageServicesOutput"/>
>        </wsdl:message>
> where
>        <xsd:element name="manageServicesOutput"
> type="ei_messaging_datatypes:EIEmptyResponse"/>
>
> and where these are from external xsd processed by XJC.
>        <complexType name="EIEmpty">
>                <sequence>
>                        <!-- Note: EMPTY SEQUENCE ! --></sequence>
>        </complexType>
>        <complexType name="EIEmptyResponse">
>                <sequence>
>                        <element name="eiMessageContext"
> type="tns:EIMessageContext"/>
>                        <element name="data" type="tns:EIEmpty"/>
>                </sequence>
>        </complexType>
>
> hopefully i'll be able to make simple example soon
>
> best regards
> jano

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog








Re: wsdl2java NPE for complex types with no fields under some circum stances [Virus checked]

Posted by Daniel Kulp <dk...@apache.org>.
Looking at the code at that line number, we aren't checking if the  
dilldown is null.   I've added a null check to the code for that case  
which may fix the issue in the next snapshots.

Dan



On May 19, 2008, at 2:30 PM, jan.minaroviech@external.t-mobile.at wrote:

> Hello,
>
> i have a situation which produces
>
> Caused by: org.apache.maven.plugin.MojoExecutionException:
> java.lang.NullPointerException
>        at
> org 
> .apache 
> .cxf.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:296)
>        at
> org.apache.cxf.maven_plugin.WSDL2JavaMojo.execute(WSDL2JavaMojo.java: 
> 202)
>        at
> org 
> .apache 
> .maven 
> .plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java: 
> 447)
>        at
> org 
> .apache 
> .maven 
> .lifecycle 
> .DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java: 
> 539)
>        ... 16 more
> Caused by: 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.maven_plugin.WSDL2JavaMojo.processWsdl(WSDL2JavaMojo.java:292)
>        ... 19 more
> Caused by: java.lang.NullPointerException
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .databinding 
> .jaxb.JAXBDataBinding.getWrappedElementType(JAXBDataBinding.java:365)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal 
> .ParameterProcessor.getParameterFromQName(ParameterProcessor.java:428)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal 
> .ParameterProcessor 
> .processWrappedAbstractOutput(ParameterProcessor.java:394)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal 
> .ParameterProcessor.processWrappedOutput(ParameterProcessor.java:285)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal 
> .ParameterProcessor 
> .buildParamModelsWithoutOrdering(ParameterProcessor.java:504)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal.ParameterProcessor.process(ParameterProcessor.java:81)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal.OperationProcessor.processMethod(OperationProcessor.java:91)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .internal.OperationProcessor.process(OperationProcessor.java:63)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor.internal.PortTypeProcessor.process(PortTypeProcessor.java: 
> 128)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor 
> .WSDLToJavaProcessor 
> .wsdlDefinitionToJavaModel(WSDLToJavaProcessor.java:88)
>        at
> org 
> .apache 
> .cxf 
> .tools 
> .wsdlto 
> .frontend 
> .jaxws 
> .processor.WSDLToJavaProcessor.process(WSDLToJavaProcessor.java:60)
>        at
> org 
> .apache 
> .cxf 
> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 
> 197)
>        at
> org 
> .apache 
> .cxf 
> .tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java: 
> 232)
>        ... 22 more
>
>
> atm i'm trying to simplify situation to be able to send a simple  
> sample
> wsdl + bindings
>
> problem occurs only when i'm using XJC to generate episode file from
> common xsd and then using this file as input ... but it doesn't work  
> only
> for one wsdl and works for 40 other wsdls.
>
> problem is with output message
>        <wsdl:message name="manageServicesOutput">
>                <wsdl:part name="parameters"
> element="tns:manageServicesOutput"/>
>        </wsdl:message>
> where
>        <xsd:element name="manageServicesOutput"
> type="ei_messaging_datatypes:EIEmptyResponse"/>
>
> and where these are from external xsd processed by XJC.
>        <complexType name="EIEmpty">
>                <sequence>
>                        <!-- Note: EMPTY SEQUENCE ! --></sequence>
>        </complexType>
>        <complexType name="EIEmptyResponse">
>                <sequence>
>                        <element name="eiMessageContext"
> type="tns:EIMessageContext"/>
>                        <element name="data" type="tns:EIEmpty"/>
>                </sequence>
>        </complexType>
>
> hopefully i'll be able to make simple example soon
>
> best regards
> jano

---
Daniel Kulp
dkulp@apache.org
http://www.dankulp.com/blog