Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Web Tools incubator » On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet
On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #570879] Fri, 05 March 2010 19:42 Go to next message
Kurt  is currently offline Kurt Friend
Messages: 22
Registered: February 2010
Junior Member
Really unnerving!

I'm able to develop for a while without issue and suddenly (like after a machine reboot) my project starts throwing a ClassNotFoundException. Nothing I do short of starting the project from scratch fixes it.

I'm using: Galieo, JDK1.6.0, Tomcat 6.0.24, CXF-2.2.6 with the WTP

My JRE has a VM arg I read about somewhere as well:

-Xbootclasspath/p:C:\apache\cxf\apache-cxf-2.2.6\lib\jaxb-ap i-2.1.jar;C:\apache\cxf\apache-cxf-2.2.6\lib\jaxb-impl-2.1.1 2.jar;C:\apache\cxf\apache-cxf-2.2.6\lib\jaxb-xjc-2.1.12.jar

I tried deploying my application to the tomcat webapp directory and didn't have any luck there either (lots of class loader/boot class loader exceptions).

Can someone tell me how a CXF application classpath is built so I can troubleshoot this?
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575158 is a reply to message #570879] Fri, 05 March 2010 20:53 Go to previous messageGo to next message
Kurt  is currently offline Kurt Friend
Messages: 22
Registered: February 2010
Junior Member
I've done something horribly here. Just not sure what it is.

I have "Export runtime libraries to WEB-INF/lib at deployment time" checked. Which jars are supposed to be copied and to where? Is there a way to confirm this is happening?
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575172 is a reply to message #575158] Fri, 05 March 2010 22:26 Go to previous messageGo to next message
Kurt  is currently offline Kurt Friend
Messages: 22
Registered: February 2010
Junior Member
Working now in Tomcat (free-standing from a WAR) and in Galileo!

I needed to copy a number of jars to WEB-INF/lib. Here is the list that's working for me (note that I'm on cxf-2.2.6):

commons-collections-3.1.jar
commons-logging-1.1.1.jar
cxf-2.2.6.jar
geronimo-jaxws_2.1_spec-1.0.jar
jaxb-api-2.1.jar
neethi-2.0.4.jar
slf4j-api-1.5.8.jar
slf4j-jdk14-1.5.8.jar
spring-beans-2.5.6.jar
spring-context-2.5.6.jar
spring-core-2.5.6.jar
wsdl4j-1.6.2.jar
XmlSchema-1.4.5.jar

Here is my WebContent directory structure:

|-WEB-INF
|---classes
|---lib
|---web.xml
|---cxf-servlet.xml
|-wsdl
|---boardcallink.wsdl
|---boardcallink.xjb
|---boardcallink_schema1.xsd

To generate and use a war (for those to which it's not obvious):
cd <path to WebContent dir>
tar -cf MyWebService.war *

cp MyWebService.war $CATALINA_HOME/webapps
cd $CATALINA_HOME/bin
/startup.sh

Test from a browser:
http://localhost:8080/MyWebService/services
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575192 is a reply to message #575158] Sat, 06 March 2010 15:08 Go to previous messageGo to next message
Shane Clarke is currently offline Shane ClarkeFriend
Messages: 67
Registered: July 2009
Member
Hi Kurt,

I've tested this with Eclipse 3.5.1, JDK 1.6.0, Tomcat 6.0.24 and CXF 2.2.6 with the VM arg, deploying to tomcat and rebooting but have been unable to reproduce.

Kurt wrote on Fri, 05 March 2010 15:53
> Which jars are supposed to be copied and to where? Is there a way to confirm this is happening?


All the jars from the CXF lib directory should be resolved to the WEB-INF/lib directory at deployment time. Try exporting the project as a WAR by selecting File > Export > Web > WAR file to confirm that is happening.

Is there anything of note in the Error log view when this happens?
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575207 is a reply to message #575192] Sat, 06 March 2010 17:52 Go to previous messageGo to next message
Kurt  is currently offline Kurt Friend
Messages: 22
Registered: February 2010
Junior Member
Nothing found in .log that is relevant.

All of the jars from cxf-2.2.6/lib are being copied when I export a WAR. I couldn't get this to work and the export action has the same problem I did when I tried it manually. The JAXB jar in the JDK causes unhappiness:

Caused by: java.lang.LinkageError: JAXB 2.0 API is being loaded from the bootstrap classloader, but this RI (from jar:file:/C:/apache/apache-tomcat-6.0.14/webapps/BoardCalLin k/WEB-INF/lib/jaxb-impl-2.1.12.jar!/com/sun/xml/bind/v2/mode l/impl/ModelBuilder.class) needs 2.1 API. Use the endorsed directory mechanism to place jaxb-api.jar in the bootstrap classloader. (See http://java.sun.com/j2se/1.5.0/docs/guide/standards/)

This doesn't explain, however, why I'm unable to run tomcat from within Eclipse without copying the jars (or at least why it only works some of the time). How does one go about troubleshooting that? Is that a JAXB 2.0 jar problem as well?

Did I say "thanks Shane" for all of the hand-holding?
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575215 is a reply to message #575207] Sat, 06 March 2010 20:59 Go to previous messageGo to next message
Shane Clarke is currently offline Shane ClarkeFriend
Messages: 67
Registered: July 2009
Member
Hi Kurt,

Being unable to run tomcat from within Eclipse without copying the jars doesn't sound like a JAXB 2.0 problem.

Could you tell me the full version number of the 1.6 JDK you're running and the version of WTP you've got installed?

Also do you know which JAX-WS Tools milestone you're running as well?

This wiki page may help you narrow it down:
http://wiki.eclipse.org/JAXWS/MilestonePlan
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575242 is a reply to message #575215] Sat, 06 March 2010 21:34 Go to previous messageGo to next message
Kurt  is currently offline Kurt Friend
Messages: 22
Registered: February 2010
Junior Member
An acute understanding of the Eclipse version naming strategy escapes me, but here are my best guesses at the version numbers:

Java v1.6.0-b105
JAX-WS Tools Core v0.5.2, Build id: 20090911111021
Web Developer Tools v3.1.1, Build id: 20100211202452
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575262 is a reply to message #575242] Sat, 06 March 2010 22:56 Go to previous messageGo to next message
Shane Clarke is currently offline Shane ClarkeFriend
Messages: 67
Registered: July 2009
Member
OK, the first thing i'd do is upgrade the 1.6 JDK to the latest update.

There are JAXB problems running CXF with pre 1.6.0_04 versions of the JDK.

I should have asked that question earlier.
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575303 is a reply to message #575262] Sun, 07 March 2010 19:31 Go to previous messageGo to next message
Kurt  is currently offline Kurt Friend
Messages: 22
Registered: February 2010
Junior Member
Shane,

I upgraded to JDK1.6.0_18-b07 and am having the same problem. Starting the web service within Galileo only works consistently when I copy the jars I mentioned earlier to WEB-INF/lib.
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575320 is a reply to message #575303] Sun, 07 March 2010 22:28 Go to previous messageGo to next message
Shane Clarke is currently offline Shane ClarkeFriend
Messages: 67
Registered: July 2009
Member
You could try installing the latest version of JAX-WS Tools.

The build you are using is quite old. There may have been something in the earlier builds that was causing this that went undetected.

The latest milestone is due at the end of this week and will be available on the
http://download.eclipse.org/webtools/milestones/ update site. I can update this thread when it's available.

If you'd like to try the latest code now i can point you to an integration build download. You can install this by unzipping into your Eclipse dropins folder.
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575460 is a reply to message #575320] Thu, 18 March 2010 22:22 Go to previous messageGo to next message
Shane Clarke is currently offline Shane ClarkeFriend
Messages: 67
Registered: July 2009
Member
Latest milestone now available on http://download.eclipse.org/webtools/milestones/ (It was a few days late).

There's currently a bug in the way the JAX-WS Tools features are listed on the update site.

Deselect the 'Group items by category' check box and select the following features to install:

CXF Web Services SDK
JAX-WS DOM Tools SDK
JAX-WS Tools SDK
Re: On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet [message #575488 is a reply to message #570879] Wed, 24 March 2010 02:01 Go to previous message
Kurt  is currently offline Kurt Friend
Messages: 22
Registered: February 2010
Junior Member
Loaded the latest!

I'm trying to sort out a problem opening the Dynamic Web Project wizard:

The selected wizard could not be started.
Plug-in "org.eclipse.jst.servlet.ui" was unable to instantiate class "org.eclipse.jst.servlet.ui.project.facet.WebProjectWizard".
java.lang.NullPointerException

I'll keep at it.
Previous Topic:On-going nightmare -> ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet
Next Topic:JAX-WS
Goto Forum:
  


Current Time: Tue Mar 19 07:20:44 GMT 2024

Powered by FUDForum. Page generated in 0.01908 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top