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 2008/02/26 23:00:53 UTC

[jira] Commented: (CXF-935) Provider not working when its WSDL is supplied from spring configuration.

    [ https://issues.apache.org/jira/browse/CXF-935?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12572684#action_12572684 ] 

Daniel Kulp commented on CXF-935:
---------------------------------

OK.   I've reproduced this on 2.1.   I'll debug into this tomorrow.

> Provider not working when its WSDL is supplied from spring configuration.
> -------------------------------------------------------------------------
>
>                 Key: CXF-935
>                 URL: https://issues.apache.org/jira/browse/CXF-935
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.0.3
>            Reporter: Jervis Liu
>            Assignee: Daniel Kulp
>             Fix For: 2.1
>
>
> http://www.nabble.com/Generic-Provider%3CDOMSource%3E-server-and-WSDL-metadata-tf4287661.html
> I am trying to build a generic server using Provider<DOMSource>. But I
> want to make the WSDL metadata, wsdlLocation, serviceName, portName,
> etc. to be user configurable, without having to re-compile the Provider
> with new WebServiceProvider annotations for every new WSDL. 
> I thought I'd be able to do this with an empty WebServiceProvider
> annotation for my Provider like below:
> <snip>
> @WebServiceProvider()
> @ServiceMode(value = Service.Mode.MESSAGE)
> public final class GenericMessageProvider implements Provider<DOMSource>
> {
> <snip>
> And the jaxws:endpoint element in a spring container cxf-beans.xml, like
> below:
> <snip>
> 	<jaxws:endpoint id="myEndpoint" implementor="#genericProvider"
> 		address="/myLocation/" serviceName="msp:MyService"
> 		wsdlLocation="classpath:wsdl/MyWSDL.wsdl"
> 		xmlns:msp="http://my.service">
> 	</jaxws:endpoint>
> <snip>
> But this throws an NPE when I load the cxf-beans.xml using Tomcat. 
> Aug 17, 2007 12:05:04 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
> INFO: Creating Service {http://my.service}MyService from WSDL: classpath:wsdl/MyWSDL.wsdl
> 2007-08-17 12:05:05,220 4696 [main] INFO  org.springframework.beans.factory.support.DefaultListableBeanFactory  - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@13c296b: defining beans [cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,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.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.servlet.ServletTransportFactory,wsdlConfiguration,wsdlResource,myEndpoint,genericProvider,schemaValidator,responseDBSource,scriptedKeyGenerator,bdbResponseFinder,defaultResponseSource,scriptedTransformer,bsfScriptFactory]; root of factory hierarchy
> 2007-08-17 12:05:05,260 4736 [main] ERROR org.springframework.web.context.ContextLoader  - Context initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'myEndpoint': Invocation of init method failed; nested exception is java.lang.NullPointerException
> Caused by: 
> java.lang.NullPointerException
> 	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperationsForProvider(JaxWsServiceFactoryBean.java:196)
> 	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.initializeWSDLOperations(JaxWsServiceFactoryBean.java:180)
> 	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:211)
> 	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:262)
> 	at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:143)
> 	at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:89)
> Analysis:
>  in ReflectionServiceFactoryBean.java line 956, method getEndpointInfo():
> public EndpointInfo getEndpointInfo() {
>         return getService().getEndpointInfo(getEndpointName());
> }
> the getService() returns the service model built from WSDL file, but somehow it does not contain an endpoint whose name is getEndpointName() which might come from java class. 
> [Bokde, Dhiraj] I debugged it a little, and the getEndpointName() method
> returns GenericProviderService instead of the serviceName in the
> endpoint. 
> I have tried adding the endpointName attribute as well and it didn't
> make any difference.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.