• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

ContextListener crashing out

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a ServletContextListener that is creating an object in the contextInitialized() method. I know that an exception is being thrown in the creation of the object. However, it is encased in a try-catch block.

I then gave it a public string, called debug, and appended info to it as it was being initialized. Upon trying to retrieve that String from the object in the catch block after the exception was thrown, the server will not initialize. That doesn't suprise me given that the object was not fully initialized itself and I'm trying to use it. I then put the line of code that tries to retrieve the debug String in its own try-catch block to see what exception that would return. However, the code does not work and the application never starts up.



So I guess my main question is, how could it not be starting when everything is in try-catch blocks?
 
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
Maybe there is a mistake in your deployment descriptor.
Have you looked at your container's logs?
 
Aron Daburn
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just found out what the problem was. Though, I'm not yet sure what caused the problem. Apparently a jar file being used by the listener was not being updated when I was replacing it. Thus, the call to the new debug String I added was not allowing it to compile correctly.

Something seemed a little fishy so I thought I would ask, but it is working now. Thanks for the help.
 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic