APAR status
Closed as program error.
Error description
On WebSphere Application Server (any version,) if the Worklight project does not start correctly, it can subsequently cause a NullPointerException in AuthenticationContext.getOrCreateAuthenticationContext. For example, if the installed WAR configuration is incorrectly (such as an invalid DataSource), or if the database user ID or Password information is incorrect, this will cause the WL project initialization to fail in the Worklight ServletContextListener. However, on WebSphere, failures in a ServletContextListener do NOT stop the web application from being started. Since the WL web app is started, but was not correctly initialized, it results in a NullPointerException. For example: 11/7/12 12:27:46:023 CST] 00000057 webapp E com.ibm.ws.webcontainer.webapp.WebApp logServletError SRVE0293E: [Servlet Error]-[ServletNameNotFound]: java.lang.NullPointerException at com.worklight.core.auth.impl.AuthenticationContext.getOrCreateAu thenticationContext(AuthenticationContext.java:105) at com.worklight.core.auth.impl.AuthenticationFilter.doFilter(Authe nticationFilter.java:91) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(Fi lterInstanceWrapper.java:192) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebApp FilterChain.java:89) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebA ppFilterManager.java:926) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters (WebAppFilterManager.java:1023) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java: 3703) ...
Local fix
There is currently no work around for this issue.
Problem summary
**************************************************************** * USERS AFFECTED: Users with Worklight web applications, * * which are installed in a WebSphere * * Application Server environment and which * * have configuration errors. * **************************************************************** * PROBLEM DESCRIPTION: The Worklight web application will * * not be accessible (for example, the * * WL console will not be accessible) * * and a NullPointerException will be * * logged in the WebSphere logs. There * * will be logs prior to the NPE * * indicating what failed during * * initialization of the web app, a log * * indicating that the * * ServletContextListener failed, * * followed by a log saying the web app * * was started. * **************************************************************** * RECOMMENDATION: * **************************************************************** If there are configuration issues (such as invalid database userID or password) in the web application, they will be logged during application start. However, these errors occur in the WL ServletContextListener, so they do not prevent the web app from starting on WebSphere (this is a known behavior on WebSphere and it conforms to the Servlet specification). When a request is received for that web app, it will cause a NullPointerException in the WL AuthenticationFilter when it calls com.worklight.core.auth.impl.AuthenticationContext.getOrCreateAu thenticationContext. The NPE is because the web app initialization was not successful. Note that fixing the webapp configuaration so that it starts correctly will get rid of the NPE and the resulting error response code.
Problem conclusion
The WL ServletContextListener now sets an indication of whether it was successfully initialized or not. If it is not successfully initialized, then the web app will still fail, but will do so gracefully; it will not cause an NPE in the logs, and it will send an error to the client indicating the project was not initialized. The fix for this APAR is currently targetted for inclusion in fixpack 5.0.5.0.
Temporary fix
Comments
APAR Information
APAR number
PM80510
Reported component name
MOBILE FNDTN EN
Reported component ID
5725G9200
Reported release
500
Status
CLOSED PER
PE
NoPE
HIPER
NoHIPER
Special Attention
NoSpecatt
Submitted date
2013-01-13
Closed date
2013-01-22
Last modified date
2013-01-22
APAR is sysrouted FROM one or more of the following:
APAR is sysrouted TO one or more of the following:
Fix information
Fixed component name
MOBILE FNDTN EN
Fixed component ID
5725G9200
Applicable component levels
R500 PSY
UP
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SS4HGH","label":"IBM Mobile Foundation"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"500","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Document Information
Modified date:
22 January 2013