Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Servlet getting loaded twice.... dont know why?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A servlet which is meant to run as soon as tomcat(5.5.7) starts is getting loaded twice and generates exception the second time.
 
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
... and what would that Exception be Abhi.

share the wisdom

J.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you ever figure out why the servlet is beeing run twice?

I have the same problem now with Tomcat 5.5.17. What happens is that ALL of the classes, including the servlets, are instantiated twice by Tomcat.

I can't figure out why.

Hope someone can help!
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As I recall, this can happen if you are using both the invoker servlet and a web.xml mapping of an individual servlet, or multiple mappings of a single servlet, but that was on a servlet by servlet basis.

Why are you sure that all servlets are being loaded twice. Does this happen all at once on startup or gradually as requests come in?

Bill
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Having the same problem. I willinvestigate in the InvokerServlet and my web.xml. I am running tomcat 5.5 with eclipse(wtp). I could imagine there's the problem since eclipse uses its own "virtual" web-app directory for tomcat.
Let me know if anyone figured out why it loads twice....
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Egil Poma:

I have the same problem now with Tomcat 5.5.17. What happens is that ALL of the classes, including the servlets, are instantiated twice by Tomcat.
...



The Tomcat Manager application has a screen that lists the deployed applications and their status. See if your app was deployed twice.

This can happen if you explicitly configure your app (either in server.xml or with a context fragment file) AND put your app in Tomcat's webapps directory.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic