You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "GGGGGHT (via GitHub)" <gi...@apache.org> on 2023/12/09 12:55:02 UTC

[I] [Bug] Exceptions caused by the apm-spring-cloud-gateway-3.x-plugin using methods that have been deprecated and deleted [skywalking]

GGGGGHT opened a new issue, #11641:
URL: https://github.com/apache/skywalking/issues/11641

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Apache SkyWalking Component
   
   Java Agent (apache/skywalking-java)
   
   ### What happened
   
   ### version info 
   java version: 21
   spring boot versoin: 3.2.0
   spring cloud version: 2023.0.0
   skywalking version: 9.1.0
   
   NoSuchMethodError caused by using a method that has been removed
   
   ### What you expected to happen
   
   [in this line](https://github.com/apache/skywalking-java/blob/main/apm-sniffer/optional-plugins/optional-spring-plugins/spring-webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/DispatcherHandlerHandleMethodInterceptor.java#L73),  It uses a deprecated method, and this method has been removed [in this version](https://github.com/spring-projects/spring-framework/commit/7df2e2a8d2a845984cde806232181da486dcf7bd#diff-5608f6bafc3d5b693cc517a845674904de8d2ca17188dc0a9544c1f38b4459d6L46). The specific exceptions are as follows.
   
   <pre>
   ERROR  reactor-http-nio-7 InstMethodsInter : class[class org.springframework.web.reactive.DispatcherHandler] before method[handle] intercept failure 
   java.lang.NoSuchMethodError: 'java.lang.String org.springframework.http.server.reactive.ServerHttpRequest.getMethodValue()'
   	at org.apache.skywalking.apm.plugin.spring.webflux.v5.DispatcherHandlerHandleMethodInterceptor.beforeMethod(DispatcherHandlerHandleMethodInterceptor.java:73)
   	at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:76)
   	at org.springframework.web.reactive.DispatcherHandler.handle(DispatcherHandler.java)
   	at org.springframework.web.server.handler.DefaultWebFilterChain.lambda$filter$0(DefaultWebFilterChain.java:109)
   	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:45)
   	at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
   	at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:53)
   	at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
   	at reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.subscribeNext(MonoIgnoreThen.java:264)
   	at reactor.core.publisher.MonoIgnoreThen.subscribe(MonoIgnoreThen.java:51)
   	at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:76)
   	at reactor.core.publisher.MonoDeferContextual.subscribe(MonoDeferContextual.java:55)
   	at reactor.netty.http.server.HttpServer$HttpServerHandle.onStateChange(HttpServer.java:1169)
   	at reactor.netty.ReactorNetty$CompositeConnectionObserver.onStateChange(ReactorNetty.java:710)
   	at reactor.netty.transport.ServerTransport$ChildObserver.onStateChange(ServerTransport.java:481)
   	at reactor.netty.http.server.HttpServerOperations.onInboundNext(HttpServerOperations.java:652)
   	at reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:114)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	at reactor.netty.http.server.HttpTrafficHandler.channelRead(HttpTrafficHandler.java:238)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)
   	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
   	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
   	at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
   	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
   	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
   	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
   	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
   	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
   	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
   	at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
   	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
   	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
   	at java.base/java.lang.Thread.run(Thread.java:1583)
   </pre>
   
   ### How to reproduce
   
   ### pom 
   ```xml
   <parent>
           <groupId>org.springframework.boot</groupId>
           <artifactId>spring-boot-starter-parent</artifactId>
           <version>3.2.0</version>
           <relativePath/>
       </parent>
       <properties>
           <java.version>21</java.version>
           <spring-cloud.version>2023.0.0</spring-cloud.version>
       </properties>
       <dependencies>
           <dependency>
               <groupId>org.springframework.cloud</groupId>
               <artifactId>spring-cloud-starter-gateway</artifactId>
           </dependency>
           <dependency>
               <groupId>org.springframework.cloud</groupId>
               <artifactId>spring-cloud-starter</artifactId>
               <exclusions>
                   <exclusion>
                       <groupId>org.springframework.boot</groupId>
                       <artifactId>spring-boot-starter-logging</artifactId>
                   </exclusion>
               </exclusions>
           </dependency>
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-log4j2</artifactId>
           </dependency>
           <dependency>
               <groupId>org.springframework.boot</groupId>
               <artifactId>spring-boot-starter-webflux</artifactId>
           </dependency>
           <dependency>
               <groupId>org.apache.skywalking</groupId>
               <artifactId>apm-toolkit-log4j-2.x</artifactId>
               <version>9.1.0</version>
           </dependency>
           <dependency>
               <groupId>org.apache.skywalking</groupId>
               <artifactId>apm-toolkit-trace</artifactId>
               <version>9.1.0</version>
           </dependency>
       </dependencies>
   ```
   
   ### boot class
   ```java
   import org.springframework.boot.SpringApplication;
   import org.springframework.boot.autoconfigure.SpringBootApplication;
   import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
   import org.springframework.context.annotation.Bean;
   import org.springframework.cloud.gateway.route.RouteLocator;
   
   @SpringBootApplication
   public class GatewayApplication {
   
       public static void main(String[] args) {
           SpringApplication.run(GatewayApplication.class, args);
       }
   
       @Bean
       public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
           //@formatter:off
           return builder.routes()
                   .route("path_route", r -> r.path("/get")
                           .uri("http://httpbin.org"))
                   .build();
           //@formatter:on
       }
   }
   
   ```
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit a pull request to fix on your own?
   
   - [X] Yes I am willing to submit a pull request on my own!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Exceptions caused by the apm-spring-cloud-gateway-3.x-plugin using methods that have been deprecated and deleted [skywalking]

Posted by "GGGGGHT (via GitHub)" <gi...@apache.org>.
GGGGGHT commented on issue #11641:
URL: https://github.com/apache/skywalking/issues/11641#issuecomment-1848405268

   I use apm-spring-cloud-gateway-3.x-plugin-9.1.0.jar this plugin, My question is that since the name of this package is apm-spring-cloud-gateway-3.x-plugin-9.1.0.jar. So it should support spring-boot3, that is, it supports spring-framework 6.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Exceptions caused by the apm-spring-cloud-gateway-3.x-plugin using methods that have been deprecated and deleted [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on issue #11641:
URL: https://github.com/apache/skywalking/issues/11641#issuecomment-1848403565

   Notice, the plugin is only for v5, and your version is v6. So, most likely, you need another plugin with witness methods to separate versions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Exceptions caused by the apm-spring-cloud-gateway-3.x-plugin using methods that have been deprecated and deleted [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on issue #11641:
URL: https://github.com/apache/skywalking/issues/11641#issuecomment-1848406184

   I don't know Gateway plugin. What you provided in the description is [this](https://github.com/apache/skywalking-java/blob/main/apm-sniffer/optional-plugins/optional-spring-plugins/spring-webflux-5.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/webflux/v5/DispatcherHandlerHandleMethodInterceptor.java#L73), which is a webflux v5 plugin.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Exceptions caused by the apm-spring-cloud-gateway-3.x-plugin using methods that have been deprecated and deleted [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng closed issue #11641: [Bug] Exceptions caused by the apm-spring-cloud-gateway-3.x-plugin using methods that have been deprecated and deleted
URL: https://github.com/apache/skywalking/issues/11641


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Exceptions caused by the apm-spring-cloud-gateway-3.x-plugin using methods that have been deprecated and deleted [skywalking]

Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng commented on issue #11641:
URL: https://github.com/apache/skywalking/issues/11641#issuecomment-1848410090

   It depends on what is possible. As this is a public API, you need a new module to make compiling passed, I assume.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Exceptions caused by the apm-spring-cloud-gateway-3.x-plugin using methods that have been deprecated and deleted [skywalking]

Posted by "GGGGGHT (via GitHub)" <gi...@apache.org>.
GGGGGHT commented on issue #11641:
URL: https://github.com/apache/skywalking/issues/11641#issuecomment-1848408249

   I understand what you mean. Does this mean that I need to rewrite a complete V6 version to replace this V5 version?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Exceptions caused by the apm-spring-cloud-gateway-3.x-plugin using methods that have been deprecated and deleted [skywalking]

Posted by "GGGGGHT (via GitHub)" <gi...@apache.org>.
GGGGGHT commented on issue #11641:
URL: https://github.com/apache/skywalking/issues/11641#issuecomment-1848408547

   Or I need to implement a Multi-Release JAR to package the V6 version with the V5 version


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org