NoClassDefFoundError when trying to reference external jar files
Posted
by
opike
on Stack Overflow
See other posts from Stack Overflow
or by opike
Published on 2011-02-08T01:47:43Z
Indexed on
2011/02/10
15:25 UTC
Read the original article
Hit count: 233
I have some 3rd party jar files that I want to reference in my tomcat web application. I added this line to catalina.properties:
shared.loader=/home/ollie/dev/java/googleapi_samples/gdata/java/lib/*.jar
but I'm still getting this error:
org.apache.jasper.JasperException: javax.servlet.ServletException: java.lang.NoClassDefFoundError: com/google/gdata/util/ServiceException
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:491)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:401)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
I verified that the com.google.gdata.util.ServiceException is in the gdata-core-1.0.jar file which is in the directory:
/home/ollie/dev/java/googleapi_samples/gdata/java/lib
I did bounce tomcat after I modified catalina.properties.
Update 1: I tried copying the gdata-core-1.0.jar file into /var/lib/tomcat6/webapp/examples/WEB-INF/lib as a test but that didn't fix the problem either.
Update 2: It actually does work when I copy the jar file directly into the WEB-INF/lib directory. There was a permissions issue that I had to resolve. But it's still not working when I use the shared.loader setting. I reconfirmed that the path is correct.
© Stack Overflow or respective owner