You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by jackdawson <ab...@gmail.com> on 2008/10/02 18:54:38 UTC

Importing CXF client from Eclipse STP into WTP: java.lang.NullPointerException

Hello all,

I have a problem here integrating CXF client with a web app.

Here is what I did:
1. I created a client from a WSDL using CXF 2.1.2 in Eclipse STP.
2. I then imported this client into Eclipse WTP making it as a dependent of
another web app.
3. When I deployed both on the server and ran it, it threw few errors and I
had to add few external JARs to the web app's \WEB-INF\lib folder
(jaxb-api-1.5, jaxb-xjc-2.1.7, jaxws-api-2.0, jaxws-rt-2.0EA3,
stax-api-1.0.1)
4. Now when I run it after giving it what it wanted this is what I get:

null
java.lang.NullPointerException
	at
com.sun.xml.ws.client.ServiceContextBuilder.processAnnotations(ServiceContextBuilder.java:164)
	at
com.sun.xml.ws.client.ServiceContextBuilder.build(ServiceContextBuilder.java:82)
	at
com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:117)
	at
com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:50)
	at javax.xml.ws.Service.<init>(Service.java:57)
	at
us.two.safe.login.LoginService_Service.<init>(LoginService_Service.java:48)
	at
us.two.safe.login.LoginService_LoginService_Client.testLogin(LoginService_LoginService_Client.java:71)
	at
org.apache.jsp.html.logonrequest_jsp._jspService(logonrequest_jsp.java:104)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(J

Does anyone know what exactly happened?
Is it because I imported a project that was created in STP to WTP? I know I
could use CXF WTP version now but I'm curious to know the solution for this.
But when I run the client as a stand alone java app it works. So, this makes
me to think something is tricky somewhere.

Thanks.

Importing CXF client from Eclipse STP into WTP
-- 
View this message in context: http://www.nabble.com/Importing-CXF-client-from-Eclipse-STP-into-WTP%3A-java.lang.NullPointerException-tp19783305p19783305.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Importing CXF client from Eclipse STP into WTP: java.lang.NullPointerException

Posted by Daniel Kulp <dk...@apache.org>.
You would need the versions of all of those jars from the CXF 
installations lib directory.

Dan


On Friday 03 October 2008, jackdawson wrote:
> Thanks.
>
> If I create a client in Eclipse STP with CXF 2.1.2 and then import
> this client into Eclipse WTP which doesn't have FUSE installed in it
> what exactly would happen?
>
> 		When I run this client in STP it doesn't ask for any JARs in the
> parent project to which I added this client as a dependent but in
> Eclipse WTP without FUSE it kept asking me to provide all the JARs I
> mentioned prevously.
>
> 		I have checked the configurations in both the scenarios and they
> look alike.
>
> 		Thanks.
>
> dkulp wrote:
> > The stack trace is from down inside the Sun reference
> > implementation, not CXF.   That has to do with the jars you are
> > picking up:
> >
> > jaxb-api-1.5, jaxb-xjc-2.1.7,
> > Probably should be jaxb-api 2.1, not 1.5.  Also need the correct
> > jaxb-impl jar.
> >
> >
> > jaxws-api-2.0,
> > CXF 2.1.x would require a 2.1 version of the jaxws-api jar
> >
> >
> > jaxws-rt-2.0EA3,
> > That's the sun RI jar.   That really shouldn't be needed.
> >
> > Dan
> >
> > On Thursday 02 October 2008, jackdawson wrote:
> >> Hello all,
> >>
> >> I have a problem here integrating CXF client with a web app.
> >>
> >> Here is what I did:
> >> 1. I created a client from a WSDL using CXF 2.1.2 in Eclipse STP.
> >> 2. I then imported this client into Eclipse WTP making it as a
> >> dependent of another web app.
> >> 3. When I deployed both on the server and ran it, it threw few
> >> errors and I had to add few external JARs to the web app's
> >> \WEB-INF\lib folder (jaxb-api-1.5, jaxb-xjc-2.1.7, jaxws-api-2.0,
> >> jaxws-rt-2.0EA3, stax-api-1.0.1)
> >> 4. Now when I run it after giving it what it wanted this is what I
> >> get:
> >>
> >> null
> >> java.lang.NullPointerException
> >> 	at
> >> com.sun.xml.ws.client.ServiceContextBuilder.processAnnotations(Serv
> >>ice ContextBuilder.java:164) at
> >> com.sun.xml.ws.client.ServiceContextBuilder.build(ServiceContextBui
> >>lde r.java:82) at
> >> com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.ja
> >>va: 117) at
> >> com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.
> >>jav a:50) at javax.xml.ws.Service.<init>(Service.java:57)
> >> 	at
> >> us.two.safe.login.LoginService_Service.<init>(LoginService_Service.
> >>jav a:48) at
> >> us.two.safe.login.LoginService_LoginService_Client.testLogin(LoginS
> >>erv ice_LoginService_Client.java:71) at
> >> org.apache.jsp.html.logonrequest_jsp._jspService(logonrequest_jsp.j
> >>ava
> >>
> >>:104) at
> >>
> >> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at
> >> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapp
> >>er. java:374) at
> >> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java
> >>:33 7) at
> >> org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> >> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at
> >> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Ap
> >>pli cationFilterChain.java:290) at
> >> org.apache.catalina.core.ApplicationFilterChain.doFilter(Applicatio
> >>nFi lterChain.java:206) at
> >> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrappe
> >>rVa lve.java:233) at
> >> org.apache.catalina.core.StandardContextValve.invoke(StandardContex
> >>tVa lve.java:175) at
> >> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve
> >>.ja va:128) at
> >> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve
> >>.ja va:102) at
> >> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineV
> >>alv e.java:109) at
> >> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.j
> >>ava
> >>
> >>:286) at
> >>
> >> org.apache.coyote.http11.Http11Processor.process(Http11Processor.ja
> >>va: 844) at
> >> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.pro
> >>ces s(Http11Protocol.java:583) at
> >> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(J
> >>
> >> Does anyone know what exactly happened?
> >> Is it because I imported a project that was created in STP to WTP?
> >> I know I could use CXF WTP version now but I'm curious to know the
> >> solution for this. But when I run the client as a stand alone java
> >> app it works. So, this makes me to think something is tricky
> >> somewhere.
> >>
> >> Thanks.
> >>
> >> Importing CXF client from Eclipse STP into WTP
> >
> > --
> > J. Daniel Kulp
> > dkulp@apache.org
> > http://www.dankulp.com/blog



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

Re: Importing CXF client from Eclipse STP into WTP: java.lang.NullPointerException

Posted by Oisin Hurley <oi...@gmail.com>.
> If I create a client in Eclipse STP with CXF 2.1.2 and then import this
> client into Eclipse WTP which doesn't have FUSE installed in it what exactly
> would happen?

Jack, this blog entry may help, it gives more details on using CXF with WTP.

http://oisinh.wordpress.com/2008/09/26/developing-web-services-with-eclipse-and-cxf/

 --oh

Re: Importing CXF client from Eclipse STP into WTP: java.lang.NullPointerException

Posted by jackdawson <ab...@gmail.com>.
Thanks.

If I create a client in Eclipse STP with CXF 2.1.2 and then import this
client into Eclipse WTP which doesn't have FUSE installed in it what exactly
would happen?
		
		When I run this client in STP it doesn't ask for any JARs in the parent
project to which I added this client as a dependent but in Eclipse WTP
without FUSE it kept asking me to provide all the JARs I mentioned
prevously.
		
		I have checked the configurations in both the scenarios and they look
alike.
		
		Thanks.



dkulp wrote:
> 
> 
> The stack trace is from down inside the Sun reference implementation, not 
> CXF.   That has to do with the jars you are picking up:
> 
> jaxb-api-1.5, jaxb-xjc-2.1.7,
> Probably should be jaxb-api 2.1, not 1.5.  Also need the correct 
> jaxb-impl jar.
> 
> 
> jaxws-api-2.0,
> CXF 2.1.x would require a 2.1 version of the jaxws-api jar
> 
> 
> jaxws-rt-2.0EA3,
> That's the sun RI jar.   That really shouldn't be needed.
> 
> Dan
> 
> 
> 
> 
> On Thursday 02 October 2008, jackdawson wrote:
>> Hello all,
>>
>> I have a problem here integrating CXF client with a web app.
>>
>> Here is what I did:
>> 1. I created a client from a WSDL using CXF 2.1.2 in Eclipse STP.
>> 2. I then imported this client into Eclipse WTP making it as a
>> dependent of another web app.
>> 3. When I deployed both on the server and ran it, it threw few errors
>> and I had to add few external JARs to the web app's \WEB-INF\lib
>> folder (jaxb-api-1.5, jaxb-xjc-2.1.7, jaxws-api-2.0, jaxws-rt-2.0EA3,
>> stax-api-1.0.1)
>> 4. Now when I run it after giving it what it wanted this is what I
>> get:
>>
>> null
>> java.lang.NullPointerException
>> 	at
>> com.sun.xml.ws.client.ServiceContextBuilder.processAnnotations(Service
>>ContextBuilder.java:164) at
>> com.sun.xml.ws.client.ServiceContextBuilder.build(ServiceContextBuilde
>>r.java:82) at
>> com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:
>>117) at
>> com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.jav
>>a:50) at javax.xml.ws.Service.<init>(Service.java:57)
>> 	at
>> us.two.safe.login.LoginService_Service.<init>(LoginService_Service.jav
>>a:48) at
>> us.two.safe.login.LoginService_LoginService_Client.testLogin(LoginServ
>>ice_LoginService_Client.java:71) at
>> org.apache.jsp.html.logonrequest_jsp._jspService(logonrequest_jsp.java
>>:104) at
>> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at
>> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
>>java:374) at
>> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:33
>>7) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
>>cationFilterChain.java:290) at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
>>lterChain.java:206) at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
>>lve.java:233) at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
>>lve.java:175) at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
>>va:128) at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
>>va:102) at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
>>e.java:109) at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
>>:286) at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
>>844) at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces
>>s(Http11Protocol.java:583) at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(J
>>
>> Does anyone know what exactly happened?
>> Is it because I imported a project that was created in STP to WTP? I
>> know I could use CXF WTP version now but I'm curious to know the
>> solution for this. But when I run the client as a stand alone java app
>> it works. So, this makes me to think something is tricky somewhere.
>>
>> Thanks.
>>
>> Importing CXF client from Eclipse STP into WTP
> 
> 
> 
> -- 
> J. Daniel Kulp
> dkulp@apache.org
> http://www.dankulp.com/blog
> 
> 

-- 
View this message in context: http://www.nabble.com/Importing-CXF-client-from-Eclipse-STP-into-WTP%3A-java.lang.NullPointerException-tp19783305p19805047.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Importing CXF client from Eclipse STP into WTP: java.lang.NullPointerException

Posted by Daniel Kulp <dk...@apache.org>.
The stack trace is from down inside the Sun reference implementation, not 
CXF.   That has to do with the jars you are picking up:

jaxb-api-1.5, jaxb-xjc-2.1.7,
Probably should be jaxb-api 2.1, not 1.5.  Also need the correct 
jaxb-impl jar.


jaxws-api-2.0,
CXF 2.1.x would require a 2.1 version of the jaxws-api jar


jaxws-rt-2.0EA3,
That's the sun RI jar.   That really shouldn't be needed.

Dan




On Thursday 02 October 2008, jackdawson wrote:
> Hello all,
>
> I have a problem here integrating CXF client with a web app.
>
> Here is what I did:
> 1. I created a client from a WSDL using CXF 2.1.2 in Eclipse STP.
> 2. I then imported this client into Eclipse WTP making it as a
> dependent of another web app.
> 3. When I deployed both on the server and ran it, it threw few errors
> and I had to add few external JARs to the web app's \WEB-INF\lib
> folder (jaxb-api-1.5, jaxb-xjc-2.1.7, jaxws-api-2.0, jaxws-rt-2.0EA3,
> stax-api-1.0.1)
> 4. Now when I run it after giving it what it wanted this is what I
> get:
>
> null
> java.lang.NullPointerException
> 	at
> com.sun.xml.ws.client.ServiceContextBuilder.processAnnotations(Service
>ContextBuilder.java:164) at
> com.sun.xml.ws.client.ServiceContextBuilder.build(ServiceContextBuilde
>r.java:82) at
> com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:
>117) at
> com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.jav
>a:50) at javax.xml.ws.Service.<init>(Service.java:57)
> 	at
> us.two.safe.login.LoginService_Service.<init>(LoginService_Service.jav
>a:48) at
> us.two.safe.login.LoginService_LoginService_Client.testLogin(LoginServ
>ice_LoginService_Client.java:71) at
> org.apache.jsp.html.logonrequest_jsp._jspService(logonrequest_jsp.java
>:104) at
> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.
>java:374) at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:33
>7) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appli
>cationFilterChain.java:290) at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFi
>lterChain.java:206) at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperVa
>lve.java:233) at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextVa
>lve.java:175) at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.ja
>va:128) at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.ja
>va:102) at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValv
>e.java:109) at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java
>:286) at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
>844) at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proces
>s(Http11Protocol.java:583) at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(J
>
> Does anyone know what exactly happened?
> Is it because I imported a project that was created in STP to WTP? I
> know I could use CXF WTP version now but I'm curious to know the
> solution for this. But when I run the client as a stand alone java app
> it works. So, this makes me to think something is tricky somewhere.
>
> Thanks.
>
> Importing CXF client from Eclipse STP into WTP



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