• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DD Skipped installing listeners

 
Sharmila Punde
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,
I have two listeners in DD as - The constructor of TestContextListener throws Runtime exception, and tomcat container displays error as -
SEVERE: Error configuring application listener of class foo.TestServlet
java.lang.RuntimeException: TestContextListener constructor intentional exception thrown by me
SEVERE: Skipped installing application listeners due to previous error(s)

Same things happens when two or more servlets are configured, and first of them blow the constructor,
i cannot see rest of servlets loaded.
Please guide me, where i can get rules which are related to DD about above concept. (e.g. if first
element of DD does not load, rest of them of the same type also does not get loaded)
Thanks
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is foo.TestServlet a listener ? Its name implies that it is a servlet, not a listener. Please show your code for foo.TestServlet.
 
Sharmila Punde
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Christophe,And TestServlet works fine if i do not blow TestContextListener as on line 1.
So where can i find list of rules for DD, in case some element of the DD does not loaded due to exception or other reason. Looks like when one type of element at first order is not loaded and instantiated, rest of the same type does not load and instantiate. Is it the rule?

Thanks


 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Sharmila.

When an exception thrown in ServletContextListener, application will not run. Can you please post, complete code of 'TestServlet' and 'TestContextListener' classes?
 
Sharmila Punde
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Chinmaya and Christophe,
I think the code posted above was not required, and it was not to the point question. Please let me simplify the question. My question is ,"Is it correct, on startup of tomcat, If one element(e.g. listener or servlet or jsp") of DD throws exception during construction or initialization, rest of elements are not loaded at all"? . I have experienced this, but do not know exact rules about how it works. Can you give some guidance about rules for DD?

Thanks



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic