You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2012/10/03 18:10:08 UTC
[jira] [Resolved] (CXF-4526) PolicyAnnotationListener throws NPE in
jar
[ https://issues.apache.org/jira/browse/CXF-4526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Kulp resolved CXF-4526.
------------------------------
Resolution: Fixed
Fix Version/s: 2.6.3
2.5.6
Assignee: Daniel Kulp
I put a guard around this into the code which should prevent the NPE. However, I'm not sure they result is 100% correct as without a base URI, I'm not sure if it will have other issues. Any chance you can test?
> PolicyAnnotationListener throws NPE in jar
> ------------------------------------------
>
> Key: CXF-4526
> URL: https://issues.apache.org/jira/browse/CXF-4526
> Project: CXF
> Issue Type: Bug
> Components: WS-* Components
> Affects Versions: 2.6.2
> Reporter: Emil Bergner
> Assignee: Daniel Kulp
> Priority: Minor
> Labels: bug, jar, maven, policy
> Fix For: 2.5.6, 2.6.3
>
>
> I've attached a security policy to my service using:
> @Policy(uri = "classpath:some-security-policy.xml", placement = Policy.Placement.DEFAULT)
> Everything works fine inside Eclipse. But an NPE is thrown in PolicyAnnotationListener on line 348 when I run the executable jar that I build with maven-shade-plugin:
> Exception in thread "main" javax.xml.ws.WebServiceException: java.lang.NullPointerException
> at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:357)
> at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:246)
> at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:525)
> at com.reverb.ison.ws.InteliSonServer.publish(InteliSonServer.java:21)
> at com.reverb.ison.ws.InteliSonServer.main(InteliSonServer.java:15)
> Caused by: java.lang.NullPointerException
> at org.apache.cxf.ws.policy.PolicyAnnotationListener.addPolicy(PolicyAnnotationListener.java:348)
> at org.apache.cxf.ws.policy.PolicyAnnotationListener.addPolicy(PolicyAnnotationListener.java:328)
> at org.apache.cxf.ws.policy.PolicyAnnotationListener.addPolicies(PolicyAnnotationListener.java:249)
> at org.apache.cxf.ws.policy.PolicyAnnotationListener.addPolicies(PolicyAnnotationListener.java:165)
> at org.apache.cxf.ws.policy.PolicyAnnotationListener.handleEvent(PolicyAnnotationListener.java:77)
> at org.apache.cxf.service.factory.AbstractServiceFactoryBean.sendEvent(AbstractServiceFactoryBean.java:72)
> at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:200)
> at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159)
> at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
> at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:442)
> at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:329)
> ... 4 more
> Looks like the issue is:
> cls.getResource("/").toString()
> which will return null when the class is inside a jar.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira