aspose file tools
The moose likes Servlets and the fly likes ContextListener crashing out Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "ContextListener crashing out" Watch "ContextListener crashing out" New topic
Author

ContextListener crashing out

Aron Daburn
Ranch Hand

Joined: Mar 18, 2007
Posts: 36
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

Joined: Dec 11, 2004
Posts: 13410

Maybe there is a mistake in your deployment descriptor.
Have you looked at your container's logs?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Aron Daburn
Ranch Hand

Joined: Mar 18, 2007
Posts: 36
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: ContextListener crashing out
 
Similar Threads
Local variable initialization question
Listener started twice
Is this Dao?
Forward in an action forms reset method.
invalidMonitorState