cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Freeman Fang (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CXF-4452) NullPointerException when trying to customize the package name for a service definition without customizing the class name.
Date Thu, 09 Aug 2012 06:32:19 GMT

     [ https://issues.apache.org/jira/browse/CXF-4452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Freeman Fang resolved CXF-4452.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 2.7.0
                   2.6.2
                   2.5.5
                   2.4.9

commit fix 
http://svn.apache.org/viewvc?rev=1370687&view=rev for trunk
http://svn.apache.org/viewvc?rev=1370704&view=rev for 2.6.x branch
http://svn.apache.org/viewvc?rev=1371023&view=rev for 2.5.x branch
http://svn.apache.org/viewvc?rev=1371025&view=rev for 2.4.x branch

@Sandy,
Thanks for pointing out this issue!
                
> NullPointerException when trying to customize the package name for a service definition
without customizing the class name.
> ---------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-4452
>                 URL: https://issues.apache.org/jira/browse/CXF-4452
>             Project: CXF
>          Issue Type: Bug
>          Components: Tooling
>    Affects Versions: 2.6.1
>         Environment: JDK v1.7
> Maven v3.0.4
> cxf-codegen-plugin v2.6.1
>            Reporter: Sandy Perez
>            Assignee: Freeman Fang
>            Priority: Minor
>             Fix For: 2.4.9, 2.5.5, 2.6.2, 2.7.0
>
>
> Hello
> When I try to use jax-ws customization to customize the package name without customizing
the class name, for example using the following XML code 
> <bindings wsdlLocation="myService.wsdl" xmlns="http://java.sun.com/xml/ns/jaxws" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
> 	<bindings node="wsdl:definitions/wsdl:service[@name='MyService_V1']">
> 		<package name="com.acme.myservice.v1.wsdl"/>
> 	</bindings>
> </bindings>
> I get the following exception:
> [WARNING] WSDLToJava Error: java.lang.NullPointerException
> [WARNING] 
> [WARNING] org.apache.cxf.tools.common.ToolException: java.lang.NullPointerException
> [WARNING] 	at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:294)
> [WARNING] 	at org.apache.cxf.tools.common.toolspec.ToolRunner.runTool(ToolRunner.java:103)
> [WARNING] 	at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:113)
> [WARNING] 	at org.apache.cxf.tools.wsdlto.WSDLToJava.run(WSDLToJava.java:86)
> [WARNING] 	at org.apache.cxf.tools.wsdlto.WSDLToJava.main(WSDLToJava.java:184)
> [WARNING] Caused by: java.lang.NullPointerException
> [WARNING] 	at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.processService(ServiceProcessor.java:207)
> [WARNING] 	at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor.process(ServiceProcessor.java:100)
> [WARNING] 	at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.wsdlDefinitionToJavaModel(WSDLToJavaProcessor.java:91)
> [WARNING] 	at org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.WSDLToJavaProcessor.process(WSDLToJavaProcessor.java:60)
> [WARNING] 	at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.processWsdl(WSDLToJavaContainer.java:253)
> [WARNING] 	at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:139)
> [WARNING] 	at org.apache.cxf.tools.wsdlto.WSDLToJavaContainer.execute(WSDLToJavaContainer.java:286)
> [WARNING] 	... 4 more
> The problem is in the class named ‘org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.
ServiceProcessor’ in line 207:
> if (serviceBinding2.getJaxwsClass().getComments() != null) {
> 	…
> }
> If you don’t customize the class name, serviceBinding2.getJaxwsClass() will returns
null so calling getComments() results in a NullPointerException .
> A possible quick solution could be to change the condition as follows:
> if (serviceBinding2.getJaxwsClass() != null && serviceBinding2.getJaxwsClass().getComments()
!= null) {
> 	…
> }
> On the other hand, a possible workaround is to customize the class name. For example,
the following XML code will work fine.
> <bindings wsdlLocation="myService.wsdl" xmlns="http://java.sun.com/xml/ns/jaxws" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
> 	<bindings node="wsdl:definitions/wsdl:service[@name='MyService_V1']">
> 		<package name="com.acme.myservice.v1.wsdl"/>
> 		<class name="MyServiceV1" />
> 	</bindings>
> </bindings>
> Best regards,
>  ----
> Sandy Pérez González
> Indaba Consultores S.L.
> http://www.indaba.es/

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message