You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Aenima <ae...@yahoo.it> on 2012/11/06 11:26:48 UTC

ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Hi all,
I'm tryng to develop a web service using CXF. This is the first time for me,
so I used this tutorial 
http://angelozerr.wordpress.com/2011/08/24/jaxwscxf_step2/
<http://angelozerr.wordpress.com/2011/08/24/jaxwscxf_step2/>  , but when I
try to start the server I got this error 
*java.lang.ClassNotFoundException:
org.apache.cxf.transport.servlet.CXFServlet* but I already have this class
in my libraries.
I post my web.xml in case it can be of any use..:

Thanks in advance



--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Aenima <ae...@yahoo.it>.
I finally managed to develop my web service with eclipse, I had to create a
new instance of tomcat server and to create a new dynamic project, may be
there were some files that generated the error.
Anyway thank you very much for your help,
Marina.



--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5718125.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Glen Mazza <gm...@talend.com>.
Have you tried with the downloadable source code provided with that 
sample?  mvn clean install tomcat:redeploy (providing you've configured 
your Tomcat and Maven as given in that tutorial) should bring up that 
WSDL with no difficulty.

Glen

On 11/06/2012 10:22 AM, Aenima wrote:
> I tried with 3.0.7 RELEASE and it doesn't work either.
> So i tried using maven and following the glen mazza guide at
> http://www.jroller.com/gmazza/entry/web_service_tutorial
> <http://www.jroller.com/gmazza/entry/web_service_tutorial>  .
> I succesfully builded and deployed the war file but when i try to go to
> http://localhost:8080/doubleit/services/doubleit?wsdl
> <http://localhost:8080/doubleit/services/doubleit?wsdl>   for a check I got
> the following error:
>
>
> It seems that it can't find the DoubleItPortTypeImpl class, but I have
> created it into the service\src\main\java directory (as stated in the
> guide), and I can't find any clue about the cause of this error.
> Thank you,
> Marina
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5718007.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 
Glen Mazza
Talend Community Coders - coders.talend.com
blog: www.jroller.com/gmazza


Re: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Aenima <ae...@yahoo.it>.
I tried with 3.0.7 RELEASE and it doesn't work either.
So i tried using maven and following the glen mazza guide at 
http://www.jroller.com/gmazza/entry/web_service_tutorial
<http://www.jroller.com/gmazza/entry/web_service_tutorial>  .
I succesfully builded and deployed the war file but when i try to go to 
http://localhost:8080/doubleit/services/doubleit?wsdl
<http://localhost:8080/doubleit/services/doubleit?wsdl>   for a check I got
the following error:


It seems that it can't find the DoubleItPortTypeImpl class, but I have
created it into the service\src\main\java directory (as stated in the
guide), and I can't find any clue about the cause of this error.
Thank you,
Marina



--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5718007.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Daniel Kulp <dk...@apache.org>.
On Nov 6, 2012, at 6:18 AM, Aenima <ae...@yahoo.it> wrote:

> In the war file the jars available are :
> spring-1.2.6.jar

That is likely the reason.   Spring 1.x is ANCIENT and no longer supported by pretty much anything.   You likely need to move up to 3.0.7.RELEASE.

Dan



> cxf-rt-transports-http-2.7.0.jar
> commons-logging-1.1.1.jar
> 
> added manually by me
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5717973.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


RE: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Aenima <ae...@yahoo.it>.
In the war file the jars available are :
spring-1.2.6.jar
cxf-rt-transports-http-2.7.0.jar
commons-logging-1.1.1.jar

added manually by me



--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5717973.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Mark Streit <mc...@gmail.com>.
The examples that Glen Mazza has on his blog site are excellent and they
just work right out of the box. Even if you're not a Maven user, after
working with a few of these...you likely will be.

http://www.jroller.com/gmazza/entry/blog_article_index

Mark
 On Nov 6, 2012 6:38 AM, "Aenima" <ae...@yahoo.it> wrote:

> Because I've never used Maven before and I'm not sure how to use it in
> order
> to get my web service, I've seen a guide here
> http://cxf.apache.org/docs/using-cxf-with-maven.html
> <http://cxf.apache.org/docs/using-cxf-with-maven.html>  , I will try it.
>
>
>
>
> --
> View this message in context:
> http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5717976.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>

RE: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Aenima <ae...@yahoo.it>.
Because I've never used Maven before and I'm not sure how to use it in order
to get my web service, I've seen a guide here 
http://cxf.apache.org/docs/using-cxf-with-maven.html
<http://cxf.apache.org/docs/using-cxf-with-maven.html>  , I will try it.




--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5717976.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Andrei Shakirin <as...@talend.com>.
I guess you have empty or invalid beans.xml file. Take a look in examples delivered with CXF or in Glen Mazza blogs.
Three jars in your war file is still not enough.
Do you have special reason not to use maven? It makes dependency management drastically easy.

Cheers,
Andrei.

-----Original Message-----
From: Aenima [mailto:aenema_rm@yahoo.it] 
Sent: Dienstag, 6. November 2012 12:13
To: users@cxf.apache.org
Subject: RE: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Thank you for your fast answer,
I have exported the war file, and the cxf-rt-transports-http-XXX.jar was missing, so I added it from my Apache CXF jars in my WEB-INF/lib directory. 
Now there's a new error message when I start the server. It is :
*GRAVE: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 4 in XML document from ServletContext resource [/WEB-INF/beans.xml] is invalid; nested exception is org.xml.sax.SAXParseException: Document root element "beans", must match DOCTYPE root "null". org.xml.sax.SAXParseException:
Document root element "beans", must match DOCTYPE root "null".* My beans.xml file is:




--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5717971.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Aenima <ae...@yahoo.it>.
Thank you for your fast answer,
I have exported the war file, and the cxf-rt-transports-http-XXX.jar was
missing, so I added it from my Apache CXF jars in my WEB-INF/lib directory. 
Now there's a new error message when I start the server. It is :
*GRAVE: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Line 4 in
XML document from ServletContext resource [/WEB-INF/beans.xml] is invalid;
nested exception is org.xml.sax.SAXParseException: Document root element
"beans", must match DOCTYPE root "null". org.xml.sax.SAXParseException:
Document root element "beans", must match DOCTYPE root "null".*
My beans.xml file is:




--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5717971.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Andrei Shakirin <as...@talend.com>.
It seems that cxf-rt-transports-http-XXX.jar (and probably other libraries) was not deployed to the server configured in Eclipse.
Can you just export war from your eclipse web service project and check which jars are inside?

Cheers,
Andrei.

-----Original Message-----
From: Aenima [mailto:aenema_rm@yahoo.it] 
Sent: Dienstag, 6. November 2012 11:39
To: users@cxf.apache.org
Subject: Re: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

I forgot to mention that I'm not using Maven.



--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5717966.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Aenima <ae...@yahoo.it>.
I forgot to mention that I'm not using Maven.



--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5717966.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: ClassNotFound exception org.apache.cxf.transport.servlet.CXFServlet

Posted by Adeson <10...@qq.com>.
Hello, I also met this problem, don't know how to solve now, I want to write
a rest interface with CXF, do you have experience in this field? Or do you
have some code can refer to? Please send me good yao



--
View this message in context: http://cxf.547215.n5.nabble.com/ClassNotFound-exception-org-apache-cxf-transport-servlet-CXFServlet-tp5717965p5730155.html
Sent from the cxf-user mailing list archive at Nabble.com.