Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Abhi Bharade
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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.
 
Jeffrey Spaulding
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... and what would that Exception be Abhi.

share the wisdom

J.
 
Egil Poma
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • 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!
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • 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
 
Dirk Schumacher
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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....
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic