This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Error Message  RSS feed

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi 2 all,
I have made a simple LoginServlet, which just call a method validate() of a class Customer. Although that class Customer is placed in the lib folder of my web application as a jar file .
But when i try to use this class in that servlet LoginServlet, it shows an error that message.
" The server encountered an internal error () that prevented it from fulfilling this request. "
exception
javax.servlet.ServletException: Invoker service() exception
at org.apache.catalina.servlets.InvokerServlet.serveRequest(InvokerServlet.java:524)
at org.apache.catalina.servlets.InvokerServlet.doGet(InvokerServlet.java:180)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

root cause :
java.lang.NoClassDefFoundError: com/retail/controller/Customer
----------
Although jar file of complete package which contains class Customer is placed in the lib of web-inf of my web application.
I think that servlet container is not able to load that jar file. But how this problem could be solved?
Plz reply me ASAP.
 
Ranch Hand
Posts: 1211
IntelliJ IDE Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A possible mistake, quite common actually..
make sure that your directory is WEB-INF, and not web-inf. it is case-sensitive.
 
Ahsan Jamil
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanx 4 ur reply, it is Web-inf, & i have checked its accessing the servlet i.e its accessing the web-inf\classes but cannt acces jar file, i dunno, y? plz someone give me the answer
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!