2012/7/8  <oh...@cox.net>:
>> On 07/07/2012 17:33, oh...@cox.net wrote:
>>
>> Trace A:
>> > java.util.logging.ErrorManager: 5
>> > java.lang.NullPointerException
>> >         at 
>> > java.util.ListResourceBundle.handleGetObject(ListResourceBundle.java:109)
>> >         at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
>> >         at java.util.ResourceBundle.getString(ResourceBundle.java:334)
>> >         at java.util.logging.Formatter.formatMessage(Formatter.java:108)
>> >         at 
>> > java.util.logging.SimpleFormatter.format(SimpleFormatter.java:63)
>> >         at org.apache.juli.FileHandler.publish(FileHandler.java:198)
>> >         at java.util.logging.Logger.log(Logger.java:478)
>> >         at java.util.logging.Logger.doLog(Logger.java:501)
>> >         at java.util.logging.Logger.log(Logger.java:524)
>> >         at 
>> > oracle.security.am.common.nap.util.NAPLogger.log(NAPLogger.java:60)
>> >         at 
>> > oracle.security.am.common.nap.util.pool.ObjectPoolManager.shutdown(ObjectPoolManager.java:267)
>> >         at 
>> > oracle.security.am.common.aaaclient.ObAAAServiceClient.close(ObAAAServiceClient.java:1239)
>> >         at 
>> > oracle.security.am.common.aaaclient.ObAAAServiceClient.finalize(ObAAAServiceClient.java:2548)
>> >         at jrockit.memory.Finalizer.doFinalize(Finalizer.java:29)
>> >         at jrockit.memory.Finalizer.access$300(Finalizer.java:12)
>> >         at jrockit.memory.Finalizer$4.run(Finalizer.java:186)
>> >         at java.lang.Thread.run(Thread.java:662)
>> > java.util.logging.ErrorManager: 5
>>
>> Trace B:
>> > java.lang.NullPointerException
>> >         at 
>> > java.util.ListResourceBundle.handleGetObject(ListResourceBundle.java:109)
>> >         at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
>> >         at java.util.ResourceBundle.getString(ResourceBundle.java:334)
>> >         at java.util.logging.Formatter.formatMessage(Formatter.java:108)
>> >         at 
>> > java.util.logging.SimpleFormatter.format(SimpleFormatter.java:63)
>> >         at java.util.logging.StreamHandler.publish(StreamHandler.java:179)
>> >         at java.util.logging.ConsoleHandler.publish(ConsoleHandler.java:88)
>> >         at java.util.logging.Logger.log(Logger.java:478)
>> >         at java.util.logging.Logger.doLog(Logger.java:501)
>> >         at java.util.logging.Logger.log(Logger.java:524)
>> >         at 
>> > oracle.security.am.common.nap.util.NAPLogger.log(NAPLogger.java:60)
>> >         at 
>> > oracle.security.am.common.nap.util.pool.ObjectPoolManager.shutdown(ObjectPoolManager.java:267)
>> >         at 
>> > oracle.security.am.common.aaaclient.ObAAAServiceClient.close(ObAAAServiceClient.java:1239)
>> >         at 
>> > oracle.security.am.common.aaaclient.ObAAAServiceClient.finalize(ObAAAServiceClient.java:2548)
>> >         at jrockit.memory.Finalizer.doFinalize(Finalizer.java:29)
>> >         at jrockit.memory.Finalizer.access$300(Finalizer.java:12)
>> >         at jrockit.memory.Finalizer$4.run(Finalizer.java:186)
>> >         at java.lang.Thread.run(Thread.java:662)
>>
>> Do you see any Tomcat code in Trace B? No? Neither do I. So what makes
>> you think there is a Tomcat problem here?
>>
>> Given the only difference in Trace A is that you are using a Tomcat
>> Handler rather than the console I don't see anything here to suggest a
>> Tomcat bug.
>>
>> Looking at the source for java.util.ListResourceBundle, the key or the
>> value being used for the log message is null. That makes this an OAM
>> bug, not a Tomcat one.
>>
>> Mark
>>
>
>
> Hi Mark,
>
> Just to be clear, I wasn't pointing to a Tomcat bug :(...
>
> I'm just trying to figure out why the NullPointerException doesn't happen 
> when I don't have <load-on-startup> in my servlet's web.xml, but does happen 
> when I have <load-on-startup> in the web.xml.  Also, BTW, if I stop then 
> start the servlet app using the Tomcat manager app, I don't get the 
> NullPointerException.
>
> What might the difference be between when the <load-on-startup> is in the 
> web.xml vs. not being in the web.xml?  Doesn't Tomcat just load and call the 
> servlet's init() method when the <load-on-startup> is present?  I'm kind of 
> guessing it may be a timing type issue, as in my servlet's init() method, I 
> initialize the Oracle stuff.  My initialization call returns, but it may be 
> that there's still something going on behind-the-scenes that's not quite done.
>

1. Using a load-on-startup servlet to initialize something is a bad
approach. The recommended one is to use a ServletContextListener.

2. You should cleanup resources after yourself. You should not rely on
finalizer to clean up your resources.

Finalizer might not have access to classes or resources of your
webapplications,  because of different thread-context classloader
(TCCL), or if the cleanup happens when the application has already
been stopped. In this case it looks like the former.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to