• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ClassNotFoundException: javax.servlet.Servlet at Tomcat startup

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

I am trying to start the tomcat server directly by running startup.bat file of the tomcat/bin folder. But I am getting the below mentioned servlet exception:



I have added all the necessary jar files in the tomcat lib folder as well.
jars.JPG
[Thumbnail for jars.JPG]
List of jar files in the tomcat lib folder
 
Keerthi Kumar
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear all,

The server is getting started successfully, but the application is not loading. It is throwing the above mentioned servlet exception. Please help me out to resolve the issue.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
EaseUp. I've changed the title of your thread.
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. First check to which Jar does the Servlet class belongs to (I feel it is j2ee.jar). You can use the windows Search to find out where the jar lies in your system.
2. Put the Jar in the Runtime path of tomcat.
3. Restart the Server
 
Keerthi Kumar
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear,

I added the j2ee.jar file into the tomcat/lib folder and when i started the server, I am getting the below error:

 
Praneeth Yeri
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. Do you have any working web app that is present in the webapps folder ? I feel that this error is coming because tomcat is not able to find any webapps ( web.xml). Try to clean up the webapps folder and try to put a working webapp with all the requried files ( web.xml etc.) in it.

2. One more way which works most of the time is, instead of doing debugging this way ,

I would suggest you download a fresh copy of Tomcat from the Internet and then directly start the server. Every tomcat download will have some working webapps in them. This would save you a lot of time instead of spending time on debugging a messed up tomcat install. After this, you can add your webapp to the working one.
 
Keerthi Kumar
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear Praneeth,

Just clarify below doubts of mine:

1. Where should i place the j2ee.jar and servlet-api.jar files?? ( in tomcat/lib or web-inf/lib folder)
2. can i place the servlet-api.jar in both tomcat/lib or web-inf/lib folder?
3. can i use both j2ee.jar and servlet-api.jar? will this lead to any conflict?

Awaiting your response.
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You shouldn't be adding those jars anywhere! If they're in WEB-INF/lib remove them!

Tomcat already has the jars it needs. Just leave them be.
 
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic