Nepxion / Discovery

☀️ Nepxion Discovery is a solution for Spring Cloud with blue green, gray, route, limitation, circuit breaker, degrade, isolation, tracing, dye, failover, active 蓝绿灰度发布、路由、限流、熔断、降级、隔离、追踪、流量染色、故障转移、多活
http://www.nepxion.com
Apache License 2.0
5.65k stars 1.43k forks source link

This is very likely to create a memory leak sun.misc.Unsafe.park(Native Method) #65

Closed fullee closed 5 years ago

fullee commented 5 years ago
  1. springcloud版本: Greenwich.RELEASE

  2. discovery-plugin 5.1.0

        <dependency>
            <groupId>com.nepxion</groupId>
            <artifactId>discovery-plugin-starter-nacos</artifactId>
            <version>${discovery.version}</version>
        </dependency>
    
        <dependency>
            <groupId>com.nepxion</groupId>
            <artifactId>discovery-plugin-config-center-starter-nacos</artifactId>
            <version>${discovery.version}</version>
        </dependency>
  3. 配置:

    spring:
    application:
    name: xxxx
    cloud:
    nacos:
      config:
        server-addr: hoXXXXXrver:8848
        file-extension: yaml
        namespace: 38676d55XXXXXXXXX81-fe2e150b7606
      discovery:
        namespace: 38676d55XXXXXXXXXXXXXXX606

报错:

2019-06-10 14:33:32.134 ERROR [user-service,,,] 14188 --- [           main] o.s.b.web.embedded.tomcat.TomcatStarter  : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'serviceRegistryEndpoint' defined in class path resource [org/springframework/cloud/client/serviceregistry/ServiceRegistryAutoConfiguration$ServiceRegistryEndpointConfiguration.class]: Unsatisfied dependency expressed through method 'serviceRegistryEndpoint' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'nacosServiceRegistry' defined in class path resource [org/springframework/cloud/alibaba/nacos/NacosDiscoveryAutoConfiguration.class]: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.cloud.alibaba.nacos.registry.NacosServiceRegistry.<init>(Lorg/springframework/cloud/alibaba/nacos/NacosDiscoveryProperties;)V
2019-06-10 14:33:32.164  INFO [user-service,,,] 14188 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2019-06-10 14:33:32.168  WARN [user-service,,,] 14188 --- [           main] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [AsyncReporter{org.springframework.cloud.sleuth.zipkin2.sender.RestTemplateSender@65fc8edc}] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
 zipkin2.reporter.ByteBoundedQueue.drainTo(ByteBoundedQueue.java:81)
 zipkin2.reporter.AsyncReporter$BoundedAsyncReporter.flush(AsyncReporter.java:257)
 zipkin2.reporter.AsyncReporter$Builder$1.run(AsyncReporter.java:190)
2019-06-10 14:33:32.169  WARN [user-service,,,] 14188 --- [           main] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [spring.cloud.inetutils] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
 java.lang.Thread.run(Thread.java:748)
2019-06-10 14:33:32.170  WARN [user-service,,,] 14188 --- [           main] o.a.c.loader.WebappClassLoaderBase       : The web application [ROOT] appears to have started a thread named [lettuce-eventExecutorLoop-1-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
 java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.java:467)
 io.netty.util.concurrent.SingleThreadEventExecutor.takeTask(SingleThreadEventExecutor.java:251)
 io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:64)
 io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897)
 io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
 java.lang.Thread.run(Thread.java:748)
2019-06-10 14:33:32.172  WARN [user-service,,,] 14188 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2019-06-10 14:33:33.189  WARN [user-service,,,] 14188 --- [           main] z.r.AsyncReporter$BoundedAsyncReporter   : Timed out waiting for in-flight spans to send
2019-06-10 14:33:33.190  INFO [user-service,,,] 14188 --- [           main] c.n.eventbus.thread.ThreadPoolFactory    : Shutting down thread pool executor [java.util.concurrent.ThreadPoolExecutor@6de5ad56[Running, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]]...
2019-06-10 14:33:33.204  INFO [user-service,,,] 14188 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-06-10 14:33:33.215 ERROR [user-service,,,] 14188 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method org.springframework.cloud.alibaba.nacos.registry.NacosServiceRegistry.<init>(Lorg/springframework/cloud/alibaba/nacos/NacosDiscoveryProperties;)V but it does not exist. Its class, org.springframework.cloud.alibaba.nacos.registry.NacosServiceRegistry, is available from the following locations:

    jar:file:/E:/mvn_repo/org/springframework/cloud/spring-cloud-alibaba-nacos-discovery/0.2.1.RELEASE/spring-cloud-alibaba-nacos-discovery-0.2.1.RELEASE.jar!/org/springframework/cloud/alibaba/nacos/registry/NacosServiceRegistry.class

It was loaded from the following location:

    file:/E:/mvn_repo/org/springframework/cloud/spring-cloud-alibaba-nacos-discovery/0.2.1.RELEASE/spring-cloud-alibaba-nacos-discovery-0.2.1.RELEASE.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.cloud.alibaba.nacos.registry.NacosServiceRegistry
HaojunRen commented 5 years ago

G版对应的是0.9.0,不是0.2.1

fullee commented 5 years ago

感谢