• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

Maven / Tomcat issue with Servlet jar

 
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I have an issue with offending jar file "servlet.class" in my web application. My web application is built using Maven and deployed to tomcat 5.x.x. I have a dependency on my Maven pom.xml for the servlet api as below,



But when I build it and deploy it to Tomcat, I get the following error message...

 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made the scope to provided in my Maven dependency declaration, but even after that I get the same problem.
 
Saloon Keeper
Posts: 21311
140
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you delete any stale copies of the deployed servlet. Specifically, remove both the WAR and the exploded WAR from your TOMCAT_HOME/webapps directory and remove TOMCAT_HOME/work/Catalina/localhost/xxxxx, where "xxxxx" is the WAR's name.

The scope "provided" is correct for JARs like the servlet-api.jar that are provided by the runtime and not bundled as part of the deployable unit, so it's almost certain that you just have some leftover stuff from before you fixed that.
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I did that and seems to work now.
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just deleted the exploded war and it started to work!
 
Tim Holloway
Saloon Keeper
Posts: 21311
140
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the more irritating features of Tomcat is that if you copy a WAR into the webapps directory and Tomcat explodes it, that's the WAR it's going to use, even if you replace the original ".war" file with a newer version. So as part of my deployment process I make it a practice to clean house.
 
Joe Harry
Ranch Hand
Posts: 10191
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the suggestion. I guess most of the web / app servers require a clean deployment to make use of the latest files.
 
Danger, 10,000 volts, very electic .... tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!