pinpoint-apm / pinpoint

APM, (Application Performance Management) tool for large-scale distributed systems.
https://pinpoint-apm.gitbook.io/
Apache License 2.0
13.43k stars 3.76k forks source link

Query call chain interface in Pinpoint ppweb fails with classloader issue #11231

Open car1000 opened 4 months ago

car1000 commented 4 months ago

We are using version 4.5.2

We wrote a controller on navercorp.pinpoint.web of ppweb.

package com.huawei.gaia.monitor.web.controller;

@GetMapping(value = "/getTransactionInfo") public CallStackInfoVo getTransactionInfo(@RequestParam("traceId") String traceId, @RequestParam(value = "focusTimestamp", required = false, defaultValue = DEFAULT_FOCUS_TIMESTAMP) long focusTimestamp, @RequestParam(value = "agentId", required = false) String agentId, @RequestParam(value = "spanId", required = false, defaultValue = DEFAULT_SPANID) long spanId, @RequestParam(value = "v", required = false, defaultValue = "0") int viewVersion) { logger.info("Chenqiang============================================== GET /transactionInfo params {traceId={}, focusTimestamp={}, agentId={}, spanId={}, v={}}", traceId, focusTimestamp, agentId, spanId, viewVersion); final TransactionId transactionId = TransactionIdUtils.parseTransactionId(traceId); final ColumnGetCount columnGetCount = ColumnGetCountFactory.create(callstackSelectSpansLimit);

    Predicate<SpanBo> spanMatchFilter = SpanFilters.spanFilter(spanId, agentId, focusTimestamp);
    // select spans
    final SpanResult spanResult = this.spanService.selectSpan(transactionId, spanMatchFilter, columnGetCount);
    final CallTreeIterator callTreeIterator = spanResult.getCallTree();

    RecordSet recordSet = this.transactionInfoService.createRecordSet(callTreeIterator, spanMatchFilter);

    return new CallStackInfoVo(transactionId, spanId, recordSet, spanResult.getTraceState(), logConfiguration);
}
car1000 commented 4 months ago

An error occurred with the class loader

2024-07-09 20:33:29.905 [http-nio-8080-exec-26] ERROR o.s.b.w.s.s.ErrorPageFilter Forwarding to error page from request [/getTransactionInfo.pinpoint] due to exception [class java.lang.String cannot be cast to class com.navercorp.pinpoint.common.util.StringStringValue (java.lang.String is in module java.base of loader 'bootstrap'; com.navercorp.pinpoint.common.util.StringStringValue is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @5b9b45b4)] java.lang.ClassCastException: class java.lang.String cannot be cast to class com.navercorp.pinpoint.common.util.StringStringValue (java.lang.String is in module java.base of loader 'bootstrap'; com.navercorp.pinpoint.common.util.StringStringValue is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @5b9b45b4) at com.navercorp.pinpoint.web.service.SpanServiceImpl$2.replacement(SpanServiceImpl.java:288) ~[classes/:?] at com.navercorp.pinpoint.web.service.SpanServiceImpl.transitionAnnotation(SpanServiceImpl.java:194) ~[classes/:?] at com.navercorp.pinpoint.web.service.SpanServiceImpl.transitionMongoJson(SpanServiceImpl.java:272) ~[classes/:?] at com.navercorp.pinpoint.web.service.SpanServiceImpl.selectSpan(SpanServiceImpl.java:137) ~[classes/:?] at com.huawei.gaia.monitor.web.controller.SingleApiServerMapController.getTransactionInfo(SingleApiServerMapController.java:128) ~[classes/:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?] at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.34.jar:5.3.34] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.34.jar:5.3.34] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.34.jar:5.3.34] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:903) ~[spring-webmvc-5.3.34.jar:5.3.34] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:809) ~[spring-webmvc-5.3.34.jar:5.3.34] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.34.jar:5.3.34] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1072) ~[spring-webmvc-5.3.34.jar:5.3.34] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:965) ~[spring-webmvc-5.3.34.jar:5.3.34] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) ~[spring-webmvc-5.3.34.jar:5.3.34] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898) ~[spring-webmvc-5.3.34.jar:5.3.34] at javax.servlet.http.HttpServlet.service(HttpServlet.java:626) ~[servlet-api.jar:?] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) ~[spring-webmvc-5.3.34.jar:5.3.34] at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) ~[servlet-api.jar:?] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:8.5.61] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.61] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.5.61] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.61] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.61] at com.huawei.gaia.monitor.web.servlet.AuthFilter.doFilter(AuthFilter.java:68) ~[classes/:?] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.61] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.61] at com.navercorp.pinpoint.web.servlet.RewriteForV2Filter.doFilter(RewriteForV2Filter.java:96) ~[classes/:?] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.61] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.61] at org.springframework.web.filter.ShallowEtagHeaderFilter.doFilterInternal(ShallowEtagHeaderFilter.java:106) ~[spring-web-5.3.34.jar:5.3.34] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.34.jar:5.3.34] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.61] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.61] at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:126) ~[spring-boot-2.7.18.jar:2.7.18] at org.springframework.boot.web.servlet.support.ErrorPageFilter.access$000(ErrorPageFilter.java:64) ~[spring-boot-2.7.18.jar:2.7.18] at org.springframework.boot.web.servlet.support.ErrorPageFilter$1.doFilterInternal(ErrorPageFilter.java:101) ~[spring-boot-2.7.18.jar:2.7.18] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.34.jar:5.3.34] at org.springframework.boot.web.servlet.support.ErrorPageFilter.doFilter(ErrorPageFilter.java:119) ~[spring-boot-2.7.18.jar:2.7.18] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.61] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.61] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.3.34.jar:5.3.34] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117) ~[spring-web-5.3.34.jar:5.3.34] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[catalina.jar:8.5.61] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:8.5.61] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) ~[catalina.jar:8.5.61] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) ~[catalina.jar:8.5.61] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:544) ~[catalina.jar:8.5.61] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) ~[catalina.jar:8.5.61] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) ~[catalina.jar:8.5.61] at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:690) ~[catalina.jar:8.5.61] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) ~[catalina.jar:8.5.61] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[catalina.jar:8.5.61] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:616) ~[tomcat-coyote.jar:8.5.61] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) ~[tomcat-coyote.jar:8.5.61] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:831) ~[tomcat-coyote.jar:8.5.61] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1634) ~[tomcat-coyote.jar:8.5.61] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-coyote.jar:8.5.61] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.5.61] at java.lang.Thread.run(Thread.java:829) ~[?:?]

2024-07-09 20:33:29.905 [http-nio-8080-exec-26] ERROR o.s.b.w.s.s.ErrorPageFilter Forwarding to error page from request [/getTransactionInfo.pinpoint] due to exception [class java.lang.String cannot be cast to class com.navercorp.pinpoint.common.util.StringStringValue (java.lang.String is in module java.base of loader 'bootstrap'; com.navercorp.pinpoint.common.util.StringStringValue is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @5b9b45b4)] java.lang.ClassCastException: class java.lang.String cannot be cast to class com.navercorp.pinpoint.common.util.StringStringValue (java.lang.String is in module java.base of loader 'bootstrap'; com.navercorp.pinpoint.common.util.StringStringValue is in unnamed module of loader org.apache.catalina.loader.ParallelWebappClassLoader @5b9b45b4)

What causes this?

car1000 commented 4 months ago

We haven't modified the code. This is all source code. monogo is used in the code on the user side.