You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Barlotta, Michael [USA]" <ba...@bah.com> on 2007/12/19 23:18:34 UTC

CXF @WebServiceProvider deployment issue

Hello, I am using CXF 2.0.3 and am deploying an appliation to JBoss
using Spring and packaged as a WAR.
 
On JBoss startup I get the following error:BeanCreationException: Error
creating bean with name 'MessageRouter': Invocation of init method
failed; nested exception is java.lang.NullPointerException
 
Any idea what is causing this?
 
Thanks!
Mike
 
//------------- Java Code Annotations
 
@WebServiceProvider(
serviceName="MessageRouterService",
portName="RoutePortType",
targetNamespace="http://xxxxx/",
wsdlLocation="WEB-INF/wsdl/MessageRouter.wsdl"
)
@ServiceMode(Service.Mode.PAYLOAD)
public class MessageRouterEndpoint implements Provider<Source>{
 
 
public Source invoke(Source payload) {
    ...
}
}
 
//------------- Spring config
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:soap="http://cxf.apache.org/bindings/soap"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd 
http://cxf.apache.org/bindings/soap
http://cxf.apache.org/schemas/configuration/soap.xsd">
 
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
 
<jaxws:endpoint 
id="MessageRouter" 
implementor="#MessageRouterService" 
address="/fxml/route" />
...
 
//------------- Stack Trace 
 
2007-12-19 17:08:16,591 55859 ERROR [STDERR] (main:) Dec 19, 2007
5:08:16 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
INFO: Creating Service {http://xxxxx/}MessageRouterService from WSDL:
WEB-INF/wsdl/MessageRouter.wsdl
2007-12-19 17:08:16,778 56046 ERROR
[org.springframework.web.context.ContextLoader] (main:) Context
initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'MessageRouter': Invocation of init method failed; nested
exception is java.lang.NullPointerException
Caused by: 
java.lang.NullPointerException
 at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilde
r.java:226)
 at
org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilde
r.java:150)
 at
org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:
117)
 at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildService
FromWSDL(ReflectionServiceFactoryBean.java:257)
 at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeSe
rviceModel(ReflectionServiceFactoryBean.java:331)
 at
org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Refle
ctionServiceFactoryBean.java:151)
 at
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsService
FactoryBean.java:93)
 at
org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(
AbstractWSDLBasedEndpointFactory.java:74)
 at
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:
108)
 at
org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBea
n.java:147)
 at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:288)
 at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:228)
 at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179)
 at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:341)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:585)
 at ...
 

RE: CXF @WebServiceProvider deployment issue (WORKING)

Posted by "Barlotta, Michael [USA]" <ba...@bah.com>.
Dan:

Thanks for the tip! I downloaded the Eclipse WSDL validator (since I just got exceptions with the one in bin that were not so helpful). I did find an error in the port type, I did not have the namespace prefixes on the WSDL. 

Merry Christmas!!

Mike Barlotta
Associate
Booz | Allen | Hamilton

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Thursday, December 20, 2007 2:19 PM
To: cxf-user@incubator.apache.org
Cc: Barlotta, Michael [USA]
Subject: Re: CXF @WebServiceProvider deployment issue


All I can think of to try is to run the validator (in our bin directory) 
on the wsdl and see if it has any issues with it.   Maybe the binding 
node doesn't point to the correct portType or something.    I don't 
really know without looking more at the wsdl.

Dan


On Thursday 20 December 2007, Barlotta, Michael [USA] wrote:
> Thanks Dan, I re-read the docs and you are right. Unfortunately that 
> did not fix the problem.
>
> I checked the code and the line that generates the NPE is 226 of
> WSDLServiceBuilder: 223 PortType bindingPt = binding.getPortType();
>             226 PortType pt = def.getPortType(bindingPt.getQName());
>
> Turns out the bindingPt is null, any ideas or tips you can give as to 
> why this is the case?
>
> Mike Barlotta
> Associate
> Booz | Allen | Hamilton
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Thursday, December 20, 2007 11:45 AM
> To: cxf-user@incubator.apache.org
> Cc: Barlotta, Michael [USA]
> Subject: Re: CXF @WebServiceProvider deployment issue
>
>
> I believe portName should map to the name of the port in the service.
> Not the portType name.
>
> Dan
>
> On Thursday 20 December 2007, Barlotta, Michael [USA] wrote:
> > > @WebServiceProvider(
> > > serviceName="MessageRouterService",   <------------ mapped to
> >
> > wsdl:service name
> >
> > > portName="RoutePortType",                     <------------ mapped 
> > > to
> >
> > wsdl:portType name
> >
> > > targetNamespace="http://xxxxx/",              <------------ mapped 
> > > to
> >
> > wsdl:definitions targetNamespace
> >
> > > wsdlLocation="WEB-INF/wsdl/MessageRouter.wsdl"
>
> --
> J. Daniel Kulp
> Principal Engineer, IONA
> dkulp@apache.org
> http://www.dankulp.com/blog



--
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: CXF @WebServiceProvider deployment issue

Posted by Daniel Kulp <dk...@apache.org>.
All I can think of to try is to run the validator (in our bin directory) 
on the wsdl and see if it has any issues with it.   Maybe the binding 
node doesn't point to the correct portType or something.    I don't 
really know without looking more at the wsdl.

Dan


On Thursday 20 December 2007, Barlotta, Michael [USA] wrote:
> Thanks Dan, I re-read the docs and you are right. Unfortunately that
> did not fix the problem.
>
> I checked the code and the line that generates the NPE is 226 of
> WSDLServiceBuilder: 223 PortType bindingPt = binding.getPortType();
>             226 PortType pt = def.getPortType(bindingPt.getQName());
>
> Turns out the bindingPt is null, any ideas or tips you can give as to
> why this is the case?
>
> Mike Barlotta
> Associate
> Booz | Allen | Hamilton
>
> -----Original Message-----
> From: Daniel Kulp [mailto:dkulp@apache.org]
> Sent: Thursday, December 20, 2007 11:45 AM
> To: cxf-user@incubator.apache.org
> Cc: Barlotta, Michael [USA]
> Subject: Re: CXF @WebServiceProvider deployment issue
>
>
> I believe portName should map to the name of the port in the service.
> Not the portType name.
>
> Dan
>
> On Thursday 20 December 2007, Barlotta, Michael [USA] wrote:
> > > @WebServiceProvider(
> > > serviceName="MessageRouterService",   <------------ mapped to
> >
> > wsdl:service name
> >
> > > portName="RoutePortType",                     <------------ mapped
> > > to
> >
> > wsdl:portType name
> >
> > > targetNamespace="http://xxxxx/",              <------------ mapped
> > > to
> >
> > wsdl:definitions targetNamespace
> >
> > > wsdlLocation="WEB-INF/wsdl/MessageRouter.wsdl"
>
> --
> J. Daniel Kulp
> Principal Engineer, IONA
> dkulp@apache.org
> http://www.dankulp.com/blog



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

RE: CXF @WebServiceProvider deployment issue

Posted by "Barlotta, Michael [USA]" <ba...@bah.com>.
Thanks Dan, I re-read the docs and you are right. Unfortunately that did not fix the problem.

I checked the code and the line that generates the NPE is 226 of WSDLServiceBuilder:
		223 PortType bindingPt = binding.getPortType();
            226 PortType pt = def.getPortType(bindingPt.getQName()); 

Turns out the bindingPt is null, any ideas or tips you can give as to why this is the case?

Mike Barlotta
Associate
Booz | Allen | Hamilton

-----Original Message-----
From: Daniel Kulp [mailto:dkulp@apache.org] 
Sent: Thursday, December 20, 2007 11:45 AM
To: cxf-user@incubator.apache.org
Cc: Barlotta, Michael [USA]
Subject: Re: CXF @WebServiceProvider deployment issue


I believe portName should map to the name of the port in the service.   
Not the portType name.

Dan


On Thursday 20 December 2007, Barlotta, Michael [USA] wrote:
> > @WebServiceProvider(
> > serviceName="MessageRouterService",   <------------ mapped to
>
> wsdl:service name
>
> > portName="RoutePortType",                     <------------ mapped 
> > to
>
> wsdl:portType name
>
> > targetNamespace="http://xxxxx/",              <------------ mapped 
> > to
>
> wsdl:definitions targetNamespace
>
> > wsdlLocation="WEB-INF/wsdl/MessageRouter.wsdl"



--
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: CXF @WebServiceProvider deployment issue

Posted by Daniel Kulp <dk...@apache.org>.
I believe portName should map to the name of the port in the service.   
Not the portType name.

Dan


On Thursday 20 December 2007, Barlotta, Michael [USA] wrote:
> > @WebServiceProvider(
> > serviceName="MessageRouterService",   <------------ mapped to
>
> wsdl:service name
>
> > portName="RoutePortType",                     <------------ mapped
> > to
>
> wsdl:portType name
>
> > targetNamespace="http://xxxxx/",              <------------ mapped
> > to
>
> wsdl:definitions targetNamespace
>
> > wsdlLocation="WEB-INF/wsdl/MessageRouter.wsdl"



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

RE: CXF @WebServiceProvider deployment issue

Posted by "Barlotta, Michael [USA]" <ba...@bah.com>.
Adding portions of the WSDL in case it helps:

	<wsdl:definitions name="MessageRouter" 
		targetNamespace="http://xxxxx/" 		
		xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"

		xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"

		xmlns:xsd="http://www.w3c.org/2001/XMLSchema">
	...
	<wsdl:portType name="RoutePortType">
		<wsdl:operation name="RouteMessage">
			<wsdl:input message="RouteRequest" />
			<wsdl:output message="RouteResponse" />
		</wsdl:operation>
	</wsdl:portType>
	...
	<wsdl:service name="MessageRouterService">
		<wsdl:port binding="MessageRouterServiceSoapBinding"
name="MessageRouterServicePort">
			<soap:address
location="http://xxxx/fxml/route"/>
		</wsdl:port>
	</wsdl:service>

> @WebServiceProvider(
> serviceName="MessageRouterService", 	<------------ mapped to
wsdl:service name
> portName="RoutePortType",			<------------ mapped to
wsdl:portType name
> targetNamespace="http://xxxxx/",		<------------ mapped to
wsdl:definitions targetNamespace
> wsdlLocation="WEB-INF/wsdl/MessageRouter.wsdl"

Thanks,

Mike Barlotta
Associate
Booz | Allen | Hamilton

-----Original Message-----
From: Barlotta, Michael [USA] [mailto:barlotta_michael@bah.com] 
Sent: Thursday, December 20, 2007 9:02 AM
To: cxf-user@incubator.apache.org
Subject: RE: CXF @WebServiceProvider deployment issue

Nino: thanks, but unfortunately no... I have the required default
constructor (by virute of not having any constructor).

I found this posting, and added the cxf:bus configuration but I still
get the same error (see config below).

http://www.nabble.com/java.lang.NullPointerException-to14201919.html

I have been able to deploy @WebService based endpoints without
configuring the bus so not sure what I am missing. I was hoping to get
the XML passed straight through so that I could use my Castor mapping &
Java POJOs that have already been created/tested. 

What am I missing?
Thanks,

> //------------- Spring config
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxws="http://cxf.apache.org/jaxws"
> xmlns:soap="http://cxf.apache.org/bindings/soap"
  xmlns:cxf="http://cxf.apache.org/core"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
> http://cxf.apache.org/bindings/soap
> http://cxf.apache.org/schemas/configuration/soap.xsd
  http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
>  
> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import 
> resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import 
> resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>  
    <cxf:bus>
    </cxf:bus> 

> <jaxws:endpoint
> id="MessageRouter" 
> implementor="#MessageRouterService" 
> address="/fxml/route" />


Mike Barlotta
Associate
Booz | Allen | Hamilton

-----Original Message-----
From: Nino Saturnino Martinez Vazquez Wael
[mailto:nino.martinez@jayway.dk]
Sent: Thursday, December 20, 2007 4:22 AM
To: cxf-user@incubator.apache.org
Subject: Re: CXF @WebServiceProvider deployment issue

My best guess are that its a spring error that tells you that it could
not call the default constructor of the class backing the MessageRouter.

In your case its the messagerouterservice..

Do this seem to give any hints?

regards

Barlotta, Michael [USA] wrote:
> Hello, I am using CXF 2.0.3 and am deploying an appliation to JBoss 
> using Spring and packaged as a WAR.
>  
> On JBoss startup I get the following error:BeanCreationException: 
> Error creating bean with name 'MessageRouter': Invocation of init 
> method failed; nested exception is java.lang.NullPointerException
>  
> Any idea what is causing this?
>  
> Thanks!
> Mike
>  
> //------------- Java Code Annotations
>  
> @WebServiceProvider(
> serviceName="MessageRouterService",
> portName="RoutePortType",
> targetNamespace="http://xxxxx/",
> wsdlLocation="WEB-INF/wsdl/MessageRouter.wsdl"
> )
> @ServiceMode(Service.Mode.PAYLOAD)
> public class MessageRouterEndpoint implements Provider<Source>{
>  
>  
> public Source invoke(Source payload) {
>     ...
> }
> }
>  
> //------------- Spring config
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxws="http://cxf.apache.org/jaxws"
> xmlns:soap="http://cxf.apache.org/bindings/soap"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
> http://cxf.apache.org/bindings/soap
> http://cxf.apache.org/schemas/configuration/soap.xsd">
>  
> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import 
> resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import 
> resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>  
> <jaxws:endpoint
> id="MessageRouter" 
> implementor="#MessageRouterService" 
> address="/fxml/route" />
> ...
>  
> //------------- Stack Trace
>  
> 2007-12-19 17:08:16,591 55859 ERROR [STDERR] (main:) Dec 19, 2007
> 5:08:16 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromWSDL
> INFO: Creating Service {http://xxxxx/}MessageRouterService from WSDL:
> WEB-INF/wsdl/MessageRouter.wsdl
> 2007-12-19 17:08:16,778 56046 ERROR
> [org.springframework.web.context.ContextLoader] (main:) Context 
> initialization failed
> org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'MessageRouter': Invocation of init method 
> failed; nested exception is java.lang.NullPointerException Caused by:
> java.lang.NullPointerException
>  at
> org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuil
> de
> r.java:226)
>  at
> org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuil
> de
> r.java:150)
>  at
>
org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:
> 117)
>  at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServi
> ce
> FromWSDL(ReflectionServiceFactoryBean.java:257)
>  at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initialize
> Se
> rviceModel(ReflectionServiceFactoryBean.java:331)
>  at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Ref
> le
> ctionServiceFactoryBean.java:151)
>  at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServi
> ce
> FactoryBean.java:93)
>  at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoin
> t(
> AbstractWSDLBasedEndpointFactory.java:74)
>  at
>
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:
> 108)
>  at
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryB
> ea
> n.java:147)
>  at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:288)
>  at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:228)
>  at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179)
>  at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:341)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> av
> a:39)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> or
> Impl.java:25)
>  at java.lang.reflect.Method.invoke(Method.java:585)
>  at ...
>  
>
>   

--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684

RE: CXF @WebServiceProvider deployment issue

Posted by "Barlotta, Michael [USA]" <ba...@bah.com>.
Nino: thanks, but unfortunately no... I have the required default
constructor (by virute of not having any constructor).

I found this posting, and added the cxf:bus configuration but I still
get the same error (see config below).

http://www.nabble.com/java.lang.NullPointerException-to14201919.html

I have been able to deploy @WebService based endpoints without
configuring the bus so not sure what I am missing. I was hoping to get
the XML passed straight through so that I could use my Castor mapping &
Java POJOs that have already been created/tested. 

What am I missing?
Thanks,

> //------------- Spring config
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxws="http://cxf.apache.org/jaxws"
> xmlns:soap="http://cxf.apache.org/bindings/soap"
  xmlns:cxf="http://cxf.apache.org/core"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
> http://cxf.apache.org/bindings/soap
> http://cxf.apache.org/schemas/configuration/soap.xsd
  http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
>  
> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import 
> resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import 
> resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>  
    <cxf:bus>
    </cxf:bus> 

> <jaxws:endpoint
> id="MessageRouter" 
> implementor="#MessageRouterService" 
> address="/fxml/route" />


Mike Barlotta
Associate
Booz | Allen | Hamilton

-----Original Message-----
From: Nino Saturnino Martinez Vazquez Wael
[mailto:nino.martinez@jayway.dk] 
Sent: Thursday, December 20, 2007 4:22 AM
To: cxf-user@incubator.apache.org
Subject: Re: CXF @WebServiceProvider deployment issue

My best guess are that its a spring error that tells you that it could
not call the default constructor of the class backing the MessageRouter.

In your case its the messagerouterservice..

Do this seem to give any hints?

regards

Barlotta, Michael [USA] wrote:
> Hello, I am using CXF 2.0.3 and am deploying an appliation to JBoss 
> using Spring and packaged as a WAR.
>  
> On JBoss startup I get the following error:BeanCreationException: 
> Error creating bean with name 'MessageRouter': Invocation of init 
> method failed; nested exception is java.lang.NullPointerException
>  
> Any idea what is causing this?
>  
> Thanks!
> Mike
>  
> //------------- Java Code Annotations
>  
> @WebServiceProvider(
> serviceName="MessageRouterService",
> portName="RoutePortType",
> targetNamespace="http://xxxxx/",
> wsdlLocation="WEB-INF/wsdl/MessageRouter.wsdl"
> )
> @ServiceMode(Service.Mode.PAYLOAD)
> public class MessageRouterEndpoint implements Provider<Source>{
>  
>  
> public Source invoke(Source payload) {
>     ...
> }
> }
>  
> //------------- Spring config
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxws="http://cxf.apache.org/jaxws"
> xmlns:soap="http://cxf.apache.org/bindings/soap"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
> http://cxf.apache.org/bindings/soap
> http://cxf.apache.org/schemas/configuration/soap.xsd">
>  
> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import 
> resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import 
> resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>  
> <jaxws:endpoint
> id="MessageRouter" 
> implementor="#MessageRouterService" 
> address="/fxml/route" />
> ...
>  
> //------------- Stack Trace
>  
> 2007-12-19 17:08:16,591 55859 ERROR [STDERR] (main:) Dec 19, 2007
> 5:08:16 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromWSDL
> INFO: Creating Service {http://xxxxx/}MessageRouterService from WSDL:
> WEB-INF/wsdl/MessageRouter.wsdl
> 2007-12-19 17:08:16,778 56046 ERROR
> [org.springframework.web.context.ContextLoader] (main:) Context 
> initialization failed
> org.springframework.beans.factory.BeanCreationException: Error 
> creating bean with name 'MessageRouter': Invocation of init method 
> failed; nested exception is java.lang.NullPointerException Caused by:
> java.lang.NullPointerException
>  at
> org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuil
> de
> r.java:226)
>  at
> org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuil
> de
> r.java:150)
>  at
>
org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:
> 117)
>  at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServi
> ce
> FromWSDL(ReflectionServiceFactoryBean.java:257)
>  at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initialize
> Se
> rviceModel(ReflectionServiceFactoryBean.java:331)
>  at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Ref
> le
> ctionServiceFactoryBean.java:151)
>  at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServi
> ce
> FactoryBean.java:93)
>  at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoin
> t(
> AbstractWSDLBasedEndpointFactory.java:74)
>  at
>
org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:
> 108)
>  at
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryB
> ea
> n.java:147)
>  at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:288)
>  at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:228)
>  at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179)
>  at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:341)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> av
> a:39)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> or
> Impl.java:25)
>  at java.lang.reflect.Method.invoke(Method.java:585)
>  at ...
>  
>
>   

--
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684

Re: CXF @WebServiceProvider deployment issue

Posted by Nino Saturnino Martinez Vazquez Wael <ni...@jayway.dk>.
My best guess are that its a spring error that tells you that it could 
not call the default constructor of the class backing the MessageRouter. 
In your case its the messagerouterservice..

Do this seem to give any hints?

regards

Barlotta, Michael [USA] wrote:
> Hello, I am using CXF 2.0.3 and am deploying an appliation to JBoss
> using Spring and packaged as a WAR.
>  
> On JBoss startup I get the following error:BeanCreationException: Error
> creating bean with name 'MessageRouter': Invocation of init method
> failed; nested exception is java.lang.NullPointerException
>  
> Any idea what is causing this?
>  
> Thanks!
> Mike
>  
> //------------- Java Code Annotations
>  
> @WebServiceProvider(
> serviceName="MessageRouterService",
> portName="RoutePortType",
> targetNamespace="http://xxxxx/",
> wsdlLocation="WEB-INF/wsdl/MessageRouter.wsdl"
> )
> @ServiceMode(Service.Mode.PAYLOAD)
> public class MessageRouterEndpoint implements Provider<Source>{
>  
>  
> public Source invoke(Source payload) {
>     ...
> }
> }
>  
> //------------- Spring config
> <beans xmlns="http://www.springframework.org/schema/beans"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:jaxws="http://cxf.apache.org/jaxws"
> xmlns:soap="http://cxf.apache.org/bindings/soap"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd 
> http://cxf.apache.org/bindings/soap
> http://cxf.apache.org/schemas/configuration/soap.xsd">
>  
> <import resource="classpath:META-INF/cxf/cxf.xml" />
> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
>  
> <jaxws:endpoint 
> id="MessageRouter" 
> implementor="#MessageRouterService" 
> address="/fxml/route" />
> ...
>  
> //------------- Stack Trace 
>  
> 2007-12-19 17:08:16,591 55859 ERROR [STDERR] (main:) Dec 19, 2007
> 5:08:16 PM org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> buildServiceFromWSDL
> INFO: Creating Service {http://xxxxx/}MessageRouterService from WSDL:
> WEB-INF/wsdl/MessageRouter.wsdl
> 2007-12-19 17:08:16,778 56046 ERROR
> [org.springframework.web.context.ContextLoader] (main:) Context
> initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'MessageRouter': Invocation of init method failed; nested
> exception is java.lang.NullPointerException
> Caused by: 
> java.lang.NullPointerException
>  at
> org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilde
> r.java:226)
>  at
> org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilde
> r.java:150)
>  at
> org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:
> 117)
>  at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildService
> FromWSDL(ReflectionServiceFactoryBean.java:257)
>  at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeSe
> rviceModel(ReflectionServiceFactoryBean.java:331)
>  at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Refle
> ctionServiceFactoryBean.java:151)
>  at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsService
> FactoryBean.java:93)
>  at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(
> AbstractWSDLBasedEndpointFactory.java:74)
>  at
> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:
> 108)
>  at
> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBea
> n.java:147)
>  at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:288)
>  at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:228)
>  at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:179)
>  at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:341)
>  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>  at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
>  at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
>  at java.lang.reflect.Method.invoke(Method.java:585)
>  at ...
>  
>
>   

-- 
Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684