aspose file tools*
The moose likes Tomcat and the fly likes ClassNotFoundException: javax.servlet.Servlet  at Tomcat startup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "ClassNotFoundException: javax.servlet.Servlet  at Tomcat startup" Watch "ClassNotFoundException: javax.servlet.Servlet  at Tomcat startup" New topic
Author

ClassNotFoundException: javax.servlet.Servlet at Tomcat startup

Keerthi Kumar
Ranch Hand

Joined: Apr 20, 2009
Posts: 105
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.



[Thumbnail for jars.JPG]


Cheers,
Keerthi Kumar N
Keerthi Kumar
Ranch Hand

Joined: Apr 20, 2009
Posts: 105
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.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

EaseUp. I've changed the title of your thread.


[My Blog]
All roads lead to JavaRanch
Praneeth Yeri
Greenhorn

Joined: Oct 07, 2010
Posts: 11
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

Joined: Apr 20, 2009
Posts: 105
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

Joined: Oct 07, 2010
Posts: 11
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

Joined: Apr 20, 2009
Posts: 105
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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61428
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassNotFoundException: javax.servlet.Servlet at Tomcat startup