• 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

Maven / Tomcat issue with Servlet jar

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I did that and seems to work now.
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just deleted the exploded war and it started to work!
 
Tim Holloway
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic