[ERROR] [org.mortbay.log] /jsp/login.jsf javax.faces.FacesException: java.lang.NullPointerException

Document ID : KB000096494
Last Modified Date : 16/05/2018
Show Technical Document Details
Issue:
The below exception is filling the webview log very quickly.
The system appears to be working ok but I would like to get rid of the errors.

4/24/18 11:05:16.267 AM BST [ERROR] [org.mortbay.log] /jsp/login.jsf
javax.faces.FacesException: java.lang.NullPointerException
at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:422)
at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
at com.ca.corpui.faces.application.CALocaleRemapViewHandler.renderView(CALocaleRemapViewHandler.java:86)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at org.mortbay.servlet.UserAgentFilter.doFilter(UserAgentFilter.java:78)
at org.mortbay.servlet.GzipFilter.doFilter(GzipFilter.java:131)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.wily.webserver.filter.RequestLocaleFilter.doFilter(RequestLocaleFilter.java:46)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.wily.introscope.webapps.common.filter.XSSFilter.doFilter(XSSFilter.java:32)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.wily.introscope.webapps.common.filter.ClickJackFilter.doFilter(ClickJackFilter.java:52)
...
Cause:
The problem is related to defect DE360724 a missing header causing the exception.
 
Resolution:
The fix will be available as part of 10.7SP1

Workaround:
1.Stop Webview
2.Take a backup of the EM_HOME/product/webview/plugins/com.ca.apm.introscope.workstation.webapp_10.7.0.jar
3.Open the jar file using 7zip (in windows) 
NOTE: In unix you need extract the jar to a tmp location using unzip, apply the change and recreate the package again.

Go to WebContent/jsp/
Edit login.jsp

-Comment the below line:
Boolean isInApmServerContext = request.getHeader("referer").contains("/ApmServer");

-Append the below 2 lines:
String referer = request.getHeader("referer");
Boolean isInApmServerContext = (referer != null) && (referer.contains("/ApmServer"));

The result will be:
//Boolean isInApmServerContext = request.getHeader("referer").contains("/ApmServer");
String referer = request.getHeader("referer");
Boolean isInApmServerContext = (referer != null) && (referer.contains("/ApmServer"));

Update the package with the above changes
4. Go to EM_HOME/product/webview/configuration, delete all folder except the config.ini
5. Go to EM_HOME/work - delete the content
6. Start Webview