This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Maven / Tomcat issue with Servlet jar

 
Joe Harry
Ranch Hand
Posts: 10106
3
Eclipse IDE Mac PPC 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: 10106
3
Eclipse IDE Mac PPC 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.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18098
50
Android Eclipse IDE 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: 10106
3
Eclipse IDE Mac PPC 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: 10106
3
Eclipse IDE Mac PPC 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
Pie
Posts: 18098
50
Android Eclipse IDE 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: 10106
3
Eclipse IDE Mac PPC 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic