I have One Agent (1.299.50.20240930-123825) running in my Spring Boot application. However, I am receiving the error below:
java.lang.NoClassDefFoundError: Could not initialize class com.dynatrace.agent.introspection.cloudevents.outgoing.okhttp.OkHttpCloudEventsIntrospectionWrapper
Would you mind sharing the related logs for further investigation.
Another solution is to update the application related technologies, uninstall OA, remove all directories and then re-install it again “fresh deployment”.
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.dynatrace.agent.introspection.cloudevents.outgoing.okhttp.OkHttpCloudEventsIntrospectionWrapper
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1086)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:964)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:670)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:779)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:102)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:102)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.ForwardedHeaderFilter.doFilterInternal(ForwardedHeaderFilter.java:156)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:711)
at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:385)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:313)
at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:403)
at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:249)
at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:344)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:893)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1789)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:750)
Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.dynatrace.agent.introspection.cloudevents.outgoing.okhttp.OkHttpCloudEventsIntrospectionWrapper
at okhttp3.internal.connection.RealCall.execute(RealCall.kt)
at feign.okhttp.OkHttpClient.execute(OkHttpClient.java:169)
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:119)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:89)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:100)
at com.sun.proxy.$Proxy113.getRemoteConfig(Unknown Source)
at com.example.repository.remoteconfig.RemoteConfigRepository.fetchRemoteConfig(RemoteConfigRepository.kt:20)
at com.example.repository.remoteconfig.RemoteConfigRepository$$FastClassBySpringCGLIB$$b28d96de.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.cache.interceptor.CacheInterceptor.lambda$invoke$0(CacheInterceptor.java:54)
at org.springframework.cache.interceptor.CacheAspectSupport.invokeOperation(CacheAspectSupport.java:366)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:421)
at org.springframework.cache.interceptor.CacheAspectSupport.execute(CacheAspectSupport.java:345)
at org.springframework.cache.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:64)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
at com.example.repository.remoteconfig.RemoteConfigRepository$$EnhancerBySpringCGLIB$$26736658.fetchRemoteConfig(<generated>)
at com.example.service.remoteconfig.RemoteConfigService.getMappedCountryParameters(RemoteConfigService.kt:88)
at com.example.service.remoteconfig.RemoteConfigService.getProgram(RemoteConfigService.kt:46)
at com.example.server.interceptors.authentication.AuthenticationHandlerInterceptor.extractClientCredentials(AuthenticationHandlerInterceptor.kt:84)
at com.example.server.interceptors.authentication.AuthenticationHandlerInterceptor.preHandle(AuthenticationHandlerInterceptor.kt:43)
at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:148)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1066)
... 38 common frames omitted
Looking at Technology support — Dynatrace Docs I’m not seeing support for Feign under Web Services. We do make use of Spring in our application so I am going to try and make use of Spring Web Services to facilitate the API calls to see if that sorts out the issue.
I don’t think reinstalling One Agent will help. The application is running within AWS ECS and when it starts up another container is created that does a fresh install of One Agent and so it has been reinstalled a few times to no avail.
I managed to solve the issue. It appears that Feign isn’t supported so I switched to OpenFeign (I incorrectly listed this as something we were using above) which is.
Once again, thank you for the direction that you provided on this matter.
The move to OpenFeign didn’t resolve the issue. When the API was started up we made use of the flag -javaagent:aws-opentelemetry-agent.jar because we were using OpenTelemetry in the past. We no longer use OpenTelemetry and removing the flag resolved the issue for us.