sofastack / sofa-ark

SOFAArk is a light-weight,java based classloader isolation framework.
https://www.sofastack.tech/projects/sofa-boot/sofa-ark-readme/
Apache License 2.0
1.57k stars 500 forks source link

Ark install failed cause of NoClassDefFoundError #216

Closed Aliece closed 5 years ago

Aliece commented 5 years ago

Describe the bug

A clear and concise description of what the bug is.

Expected behavior

Actual behavior

Steps to reproduce

Minimal yet complete reproducer code (or GitHub URL to code)

Environment

在ark biz包install的时候偶有出现failed的情况,但是重试多次之后又能够正常install,failed的原因都是 java.lang.NoClassDefFoundError 如下:

2019-03-21 19:35:37,044 ERROR common-thread-6 - Install Biz: demo:1.0.1.12 fail. java.lang.reflect.InvocationTargetException: null at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.alipay.sofa.ark.bootstrap.MainMethodRunner.run(MainMethodRunner.java:48) at com.alipay.sofa.ark.container.model.BizModel.start(BizModel.java:207) at com.alipay.sofa.ark.api.ArkClient.installBiz(ArkClient.java:135) at com.demo.modules.command.base.CommandCreator.sendCommand(CommandCreator.java:61) at com.demo.web.controller.module.ModuleStatusController.lambda$check$0(ModuleStatusController.java:51) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.NoClassDefFoundError: org/springframework/context/support/LiveBeansView at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:987) at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:958) at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:750) at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) at com.demo.WebApplication.main(WebApplication.java:29) ... 12 common frames omitted Caused by: com.alipay.sofa.ark.exception.ArkLoaderException: [ArkBiz Loader] demo:1.0.1.12 : can not load class: org.springframework.context.support.LiveBeansView at com.alipay.sofa.ark.container.service.classloader.BizClassLoader.loadClassInternal(BizClassLoader.java:113) at com.alipay.sofa.ark.container.service.classloader.AbstractClasspathClassLoader.loadClass(AbstractClasspathClassLoader.java:66) at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

AsyncLogger error handling event seq=2, value='Logger=org.springframework.boot.SpringApplication Level=ERROR Message=Application startup failed': java.lang.NoClassDefFoundError: org/apache/logging/log4j/core/impl/ThrowableProxy at org.apache.logging.log4j.core.impl.Log4jLogEvent.getThrownProxy(Log4jLogEvent.java:555) at org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter.format(ExtendedThrowablePatternConverter.java:61) at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:38) at org.apache.logging.log4j.core.layout.PatternLayout$PatternSerializer.toSerializable(PatternLayout.java:294) at org.apache.logging.log4j.core.layout.PatternLayout.toText(PatternLayout.java:195) at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:180) at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:57) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:176) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:169) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:160) at org.apache.logging.log4j.core.appender.RollingFileAppender.append(RollingFileAppender.java:281) at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156) at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129) at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120) at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84) at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:447) at org.apache.logging.log4j.core.async.AsyncLoggerConfig.asyncCallAppenders(AsyncLoggerConfig.java:114) at org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigDisruptor.java:112) at org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigDisruptor.java:98) at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:129) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: com.alipay.sofa.ark.exception.ArkLoaderException: [ArkBiz Loader] demo:1.0.1.12 : can not load class: org.apache.logging.log4j.core.impl.ThrowableProxy at com.alipay.sofa.ark.container.service.classloader.BizClassLoader.loadClassInternal(BizClassLoader.java:113) at com.alipay.sofa.ark.container.service.classloader.AbstractClasspathClassLoader.loadClass(AbstractClasspathClassLoader.java:66) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 23 more

但是spring或者其它包都是没有冲突的,

QilongZhang commented 5 years ago

如果方便,提供下复现的demo.

glmapper commented 5 years ago

@Aliece Since there is no feedback for a long time, close the issue first, if there is any doubt, you can open it.