oracle / weblogic-monitoring-exporter

WebLogic Monitoring Exporter exposes metrics and monitoring data through REST APIs for consumption by other tools (e.g. Prometheus)
Universal Permissive License v1.0
105 stars 80 forks source link

Received status 500 - Request failed. #333

Closed moli2022 closed 1 year ago

moli2022 commented 1 year ago

version: wls-exporter:WebLogic Monitoring Exporter 2.1.5 JDK:java version "1.8.0_221" WebLogic:WebLogic Server 12.2.1.3.0 PSU:WLS PATCH SET UPDATE 12.2.1.3.230402

After successfully deploying the WAR file wls-exporter.war, when accessing the URL http://192.168.0.14:60101/wls-exporter/metrics, an error occurs: "Received status 500 - Request failed."

moli2022 commented 1 year ago

error logs: <Sep 15, 2023 3:56:49,764 PM CST> <[ServletContext@172100589[app:wls-management-services module:wls-management-services.war path:null spec-version:3.1], request: weblogic.servlet.internal.ServletRequestImpl@3a71b26d[ POST /management/weblogic/latest/serverRuntime/search HTTP/1.1 X-Requested-By: rest-exporter Authorization: * Content-Type: application/json; charset=UTF-8 Content-Length: 309 Connection: Keep-Alive User-Agent: Apache-HttpClient/4.5.14 (Java/1.8.0_221) Accept-Encoding: gzip,deflate

]] Root cause of ServletException. org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: javax/ws/rs/MessageProcessingException at org.glassfish.jersey.servlet.internal.ResponseWriter.rethrow(ResponseWriter.java:278) at org.glassfish.jersey.servlet.internal.ResponseWriter.failure(ResponseWriter.java:260) at org.glassfish.jersey.server.ServerRuntime$Responder.process(ServerRuntime.java:509) at org.glassfish.jersey.server.ServerRuntime$2.run(ServerRuntime.java:334) at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271) Truncated. Caused By: java.lang.NoClassDefFoundError: javax/ws/rs/MessageProcessingException at org.apache.cxf.jaxrs.impl.ResponseBuilderImpl.build(ResponseBuilderImpl.java:69) at org.glassfish.admin.rest.composite.CompositeResource.ok(CompositeResource.java:331) at weblogic.management.rest.lib.bean.resources.AbstractBeanResource.get(AbstractBeanResource.java:42) at weblogic.management.rest.lib.bean.resources.RootBeanResource.search(RootBeanResource.java:59) at weblogic.management.rest.bean.resources.custom.SearchResource.act(SearchResource.java:17) Truncated. Caused By: java.lang.ClassNotFoundException: javax.ws.rs.MessageProcessingException at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1029) at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:990) at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:101) at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:611) at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:543) Truncated.

moli2022 commented 1 year ago

In WebLogic, I had two web applications deployed. Application 1 had REST services disabled and had a deployment order of 100, while the priority of deploying "wls-exporter.war" was not as high. I resolved the issue by setting the deployment order of Application 1 to 101 and then restarting the server.