Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ContextListener crashing out  RSS feed

 
Aron Daburn
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • 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?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!