Java.lang.ClassNotFoundException: org.jdom.JDOMException

When you try to load the rss page, you receive the following error message:

Feb 16, 2013 9:08:44 PM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [news-feed] in context with path [/publisher] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: org.jdom.JDOMException at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) at com.sun.syndication.io.SyndFeedOutput.<init>(SyndFeedOutput.java:44) 

The line of code that causes the error:

  SyndFeedOutput output = new SyndFeedOutput(); 

I sent this error message and read several posts about it, including publications on this site. These publications suggest that adding jdom.jar to the build path will cause the error to disappear. However, I added all 8 jar files that came with jdom-2.0.4.jar to my build path in eclipse, but the error message still persists every time I try to load the rss page.

I am wondering if the problem might be that I am using jdom-2.0.4.jar with what could be a stronger syntax:

  SyndFeedOutput output = new SyndFeedOutput(); 

Other messages for this error message were from older versions of jdom. Perhaps there is a new syntax for calling the equivalent of SyndFeedOutput () in the new version of jdom?

Can someone help me get past this error message?

EDIT:

To refer to the Nocmear suggestion, I confirmed that the following 9 jar files are the only jar files associated with jdom or rome that are included in the build path for my application:

 jaxen-1.1.4.jar jdom-2.0.4.jar jdom-2.0.4-contrib.jar jdom-2.0.4-javadoc.jar jdom-2.0.4-junit.jar jdom-2.0.4-sources.jar rome-1.0.jar xercesImpl.jar xml-apis.jar 

SECOND EDIT:


I downloaded jdom-1.1.3 and added it to my path of building the application in eclipse, as suggested by rolfl.

When I went to load the rss page into my web browser, tomcat gave me the following error log:

 java.lang.NoClassDefFoundError: org/jdom/JDOMException com.sun.syndication.io.SyndFeedOutput.<init>(SyndFeedOutput.java:44) publisher.web.NewsFeedServlet.doGet(NewsFeedServlet.java:68) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) java.lang.ClassNotFoundException: org.jdom.JDOMException org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559) com.sun.syndication.io.SyndFeedOutput.<init>(SyndFeedOutput.java:44) publisher.web.NewsFeedServlet.doGet(NewsFeedServlet.java:68) javax.servlet.http.HttpServlet.service(HttpServlet.java:621) javax.servlet.http.HttpServlet.service(HttpServlet.java:728) 

The relevant jar files that are now included in my build path are as follows:

 ant.jar jaxen.jar jaxen 1.1.4.jar jdom-2.0.4.jar jdom-2.0.4-contrib.jar jdom-2.0.4-javadoc.jar jdom-2.0.4-junit.jar jdom-2.0.4-sources.jar rome-1.0.jar xalan.jar xerces.jar xercesImpl.jar xml-apis.jar 

In addition, I tried to add these banks to the bin file in tomcat instead as suggested by Nocmear, but it just caused error messages in eclipse, so I returned them to the eclipse application.

Perhaps I do not understand what people are offering. Or maybe someone might have other suggestions. Any help is appreciated.

+4
source share
3 answers

You have JDOM 2.x version for your classpath, but the code is looking for version 1.x.

Download JDOM 1.1.3 and put this in your class path along with one (latest) version of JDOM 2.x. All packages in JDOM 1.x are org.jdom. * ... and all packages in JDOM 2.x are org.jdom2. *

See this note: Migrating JDOM2

and on the first page of the JDOM website: read to the state of the project

Rolf

+4
source

M8, rome-1.0 depends on jdom-1.0.

Thus, you can change the use of jdom-1.0.jar instead of jdom-2.0.x ro jdom-1.1.3.

+2
source

Please check the jar version. You can import two cans, one old and one new, then you delete the old one or load the newest one.

+1
source

All Articles