WrenSecurity / wrenam

Community fork of OpenAM, an authentication and authorization system originally developed by ForgeRock.
Other
43 stars 27 forks source link

NPE when com.sun.identity.util.debug.provider is Invalid #41

Open Kortanul opened 5 years ago

Kortanul commented 5 years ago

Affected Versions

Summary

If you specify a custom class name for com.sun.identity.util.debug.provider when running Tomcat, and that class name is invalid, AM fails to start with an NPE instead of recovering gracefully.

Steps to Reproduce

  1. Modify CATALINA_OPTS for AM to include the following:
    -Dcom.sun.identity.util.debug.provider=com.sun.identity.shared.debug.impl.StdOutDebugProvider
  2. Ensure the AM WAR file is in the Tomcat webapps folder.
  3. Attempt to launch Tomcat.

Expected Results

Actual Results

Kortanul commented 5 years ago

This is really dumb... ROFL. The reason for the NPE is that the initialization of the Locale class fails while AM is in the process of initializing logging... so it tries to use the thing it just failed to initialize to log the error.

In short, the debug provider is null, so it tries to log an error using the Locale, which depends on the provider not being null for logging...