Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat 7 not loading classes/jars in Web-Inf

 
Hugh Acland
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello -

I'm on Mac OS X, using Tomcat 7. I can see the JAR libraries in the {webapp}/WEB-INF/lib directory fine

However I am still getting the cursed java.lang.NoClassDefFoundError

Even if I then manual delete the .jar file the error remains with same stacktrace so to my mind it appears the classloaders are not kicking in correctly?

Can anyone please point me in the correct direction.

Many thanks
 
Sachin Pachari
Ranch Hand
Posts: 56
Eclipse IDE Netbeans IDE Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
posting the error stack strace might help a little bit.
 
Tim Holloway
Saloon Keeper
Posts: 18304
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Note that a "NoClassDefFound" exception is something entirely different than a ClassNotFoundException!
 
Tim Moores
Bartender
Posts: 2955
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It could mean that the jar file that contains the missing class is damaged; make sure you can do a "jar tf ..." on it.
 
Hugh Acland
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sachin Pachari wrote:posting the error stack strace might help a little bit.


Thanks here it is:

Stacktrace:
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:455)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.services.s3.AmazonS3Client
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:911)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:840)
org.apache.jsp.index_jsp._jspService(index_jsp.java:143)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

root cause

java.lang.NoClassDefFoundError: Could not initialize class com.amazonaws.services.s3.AmazonS3Client
org.apache.jsp.index_jsp._jspService(index_jsp.java:111)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
 
Rob Spoor
Sheriff
Pie
Posts: 20669
65
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The class can be found, just not initialized. That means that a RuntimeException or Error occurs when the class is loaded and initialized. The most occurring problems are a native library file that fails to be load, or a dependency that's missing.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic