Win a copy of AWS Security this week in the Cloud/Virtualization 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

DD Skipped installing listeners

 
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
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • 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


 
Ranch Hand
Posts: 437
Oracle Java
  • 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



 
Time flies like an arrow. Fruit flies like a banana. Steve flies like a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic