Closed ztg25 closed 6 months ago
我的Milvus在本机以容器方式启动,使用本机springboot启动连接,出现这个错误。但我使用官网python测试代码就可以正常连接并创建Collection。请问Java SDK version2.3.3 这个版本是否无法连接到milvusdb/milvus:latest这个版本。因为我本地生成milvusdb/milvus:v2.3.3出错,所以只能使用milvusdb/milvus:latest这个版本。
不是连接的问题,应该是有dependency conflict,跟server端没有关系。你的pom文件
如果你能用attu连上的话,就能看到milvus server的版本号
我的Milvus在本机以容器方式启动,使用本机springboot启动连接,出现这个错误。但我使用官网python测试代码就可以正常连接并创建Collection。请问Java SDK version2.3.3 这个版本是否无法连接到milvusdb/milvus:latest这个版本。因为我本地生成milvusdb/milvus:v2.3.3出错,所以只能使用milvusdb/milvus:latest这个版本。
this is because your jvm settings.
java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled Basically this means your jvm didn't support to reflect private object but netty need to do so.
This could happen if you are using JPMS or you are running security manager
开发环境-JDK11, intelljIDEA,maven3.6.1, macOS, 代码链接:https://github.com/ztg25/milvus-demo 按着提供的思路发现,查询资料发现,JDK8以上好像都不支持setAccessible(true),所以netty使用时会报这样的错误。netty在以后的版本里也做了相应的处理。 pom内容:
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.milvus</groupId>
<artifactId>milvus-sdk-java</artifactId>
<version>2.3.3</version>
<exclusions>
<exclusion>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
</exclusion>
<exclusion>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- https://mvnrepository.com/artifact/io.netty/netty-buffer -->
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>4.1.107.Final</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>1.61.0</version>
</dependency>
</dependencies>
于是我试着使用最新的netty来处理,目前发现这个错误是消失了。但也有了新的问题。
2024-03-05 14:33:40.501 INFO 33753 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-03-05 14:33:40.503 INFO 33753 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2024-03-05 14:33:40.527 INFO 33753 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 24 ms
2024-03-05 14:33:40.570 INFO 33753 --- [nio-8080-exec-1] i.m.client.AbstractMilvusGrpcClient : HasCollectionParam(collectionName=hello_milvus, databaseName=null)
2024-03-05 14:33:40.685 ERROR 33753 --- [ault-executor-0] io.grpc.internal.ManagedChannelImpl : [Channel<1>: (localhost:19530)] Uncaught exception in the SynchronizationContext. Panic!
java.lang.NoClassDefFoundError: io.netty.util.internal.ReferenceCountUpdater
at io.netty.buffer.Unpooled.wrappedBuffer(Unpooled.java:160) ~[netty-buffer-4.1.107.Final.jar:4.1.107.Final]
at io.netty.handler.codec.http2.Http2ConnectionHandler.<clinit>(Http2ConnectionHandler.java:74) ~[netty-codec-http2-4.1.34.Final.jar:4.1.34.Final]
at io.grpc.netty.NettyClientTransport.start(NettyClientTransport.java:221) ~[grpc-netty-1.61.0.jar:1.61.0]
at io.grpc.internal.ForwardingConnectionClientTransport.start(ForwardingConnectionClientTransport.java:34) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.ForwardingConnectionClientTransport.start(ForwardingConnectionClientTransport.java:34) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:259) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.InternalSubchannel.access$400(InternalSubchannel.java:66) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.InternalSubchannel$2.run(InternalSubchannel.java:201) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:94) ~[grpc-api-1.61.0.jar:1.61.0]
at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:126) ~[grpc-api-1.61.0.jar:1.61.0]
at io.grpc.internal.ManagedChannelImpl$NameResolverListener.onResult(ManagedChannelImpl.java:1886) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.RetryingNameResolver$RetryingListener.onResult(RetryingNameResolver.java:98) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:333) ~[grpc-core-1.61.0.jar:1.61.0]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:839) ~[na:na]
Caused by: java.lang.ClassNotFoundException: io.netty.util.internal.ReferenceCountUpdater
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:766) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1074) ~[na:na]
... 16 common frames omitted
2024-03-05 14:33:40.694 ERROR 33753 --- [nio-8080-exec-1] i.m.client.AbstractMilvusGrpcClient : HasCollectionRequest RPC failed:hello_milvus
io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
at io.grpc.StatusRuntimeException.fillInStackTrace(StatusRuntimeException.java:68) ~[grpc-api-1.61.0.jar:1.61.0]
at io.grpc.StatusRuntimeException.<init>(StatusRuntimeException.java:58) ~[grpc-api-1.61.0.jar:1.61.0]
at io.grpc.StatusRuntimeException.<init>(StatusRuntimeException.java:50) ~[grpc-api-1.61.0.jar:1.61.0]
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:271) ~[grpc-stub-1.46.0.jar:1.46.0]
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:252) ~[grpc-stub-1.46.0.jar:1.46.0]
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:165) ~[grpc-stub-1.46.0.jar:1.46.0]
at io.milvus.grpc.MilvusServiceGrpc$MilvusServiceBlockingStub.hasCollection(MilvusServiceGrpc.java:4453) ~[milvus-sdk-java-2.3.3.jar:na]
at io.milvus.client.AbstractMilvusGrpcClient.hasCollection(AbstractMilvusGrpcClient.java:353) ~[milvus-sdk-java-2.3.3.jar:na]
at io.milvus.client.MilvusServiceClient.lambda$hasCollection$1(MilvusServiceClient.java:305) ~[milvus-sdk-java-2.3.3.jar:na]
at io.milvus.client.MilvusServiceClient.retry(MilvusServiceClient.java:256) ~[milvus-sdk-java-2.3.3.jar:na]
at io.milvus.client.MilvusServiceClient.hasCollection(MilvusServiceClient.java:305) ~[milvus-sdk-java-2.3.3.jar:na]
at com.example.demo.controller.MilvusController.checkMilvusService(MilvusController.java:21) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at java.base/java.lang.Thread.run(Thread.java:839) ~[na:na]
Caused by: java.lang.NoClassDefFoundError: io.netty.util.internal.ReferenceCountUpdater
at io.netty.buffer.Unpooled.wrappedBuffer(Unpooled.java:160) ~[netty-buffer-4.1.107.Final.jar:4.1.107.Final]
at io.netty.handler.codec.http2.Http2ConnectionHandler.<clinit>(Http2ConnectionHandler.java:74) ~[netty-codec-http2-4.1.34.Final.jar:4.1.34.Final]
at io.grpc.netty.NettyClientTransport.start(NettyClientTransport.java:221) ~[grpc-netty-1.61.0.jar:1.61.0]
at io.grpc.internal.ForwardingConnectionClientTransport.start(ForwardingConnectionClientTransport.java:34) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.ForwardingConnectionClientTransport.start(ForwardingConnectionClientTransport.java:34) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:259) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.InternalSubchannel.access$400(InternalSubchannel.java:66) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.InternalSubchannel$2.run(InternalSubchannel.java:201) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:94) ~[grpc-api-1.61.0.jar:1.61.0]
at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:126) ~[grpc-api-1.61.0.jar:1.61.0]
at io.grpc.internal.ManagedChannelImpl$NameResolverListener.onResult(ManagedChannelImpl.java:1886) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.RetryingNameResolver$RetryingListener.onResult(RetryingNameResolver.java:98) ~[grpc-core-1.61.0.jar:1.61.0]
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:333) ~[grpc-core-1.61.0.jar:1.61.0]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
... 1 common frames omitted
Caused by: java.lang.ClassNotFoundException: io.netty.util.internal.ReferenceCountUpdater
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:766) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1074) ~[na:na]
... 16 common frames omitted
milvus status is : -3
response : INTERNAL: Panic! This is a bug!
you could try latest 2.3.4. where the grpc has been upgrade to 1.59.1 https://github.com/milvus-io/milvus-sdk-java/releases/tag/v2.3.4
The same error log on milvus-sdk-java 2.3.4. Does it just suit for JDK1.8 and below?
Hi @yhmo Does your code run well on JDK11?
I believe 1.59.1 is already a very late grpc version. did you still get "java.lang.UnsupportedOperationException: Reflective setAccessible(true) disabled"?
No, it still shows me this 'java.lang.NoClassDefFoundError: io.netty.util.internal.ReferenceCountUpdater" error when updated to milvus-sdk-java 2.3.4.
remove all the mvn changes you made. most likely this is a dependency issue With new milvus java sdk you shouldn't need to change the dependency
I tried to import milvus-sdk-java 2.3.4 only, but there are errors as below.
2024-03-06 13:59:57.996 INFO 50482 --- [nio-8080-exec-2] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2024-03-06 13:59:57.997 INFO 50482 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2024-03-06 13:59:58.018 INFO 50482 --- [nio-8080-exec-2] o.s.web.servlet.DispatcherServlet : Completed initialization in 20 ms
2024-03-06 13:59:58.218 ERROR 50482 --- [ault-executor-0] io.grpc.internal.ManagedChannelImpl : [Channel<1>: (localhost:19530)] Uncaught exception in the SynchronizationContext. Panic!
java.lang.NoSuchMethodError: io/netty/buffer/PooledByteBufAllocator.<init>(ZIIIIIIZ)V (loaded from file:/Users/tony/.m2/repository/io/netty/netty-buffer/4.1.34.Final/netty-buffer-4.1.34.Final.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@be7d8ce7) called from class io.grpc.netty.Utils (loaded from file:/Users/tony/.m2/repository/io/grpc/grpc-netty/1.59.1/grpc-netty-1.59.1.jar by jdk.internal.loader.ClassLoaders$AppClassLoader@be7d8ce7).
at io.grpc.netty.Utils.createByteBufAllocator(Utils.java:187) ~[grpc-netty-1.59.1.jar:1.59.1]
at io.grpc.netty.Utils.access$000(Utils.java:77) ~[grpc-netty-1.59.1.jar:1.59.1]
at io.grpc.netty.Utils$ByteBufAllocatorPreferDirectHolder.<clinit>(Utils.java:100) ~[grpc-netty-1.59.1.jar:1.59.1]
at io.grpc.netty.Utils.getByteBufAllocator(Utils.java:155) ~[grpc-netty-1.59.1.jar:1.59.1]
at io.grpc.netty.NettyClientTransport.start(NettyClientTransport.java:238) ~[grpc-netty-1.59.1.jar:1.59.1]
at io.grpc.internal.ForwardingConnectionClientTransport.start(ForwardingConnectionClientTransport.java:34) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.ForwardingConnectionClientTransport.start(ForwardingConnectionClientTransport.java:34) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:259) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.InternalSubchannel.access$400(InternalSubchannel.java:66) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.InternalSubchannel$2.run(InternalSubchannel.java:201) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:94) ~[grpc-api-1.59.1.jar:1.59.1]
at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:126) ~[grpc-api-1.59.1.jar:1.59.1]
at io.grpc.internal.ManagedChannelImpl$NameResolverListener.onResult(ManagedChannelImpl.java:1868) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.RetryingNameResolver$RetryingListener.onResult(RetryingNameResolver.java:98) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:333) ~[grpc-core-1.59.1.jar:1.59.1]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:839) ~[na:na]
2024-03-06 13:59:58.227 ERROR 50482 --- [nio-8080-exec-2] i.m.client.AbstractMilvusGrpcClient : HasCollectionRequest collectionName:hello_milvus RPC failed! Exception:{}
io.grpc.StatusRuntimeException: INTERNAL: Panic! This is a bug!
at io.grpc.StatusRuntimeException.fillInStackTrace(StatusRuntimeException.java:68) ~[grpc-api-1.59.1.jar:1.59.1]
at io.grpc.StatusRuntimeException.<init>(StatusRuntimeException.java:58) ~[grpc-api-1.59.1.jar:1.59.1]
at io.grpc.StatusRuntimeException.<init>(StatusRuntimeException.java:50) ~[grpc-api-1.59.1.jar:1.59.1]
at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:268) ~[grpc-stub-1.59.1.jar:1.59.1]
at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:249) ~[grpc-stub-1.59.1.jar:1.59.1]
at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:167) ~[grpc-stub-1.59.1.jar:1.59.1]
at io.milvus.grpc.MilvusServiceGrpc$MilvusServiceBlockingStub.hasCollection(MilvusServiceGrpc.java:3992) ~[milvus-sdk-java-2.3.4.jar:na]
at io.milvus.client.AbstractMilvusGrpcClient.hasCollection(AbstractMilvusGrpcClient.java:372) ~[milvus-sdk-java-2.3.4.jar:na]
at io.milvus.client.MilvusServiceClient.lambda$hasCollection$1(MilvusServiceClient.java:362) ~[milvus-sdk-java-2.3.4.jar:na]
at io.milvus.client.MilvusServiceClient.retry(MilvusServiceClient.java:285) ~[milvus-sdk-java-2.3.4.jar:na]
at io.milvus.client.MilvusServiceClient.hasCollection(MilvusServiceClient.java:362) ~[milvus-sdk-java-2.3.4.jar:na]
at com.example.demo.controller.MilvusController.checkMilvusService(MilvusController.java:21) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) ~[spring-webmvc-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.6.RELEASE.jar:5.1.6.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.17.jar:9.0.17]
at java.base/java.lang.Thread.run(Thread.java:839) ~[na:na]
springboot's pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>milvus-demo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>springboot-demo</name>
<description>Demo project for Spring Boot</description>
<properties>
<java.version>11</java.version>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.milvus</groupId>
<artifactId>milvus-sdk-java</artifactId>
<version>2.3.4</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
java.lang.NoSuchMethodError: io/netty/buffer/PooledByteBufAllocator.
try to check mvn dependency and see where this is 4.1.34 is depend on.
1.59.1 relies on 4.1.97 so you get dependency conflicts
maybe try
and see if it can use netty 4.1.34
[INFO] \- io.milvus:milvus-sdk-java:jar:2.3.4:compile
[INFO] +- io.grpc:grpc-netty:jar:1.59.1:compile
[INFO] | +- io.grpc:grpc-core:jar:1.59.1:compile
[INFO] | | +- com.google.android:annotations:jar:4.1.1.4:runtime
[INFO] | | +- org.codehaus.mojo:animal-sniffer-annotations:jar:1.23:runtime
[INFO] | | +- io.grpc:grpc-context:jar:1.59.1:runtime
[INFO] | | \- io.grpc:grpc-util:jar:1.59.1:runtime
[INFO] | +- io.netty:netty-codec-http2:jar:4.1.34.Final:compile
[INFO] | | +- io.netty:netty-common:jar:4.1.34.Final:compile
[INFO] | | +- io.netty:netty-buffer:jar:4.1.34.Final:compile
[INFO] | | +- io.netty:netty-transport:jar:4.1.34.Final:compile
[INFO] | | | \- io.netty:netty-resolver:jar:4.1.34.Final:compile
[INFO] | | +- io.netty:netty-codec:jar:4.1.34.Final:compile
[INFO] | | +- io.netty:netty-handler:jar:4.1.34.Final:compile
[INFO] | | \- io.netty:netty-codec-http:jar:4.1.34.Final:compile
[INFO] | +- io.netty:netty-handler-proxy:jar:4.1.34.Final:runtime
[INFO] | | \- io.netty:netty-codec-socks:jar:4.1.34.Final:runtime
[INFO] | +- com.google.guava:guava:jar:32.0.1-android:compile
[INFO] | | +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] | | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] | | +- org.checkerframework:checker-qual:jar:3.33.0:compile
[INFO] | | \- com.google.j2objc:j2objc-annotations:jar:2.8:compile
[INFO] | +- com.google.errorprone:error_prone_annotations:jar:2.20.0:compile
[INFO] | +- io.perfmark:perfmark-api:jar:0.26.0:runtime
[INFO] | \- io.netty:netty-transport-native-unix-common:jar:4.1.34.Final:runtime
[INFO] +- io.grpc:grpc-protobuf:jar:1.59.1:compile
[INFO] | +- io.grpc:grpc-api:jar:1.59.1:compile
[INFO] | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] | +- com.google.api.grpc:proto-google-common-protos:jar:2.22.0:compile
[INFO] | \- io.grpc:grpc-protobuf-lite:jar:1.59.1:compile
[INFO] +- io.grpc:grpc-stub:jar:1.59.1:compile
[INFO] +- com.google.protobuf:protobuf-java:jar:3.24.0:compile
[INFO] +- org.apache.commons:commons-text:jar:1.10.0:compile
[INFO] | \- org.apache.commons:commons-lang3:jar:3.8.1:compile
[INFO] +- org.apache.commons:commons-collections4:jar:4.3:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.8:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.8:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.26:compile
[INFO] +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.11.2:compile
[INFO] | +- org.apache.logging.log4j:log4j-api:jar:2.11.2:compile
[INFO] | \- org.apache.logging.log4j:log4j-core:jar:2.11.2:runtime
[INFO] +- com.squareup.okhttp3:okhttp:jar:4.10.0:compile
[INFO] | \- com.squareup.okio:okio-jvm:jar:3.0.0:compile
[INFO] | \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.2.71:compile
[INFO] | \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.2.71:compile
[INFO] +- org.codehaus.plexus:plexus-utils:jar:3.0.24:compile
[INFO] +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.2.71:compile
[INFO] | +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.2.71:compile
[INFO] | \- org.jetbrains:annotations:jar:13.0:compile
[INFO] \- com.alibaba:fastjson:jar:1.2.83:compile
your mean that use netty-buffer 4.1.97 replace 4.1.34? @xiaofan-luan
java.lang.NoClassDefFoundError: io.netty.util.internal.ReferenceCountUpdater
at io.netty.buffer.Unpooled.wrappedBuffer(Unpooled.java:160) ~[netty-buffer-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.http2.Http2ConnectionHandler.<clinit>(Http2ConnectionHandler.java:74) ~[netty-codec-http2-4.1.34.Final.jar:4.1.34.Final]
at io.grpc.netty.NettyClientTransport.start(NettyClientTransport.java:221) ~[grpc-netty-1.59.1.jar:1.59.1]
at io.grpc.internal.ForwardingConnectionClientTransport.start(ForwardingConnectionClientTransport.java:34) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.ForwardingConnectionClientTransport.start(ForwardingConnectionClientTransport.java:34) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.InternalSubchannel.startNewTransport(InternalSubchannel.java:259) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.InternalSubchannel.access$400(InternalSubchannel.java:66) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.InternalSubchannel$2.run(InternalSubchannel.java:201) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.SynchronizationContext.drain(SynchronizationContext.java:94) ~[grpc-api-1.59.1.jar:1.59.1]
at io.grpc.SynchronizationContext.execute(SynchronizationContext.java:126) ~[grpc-api-1.59.1.jar:1.59.1]
at io.grpc.internal.ManagedChannelImpl$NameResolverListener.onResult(ManagedChannelImpl.java:1868) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.RetryingNameResolver$RetryingListener.onResult(RetryingNameResolver.java:98) ~[grpc-core-1.59.1.jar:1.59.1]
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:333) ~[grpc-core-1.59.1.jar:1.59.1]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:839) ~[na:na]
Caused by: java.lang.ClassNotFoundException: io.netty.util.internal.ReferenceCountUpdater
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:766) ~[na:na]
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178) ~[na:na]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1074) ~[na:na]
... 16 common frames omitted
[INFO] +- io.milvus:milvus-sdk-java:jar:2.3.4:compile
[INFO] | +- io.grpc:grpc-netty:jar:1.59.1:compile
[INFO] | | +- io.grpc:grpc-core:jar:1.59.1:compile
[INFO] | | | +- com.google.android:annotations:jar:4.1.1.4:runtime
[INFO] | | | +- org.codehaus.mojo:animal-sniffer-annotations:jar:1.23:runtime
[INFO] | | | +- io.grpc:grpc-context:jar:1.59.1:runtime
[INFO] | | | \- io.grpc:grpc-util:jar:1.59.1:runtime
[INFO] | | +- io.netty:netty-codec-http2:jar:4.1.34.Final:compile
[INFO] | | | +- io.netty:netty-transport:jar:4.1.34.Final:compile
[INFO] | | | | \- io.netty:netty-resolver:jar:4.1.34.Final:compile
[INFO] | | | +- io.netty:netty-codec:jar:4.1.34.Final:compile
[INFO] | | | +- io.netty:netty-handler:jar:4.1.34.Final:compile
[INFO] | | | \- io.netty:netty-codec-http:jar:4.1.34.Final:compile
[INFO] | | +- io.netty:netty-handler-proxy:jar:4.1.34.Final:runtime
[INFO] | | | \- io.netty:netty-codec-socks:jar:4.1.34.Final:runtime
[INFO] | | +- com.google.guava:guava:jar:32.0.1-android:compile
[INFO] | | | +- com.google.guava:failureaccess:jar:1.0.1:compile
[INFO] | | | +- com.google.guava:listenablefuture:jar:9999.0-empty-to-avoid-conflict-with-guava:compile
[INFO] | | | +- org.checkerframework:checker-qual:jar:3.33.0:compile
[INFO] | | | \- com.google.j2objc:j2objc-annotations:jar:2.8:compile
[INFO] | | +- com.google.errorprone:error_prone_annotations:jar:2.20.0:compile
[INFO] | | +- io.perfmark:perfmark-api:jar:0.26.0:runtime
[INFO] | | \- io.netty:netty-transport-native-unix-common:jar:4.1.34.Final:runtime
[INFO] | +- io.grpc:grpc-protobuf:jar:1.59.1:compile
[INFO] | | +- io.grpc:grpc-api:jar:1.59.1:compile
[INFO] | | +- com.google.code.findbugs:jsr305:jar:3.0.2:compile
[INFO] | | +- com.google.api.grpc:proto-google-common-protos:jar:2.22.0:compile
[INFO] | | \- io.grpc:grpc-protobuf-lite:jar:1.59.1:compile
[INFO] | +- io.grpc:grpc-stub:jar:1.59.1:compile
[INFO] | +- com.google.protobuf:protobuf-java:jar:3.24.0:compile
[INFO] | +- org.apache.commons:commons-text:jar:1.10.0:compile
[INFO] | | \- org.apache.commons:commons-lang3:jar:3.8.1:compile
[INFO] | +- org.apache.commons:commons-collections4:jar:4.3:compile
[INFO] | +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.8:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] | | \- com.fasterxml.jackson.core:jackson-core:jar:2.9.8:compile
[INFO] | +- org.slf4j:slf4j-api:jar:1.7.26:compile
[INFO] | +- org.apache.logging.log4j:log4j-slf4j-impl:jar:2.11.2:compile
[INFO] | | +- org.apache.logging.log4j:log4j-api:jar:2.11.2:compile
[INFO] | | \- org.apache.logging.log4j:log4j-core:jar:2.11.2:runtime
[INFO] | +- com.squareup.okhttp3:okhttp:jar:4.10.0:compile
[INFO] | | \- com.squareup.okio:okio-jvm:jar:3.0.0:compile
[INFO] | | \- org.jetbrains.kotlin:kotlin-stdlib-jdk8:jar:1.2.71:compile
[INFO] | | \- org.jetbrains.kotlin:kotlin-stdlib-jdk7:jar:1.2.71:compile
[INFO] | +- org.codehaus.plexus:plexus-utils:jar:3.0.24:compile
[INFO] | +- com.google.code.gson:gson:jar:2.8.5:compile
[INFO] | +- org.jetbrains.kotlin:kotlin-stdlib:jar:1.2.71:compile
[INFO] | | +- org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.2.71:compile
[INFO] | | \- org.jetbrains:annotations:jar:13.0:compile
[INFO] | \- com.alibaba:fastjson:jar:1.2.83:compile
[INFO] \- io.netty:netty-buffer:jar:4.1.97.Final:compile
[INFO] \- io.netty:netty-common:jar:4.1.34.Final:compile
dependency looks good. no idea about what is going on about your environment. Maybe try mvn clean see to clean all dependencies and see if it helps
Thanks a lot your support. I did the "mvn clean" of command after every pom.xml file change. I'm not sure whether this error is relate to JDK11.
This is what I got from chatgpt and hopefully it will help
The error you're encountering, java.lang.NoClassDefFoundError: io.netty.util.internal.ReferenceCountUpdater, followed by a java.lang.ClassNotFoundException, suggests that the Java runtime environment cannot find the ReferenceCountUpdater class from the Netty library. This issue often occurs due to classpath problems where the required library (or the correct version of it) is not found during runtime. Here's how you can address it:
Ensure Netty Library is Included: Make sure that the Netty library, which contains the io.netty.util.internal.ReferenceCountUpdater class, is included in your project dependencies. If you're using a build tool like Maven or Gradle, ensure that you have the correct Netty dependency specified in your pom.xml or build.gradle file, respectively.
Check for Version Compatibility: The error stack trace indicates multiple Netty components (netty-buffer, netty-codec-http2, and others) along with grpc-netty are being used. It's crucial to ensure that all these components are compatible with each other. Version mismatches between these libraries can lead to NoClassDefFoundError or ClassNotFoundException. Verify that you're using versions of these libraries that are known to work well together.
Update Dependencies: If you're using an older version of the Netty library, consider updating to a more recent version that might have fixed the issue you're experiencing. However, ensure that the update is compatible with other libraries you're using.
Review Classpath Configuration: The error might be due to the runtime environment not being able to access the Netty library, even if it's correctly included in your project dependencies. Ensure that the classpath is correctly set up, especially if you're running your application from the command line or a custom environment. If you're using an IDE, make sure the dependency is correctly configured and recognized by the IDE.
Clean and Rebuild: Sometimes, stale artifacts in the build directory can cause unexpected issues. Clean your project's build directory and rebuild the project. For Maven, you can use mvn clean install, and for Gradle, gradle clean build.
Examine Dependency Conflicts: If your project includes other libraries that also depend on Netty, there could be conflicting versions. Use your build tool's dependency tree analysis feature to examine and resolve any conflicts. For Maven, mvn dependency:tree can help identify conflicts, and for Gradle, you can use gradle dependencies.
Implementing these steps should help resolve the NoClassDefFoundError and ClassNotFoundException related to the Netty library. If the problem persists, consider looking into more detailed logs or debugging information to identify the root cause more precisely.
这个版本太低了,我使用跟你一模一样的pom文件,只是把这个版本改成3.2.0就没问题 据我测下来,3.0版本以上都没问题,3.0以下都有问题。
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.4.RELEASE</version>
是的,我也验证了,springboot3.0以下的包与milvus-sdk-java是有冲突的。我升级后没有问题,谢谢 @yhmo @xiaofan-luan
问题解决,关闭问题。
<dependencyManagement>
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-buffer</artifactId>
<version>4.1.58.Final</version>
</dependency>
</dependencyManagement>
PS: 我是JDK8 + SpringBoot 2.1.8 + milvus 2.3.2
我用Attu可以连接到Milvus,创建了Collection,叫car。但使用springboot + milvus-sdk-java来连接milvus使用出错。 测试代码如下:
pom.xml
错误日志如下: