NullPointerException/java.util.logging.ErrorManager: 5 when have load-on-startup

2012-07-07 Thread ohaya
Hi,

I have a simple servlet deployed to Tomcat 6.0.35, and when I enable 
load-on-startup in the web.xml, so that the servlet's init() method gets run 
when Tomcat starts up, I get:

.
.
In LoginServlet.init: Returned from calling CreateDefaultInstance...
In LoginServlet.init: FINISHED initializing!!
Jul 7, 2012 8:21:31 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory showhdrs
Jul 7, 2012 8:21:31 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Jul 7, 2012 8:21:31 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Jul 7, 2012 8:21:31 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples

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)
.
.

i.e., It appears that my servlet's init() method completes successfully, but 
then later in the startup, Tomcat throws this exception (actually twice).

If I remove the load-on-startup from the servlet's web.xml, Tomcat starts 
fine, and processing in my servlet works ok (the init() method runs on first 
request, and service() method processes requests ok).

I think that that 5 indicates a format error in the (Tomcat) logging, but I'm 
not currently using/invoking any logger in my servlet.

Can anyone tell me what might be causing the error, and how I can eliminate the 
problem?  

Thanks,
Jim

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



Re: NullPointerException/java.util.logging.ErrorManager: 5 when have load-on-startup

2012-07-07 Thread Mark Thomas
On 07/07/2012 13:40, oh...@cox.net wrote:
 Can anyone tell me what might be causing the error, and how I can eliminate 
 the problem? 

Since you have removed the part of the stack trace that might tell use
what the cause is, no.

Mark

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



Re: Tomcat 7 Cluster Issue

2012-07-07 Thread Mark Thomas
On 15/03/2012 10:14, Pid wrote:
 On 12/03/2012 22:14, Bruce Pease wrote:
 I am using a windows 2003 server 32 bit standard edition SP2 with IIS 6.  I
 have an isapi_redirect.dll v.1.2.31 communicating to tomcat via ajp1.3.  JDK
 version was 7.03, and tomcat version is 7.0.26.  Tomcat is installed as a
 service using the service.bat, and I am running two containers in the
 clustered environment.  Session replication is in memory, and communication
 is limited to within the server, i.e. not to any external server. 

 I can provide complete configuration files or more detail if needed.

 Thanks very much for your help.
 
 Can you add the -Djava.net.preferIPv4Stack=true to your service startup
 settings?
 
 See thread: Re: Java 7 + Tomcat 6.0.35 + Win2k3 Problem for more details.

For the archives, this was a Tomcat bug fixed in 7.0.30.
See http://svn.apache.org/viewvc?rev=1358591view=rev

Mark

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



Re: NullPointerException/java.util.logging.ErrorManager: 5 when have load-on-startup

2012-07-07 Thread ohaya

 Mark Thomas ma...@apache.org wrote: 
 On 07/07/2012 13:40, oh...@cox.net wrote:
  Can anyone tell me what might be causing the error, and how I can eliminate 
  the problem? 
 
 Since you have removed the part of the stack trace that might tell use
 what the cause is, no.
 
 Mark


Hi Mark,

Sorry about that.  Here's part of the catalina.out again, with the rest of the 
stack trace, plus showing it happens twice


In LoginServlet.init: FINISHED initializing!!
Jul 7, 2012 8:21:31 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory showhdrs
Jul 7, 2012 8:21:31 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory docs
Jul 7, 2012 8:21:31 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ROOT
Jul 7, 2012 8:21:31 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory examples
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
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)
Jul 7, 2012 8:21:31 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080

The oracle ones are because I'm using stuff from the Oracle OAM SDK, and I am 
initializing the SDK in the servlet init() method (which appears to be working).

Jim

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



Re: NullPointerException/java.util.logging.ErrorManager: 5 when have load-on-startup

2012-07-07 Thread Mark Thomas
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

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



Re: confused by tomcat6/7 docs

2012-07-07 Thread Olivier Lamy
Yup because currently not all goals from tomcat6 have been implemented
in tomcat7.

http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/tomcat6-maven-plugin/plugin-info.html
whereas.
http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/tomcat7-maven-plugin/plugin-info.html

You can load an issue (if possible with a patch :-) ) for goals you'd like see.

2012/7/6 Russ Tremain ru...@releasetools.org:
 Hi Oliver,

 I must say I'm a bit confused by the examples  docs for
 tomcat7-maven-plugin.

 I see reference to a war:explode goal, which doesn't seem to exist. The
 reference is here:

 http://tomcat.apache.org/maven-plugin-2.0-beta-1/context-goals.html

 But when I dump the plugin documentation [1], I see no such goal.

 What I would like to find out about the possibility to deploy an exploded
 war image to a local tomcat instance.

 I've been successfully using the deploy (tomcat7:deploy) goal, but my
 developers are complaining that it is too slow.  I need to work out a method
 to use an exploded war.

 Any help appreciated...

 thanks!
 -Russ

 [1] mvn -Dplugin=tomcat7 -DgroupId=org.apache.tomcat.maven -Dfull
 help:describe
 ...
 [INFO] org.apache.tomcat.maven:tomcat7-maven-plugin:2.0-beta-1

 Name: Apache Tomcat Maven Plugin :: Tomcat 7.x
 Description: The Tomcat Maven Plugin provides goals to manipulate WAR
   projects within the Tomcat 7.x servlet container.
 Group Id: org.apache.tomcat.maven
 Artifact Id: tomcat7-maven-plugin
 Version: 2.0-beta-1
 Goal Prefix: tomcat7

 This plugin has 8 goals:

 tomcat7:deploy
   Description: Deploy a WAR to Tomcat.
   Implementation: org.apache.tomcat.maven.plugin.tomcat7.deploy.DeployMojo
   Language: java
   Before this mojo executes, it will call:
 Phase: 'package'

   Available parameters:

 charset (Default: ISO-8859-1)
   The URL encoding charset to use when communicating with Tomcat
 manager.

 contextFile
   The path of the Tomcat context XML file. This is not used for war
   deployment mode.

 ignorePackaging (Default: false)
   If set to true ignore if packaging of project is not 'war'.

 mode (Default: war)
   The deployment mode to use. This must be either war to deploy the war,
   context to deploy the context XML file, or both to deploy the war with
   the context XML file.

 password
   The password to use for deployment

 path (Default: /${project.artifactId})
   The webapp context path to use for the web application being run. This
   must always start with a forward-slash ('/').

 server
   The server id in settings.xml to use when authenticating with Tomcat
   manager, or null to use defaults of username admin and no password.

 tag
   The Tomcat webapp tag name to use.

 update (Default: false)
   Whether Tomcat should automatically undeploy webapps that already
 exist
   when deploying.

 url (Default: http://localhost:8080/manager/html)
   The full URL of the Tomcat manager instance to use.

 username
   The tomcat username to use for deployment

 warFile
   The path of the WAR file to deploy.

 tomcat7:deploy-only
   Description: Deploy a WAR to Tomcat witjout forking the package lifecycle
   Implementation:
 org.apache.tomcat.maven.plugin.tomcat7.deploy.DeployOnlyMojo
   Language: java

   Available parameters:

 charset (Default: ISO-8859-1)
   The URL encoding charset to use when communicating with Tomcat
 manager.

 contextFile
   The path of the Tomcat context XML file. This is not used for war
   deployment mode.

 ignorePackaging (Default: false)
   If set to true ignore if packaging of project is not 'war'.

 mode (Default: war)
   The deployment mode to use. This must be either war to deploy the war,
   context to deploy the context XML file, or both to deploy the war with
   the context XML file.

 password
   The password to use for deployment

 path (Default: /${project.artifactId})
   The webapp context path to use for the web application being run. This
   must always start with a forward-slash ('/').

 server
   The server id in settings.xml to use when authenticating with Tomcat
   manager, or null to use defaults of username admin and no password.

 tag
   The Tomcat webapp tag name to use.

 update (Default: false)
   Whether Tomcat should automatically undeploy webapps that already
 exist
   when deploying.

 url (Default: http://localhost:8080/manager/html)
   The full URL of the Tomcat manager instance to use.

 username
   The tomcat username to use for deployment

 warFile
   The path of the WAR file to deploy.

 tomcat7:exec-war
   Description: (no description available)
   Implementation: org.apache.tomcat.maven.plugin.tomcat7.run.ExecWarMojo
   Language: java
   Before this mojo executes, it will call:
 Phase: 'package'

   Available parameters:

 

Re: NullPointerException/java.util.logging.ErrorManager: 5 when have load-on-startup

2012-07-07 Thread ohaya

 Mark Thomas ma...@apache.org wrote: 
 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.

Thanks,
Jim

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



Re: Java 7 + Tomcat 6.0.35 + Win2k3 Problem

2012-07-07 Thread Mark Thomas
On 14/03/2012 19:18, pricyber wrote:
 I downloaded the apache source code and commented out the line in 
 org.apache.tomcat.util.net.SocketProperties.setProperties(SocketProperties.java:184)
 where it say 
 socket.setTrafficClass(soTrafficClass);
 
 And it works, but not sure if there are any ill effects for doing that.
 
 This problem only occurs in Windows 2003 with Java7, but no problem on
 ubuntu/osx/windows 7/2008

Hmm. I see the same issues in XP with Java 7 and the NIO connector.

Didn't realise it was just an XP/2003 issue. Thought it was wider. Hmm.
That probably changes how this needs to be handled. Drat.

I really don't want to head down the OS specific code route on this one.

Further discussion on the dev list.

Mark

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