Troubleshooting
Problem
When accessing the /health endpoint, the following SRVE0777E error is displayed:
|
In the messages.log file, the following stack trace is shown for the java.lang.IllegalStateException that occurred for the SRVE0777E error message:
SRVE0777E: Exception thrown by application class 'com.ibm.ws.container.service.metadata.internal.MetaDataServiceImpl.getMetaData:268' java.lang.IllegalStateException: WEB#microprofile-app-2.2#microprofile-app-2.2.war at com.ibm.ws.container.service.metadata.internal.MetaDataServiceImpl.getMetaData(MetaDataServiceImpl.java:268) at com.ibm.ws.classloading.internal.ClassLoadingServiceImpl.getClassLoaderIdentifier(ClassLoadingServiceImpl.java:700) at com.ibm.ws.microprofile.health.services.impl.AppModuleContextService.getContextClassLoaderIdentifier(AppModuleContextService.java:145) at com.ibm.ws.microprofile.health.services.impl.AppModuleContextService.createThreadContext(AppModuleContextService.java:168) at com.ibm.ws.microprofile.health.services.impl.AppModuleContextService.createContextualProxy(AppModuleContextService.java:194) at com.ibm.ws.microprofile.health.services.impl.HealthExecutorImpl.runHealthChecks(HealthExecutorImpl.java:70) at com.ibm.ws.microprofile.health.internal.HealthCheckServiceImpl.performHealthCheck(HealthCheckServiceImpl.java:108) at com.ibm.ws.microprofile.health.internal.servlet.HealthCheckServlet.service(HealthCheckServlet.java:53) at javax.servlet.http.HttpServlet.service(HttpServlet.java:791) at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:729) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:426) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:182) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:93) at com.ibm.ws.app.manager.wab.internal.OsgiDirectoryProtectionFilter.doFilter(OsgiDirectoryProtectionFilter.java:90) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:201) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:90) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:993) at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1131) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4993) at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.handleRequest(DynamicVirtualHost.java:314) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1007) at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$2.run(DynamicVirtualHost.java:279) at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:1136) at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.wrapHandlerAndExecute(HttpDispatcherLink.java:417) at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink.ready(HttpDispatcherLink.java:376) at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:532) at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.handleNewRequest(HttpInboundLink.java:466) at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.processRequest(HttpInboundLink.java:331) at com.ibm.ws.http.channel.internal.inbound.HttpInboundLink.ready(HttpInboundLink.java:302) at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:165) at com.ibm.ws.tcpchannel.internal.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:74) at com.ibm.ws.tcpchannel.internal.WorkQueueManager.requestComplete(WorkQueueManager.java:503) at com.ibm.ws.tcpchannel.internal.WorkQueueManager.attemptIO(WorkQueueManager.java:573) at com.ibm.ws.tcpchannel.internal.WorkQueueManager.workerRun(WorkQueueManager.java:954) at com.ibm.ws.tcpchannel.internal.WorkQueueManager$Worker.run(WorkQueueManager.java:1043) at com.ibm.ws.threading.internal.ExecutorServiceImpl$RunnableWrapper.run(ExecutorServiceImpl.java:239) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:748) |
Cause
The issue only happens for applications which use the mpHealth-1.0/2.0 feature, where the name attribute for the application element in the server configuration is set to a different name than the application file name, such as the following snippet from the server.xml.
<application type="war" id="microprofile-app" name="microprofile-app" location="${shared.app.dir}/webcontainer/microprofile-app-2.2.war"/> |
The application Web Application Resource (WAR) file name is "microprofile-all-2.2.war", however, the name attribute for the application element is "microprofile-app", in the server configuration.
Therefore, when the "/health" endpoint is accessed, the incorrect J2EEName is created (WEB#microprofile-app-2.2#microprofile-app-2.2.war) that is used to get the application's (microprofile-app) metadata, resulting in the SRV0777E error to occur. The correct J2EEName should be: WEB#microprofile-app#microprofile-app-2.2.war
Resolving The Problem
To workaround this issue, in the server configuration (server.xml), set the name attribute in the application element to match the WAR file name, or remove the name attribute completely from the application element for the application, and try accessing the "/health" endpoint again.
Document Location
Worldwide
[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"19.0.0.8","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]
Was this topic helpful?
Document Information
Modified date:
20 August 2019
UID
ibm10967796