Hi all,
I'm trying to publish a WS-RM service on WebLogic 10.3.1. I am using the
JAX-WS frontend and CXFServlet. When I enable WS-RM, I get a
NullPointerException (see stack trace at end of message) regarding the
WS-Policy. I define the policy in the WSDL and enabling the policies
features in my Spring bean configuration:
WSDL snippet:
<service name='AsyncMessagingService'>
<wsp:PolicyReference URI="#RM"
xmlns:wsp="http://www.w3.org/2006/07/ws-policy" />
...
<wsp:Policy wsu:Id="RM" xmlns:wsp="http://www.w3.org/2006/07/ws-policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wswa:UsingAddressing
xmlns:wswa="http://www.w3.org/2005/02/addressing/wsdl" />
<wsrmp:RMAssertion
xmlns:wsrmp="http://schemas.xmlsoap.org/ws/2005/02/rm/policy">
<wsrmp:BaseRetransmissionInterval
Milliseconds="10000" />
<wsrmp:DeliveryAssurance>
<wsp:Policy>
<wsrmp:ExactlyOnce />
<wsrmp:InOrder />
</wsp:Policy>
</wsrmp:DeliveryAssurance>
</wsrmp:RMAssertion>
</wsp:Policy>
Bean configuration for CXFServlet:
<jaxws:endpoint id='AsyncMessaging'
address='/AsyncMessagingService'
implementor='svc.impl.messaging.AsyncMessagingServiceImpl'>
<jaxws:features>
<p:policies />
</jaxws:features>
</jaxws:endpoint>
The error that occurs is logged as follows:
INFO: Creating Service {http://messaging.cmr/}AsyncMessagingService from
WSDL: WEB-INF/wsdl/AsyncMessaging-WrappedHeader-SOAP11-WSRM10.wsdl
19 Οκτ 2009 4:35:48 μμ org.apache.cxf.endpoint.ServerImpl initDestination
INFO: Setting the server's publish address to be /AsyncMessagingService
19 Οκτ 2009 4:35:48 μμ
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
destroySingletons
INFO: Destroying singletons in
org.springframework.beans.factory.support.defaultlistablebeanfact...@210faa:
defining beans
[cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.servlet.ServletTransportFactory,AsyncMessaging];
root of factory hierarchy
19 Οκτ 2009 4:35:48 μμ org.springframework.web.context.ContextLoader
initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'AsyncMessaging': Invocation of init method failed;
nested exception is javax.xml.ws.WebServiceException:
java.lang.NullPointerException
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
...
Caused by: javax.xml.ws.WebServiceException: java.lang.NullPointerException
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:275)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1413)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1374)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
... 52 more
Caused by: java.lang.NullPointerException
at
org.apache.cxf.ws.policy.WSPolicyFeature.initialize(WSPolicyFeature.java:100)
at
org.apache.cxf.ws.policy.WSPolicyFeature.initializeEndpointPolicy(WSPolicyFeature.java:139)
at
org.apache.cxf.ws.policy.WSPolicyFeature.initialize(WSPolicyFeature.java:122)
at
org.apache.cxf.frontend.ServerFactoryBean.applyFeatures(ServerFactoryBean.java:198)
at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:150)
at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:167)
at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346)
at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259)
... 61 more