Open
jinkunaier
opened this issue 3 years ago
•
10 comments
官方示例https://github.com/sofastack-guides/sofa-boot-guides 目前使用的sofaboot版本为3.2.0打包、运行都没有问题,但是升级到任何一个高版本后多少都有些问题,比如升级到3.2.1构建sofaboot-sample-with-isolation项目,打包没有问题,运行时候报错:
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.alipay.sofa.ark.bootstrap.MainMethodRunner.run(MainMethodRunner.java:48)
at com.alipay.sofa.ark.bootstrap.AbstractLauncher.launch(AbstractLauncher.java:97)
at com.alipay.sofa.ark.bootstrap.AbstractLauncher.launch(AbstractLauncher.java:49)
at com.alipay.sofa.ark.bootstrap.ArkLauncher.main(ArkLauncher.java:35)
Caused by: com.alipay.sofa.ark.exception.ArkRuntimeException: com.alipay.sofa.ark.exception.ArkRuntimeException: java.lang.reflect.InvocationTargetException
at com.alipay.sofa.ark.container.pipeline.StandardPipeline.process(StandardPipeline.java:81)
at com.alipay.sofa.ark.container.ArkContainer.start(ArkContainer.java:143)
at com.alipay.sofa.ark.container.ArkContainer.main(ArkContainer.java:99)
... 8 more
Caused by: com.alipay.sofa.ark.exception.ArkRuntimeException: java.lang.reflect.InvocationTargetException
at com.alipay.sofa.ark.container.service.biz.DefaultBizDeployer.deploy(DefaultBizDeployer.java:56)
at com.alipay.sofa.ark.container.service.biz.BizDeployServiceImpl.deploy(BizDeployServiceImpl.java:55)
at com.alipay.sofa.ark.container.pipeline.DeployBizStage.process(DeployBizStage.java:46)
at com.alipay.sofa.ark.container.pipeline.StandardPipeline.process(StandardPipeline.java:75)
... 10 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.alipay.sofa.ark.bootstrap.MainMethodRunner.run(MainMethodRunner.java:48)
at com.alipay.sofa.ark.container.model.BizModel.start(BizModel.java:228)
at com.alipay.sofa.ark.container.service.biz.DefaultBizDeployer.deploy(DefaultBizDeployer.java:52)
... 13 more
Caused by: java.lang.IllegalStateException: java.lang.IllegalStateException: Unable to determine code source archive from file:\E:\sofa-demo\sofaboot-sample-with-isolation-0.0.1-SNAPSHOT-executable-ark.jar!\SOFA-ARK\biz\sofaboot-sample-with-isolation-0.0.1-SNAPSHOT-ark-biz.jar!
at org.springframework.boot.loader.ExecutableArchiveLauncher.(ExecutableArchiveLauncher.java:41)
at org.springframework.boot.loader.JarLauncher.(JarLauncher.java:35)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
... 20 more
Caused by: java.lang.IllegalStateException: Unable to determine code source archive from file:\E:\sofa-demo\sofaboot-sample-with-isolation-0.0.1-SNAPSHOT-executable-ark.jar!\SOFA-ARK\biz\sofaboot-sample-with-isolation-0.0.1-SNAPSHOT-ark-biz.jar!
at org.springframework.boot.loader.Launcher.createArchive(Launcher.java:126)
at org.springframework.boot.loader.ExecutableArchiveLauncher.(ExecutableArchiveLauncher.java:38)
... 22 more
19:12:29.482 [SOFA-ARK-telnet-server-worker-0-T1] INFO io.netty.handler.logging.LoggingHandler - [id: 0xc0481dc8, L:/0:0:0:0:0:0:0:0:1234] CLOSE
后来把父项目中的
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
换成
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
可以成功了,启动也没有问题,再换成最新版本的3.4.4后构建没问题,启动报错:
2020-09-14 21:07:55.403 INFO 16896 --- [ main] .i.SofaBootClassIsolationDemoApplication : Starting SofaBootClassIsolationDemoApplication v0.0.1 on jack-PC with PID 16896 (E:\sofa-demo\sofaboot-sample-with-isolation-0.0.1-executable-ark.jar started by jack in E:\sofa-demo)
2020-09-14 21:07:55.410 INFO 16896 --- [ main] .i.SofaBootClassIsolationDemoApplication : No active profile set, falling back to default profiles: default
2020-09-14 21:08:02.846 INFO 16896 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2020-09-14 21:08:02.958 INFO 16896 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-09-14 21:08:02.959 INFO 16896 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.31]
2020-09-14 21:08:03.279 INFO 16896 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-09-14 21:08:03.281 INFO 16896 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 7608 ms
Sofa-Middleware-Log:WARN No log util is usable, Default app logger will be used.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Sofa-Middleware-Log:ERROR Build ILoggerFactory error! Default app logger will be used.
java.lang.NoClassDefFoundError: ch/qos/logback/core/joran/spi/JoranException
at com.alipay.sofa.common.log.factory.LoggerSpaceFactory4LogbackBuilder.doBuild(LoggerSpaceFactory4LogbackBuilder.java:37)
at com.alipay.sofa.common.log.factory.AbstractLoggerSpaceFactoryBuilder.build(AbstractLoggerSpaceFactoryBuilder.java:69)
at com.alipay.sofa.common.log.MultiAppLoggerSpaceManager.createILoggerFactory(MultiAppLoggerSpaceManager.java:303)
at com.alipay.sofa.common.log.MultiAppLoggerSpaceManager.getILoggerFactoryBySpaceName(MultiAppLoggerSpaceManager.java:226)
at com.alipay.sofa.common.log.MultiAppLoggerSpaceManager.getLoggerBySpace(MultiAppLoggerSpaceManager.java:176)
at com.alipay.sofa.common.log.LoggerSpaceManager.getLoggerBySpace(LoggerSpaceManager.java:87)
at com.alipay.sofa.common.log.LoggerSpaceManager.getLoggerBySpace(LoggerSpaceManager.java:70)
at com.alipay.sofa.common.log.LoggerSpaceManager.getLoggerBySpace(LoggerSpaceManager.java:44)
at com.alipay.remoting.log.BoltLoggerFactory.getLogger(BoltLoggerFactory.java:86)
at com.alipay.remoting.AbstractRemotingServer.(AbstractRemotingServer.java:37)
at com.alipay.sofa.rpc.server.bolt.BoltServer.initRemotingServer(BoltServer.java:140)
at com.alipay.sofa.rpc.server.bolt.BoltServer.start(BoltServer.java:114)
at com.alipay.sofa.rpc.bootstrap.DefaultProviderBootstrap.doExport(DefaultProviderBootstrap.java:177)
at com.alipay.sofa.rpc.bootstrap.DefaultProviderBootstrap.export(DefaultProviderBootstrap.java:106)
at com.alipay.sofa.rpc.config.ProviderConfig.export(ProviderConfig.java:532)
at com.alipay.sofa.boot.examples.demo.service.PublishServiceImpl.publish(PublishServiceImpl.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1897)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1839)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1767)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:847)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:744)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:391)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
at com.alipay.sofa.boot.examples.demo.isolation.SofaBootClassIsolationDemoApplication.main(SofaBootClassIsolationDemoApplication.java:29)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.alipay.sofa.ark.bootstrap.MainMethodRunner.run(MainMethodRunner.java:48)
at com.alipay.sofa.ark.container.model.BizModel.start(BizModel.java:246)
at com.alipay.sofa.ark.container.service.biz.DefaultBizDeployer.deploy(DefaultBizDeployer.java:52)
at com.alipay.sofa.ark.container.service.biz.BizDeployServiceImpl.deploy(BizDeployServiceImpl.java:55)
at com.alipay.sofa.ark.container.pipeline.DeployBizStage.process(DeployBizStage.java:46)
at com.alipay.sofa.ark.container.pipeline.StandardPipeline.process(StandardPipeline.java:75)
at com.alipay.sofa.ark.container.ArkContainer.start(ArkContainer.java:143)
at com.alipay.sofa.ark.container.ArkContainer.main(ArkContainer.java:99)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.alipay.sofa.ark.bootstrap.MainMethodRunner.run(MainMethodRunner.java:48)
at com.alipay.sofa.ark.bootstrap.AbstractLauncher.launch(AbstractLauncher.java:97)
at com.alipay.sofa.ark.bootstrap.AbstractLauncher.launch(AbstractLauncher.java:49)
at com.alipay.sofa.ark.bootstrap.ArkLauncher.main(ArkLauncher.java:35)
Caused by: com.alipay.sofa.ark.exception.ArkLoaderException: [ArkPlugin Loader] rpc-sofa-boot-plugin : can not load class: ch.qos.logback.core.joran.spi.JoranException
at com.alipay.sofa.ark.container.service.classloader.PluginClassLoader.loadClassInternal(PluginClassLoader.java:122)
at com.alipay.sofa.ark.container.service.classloader.AbstractClasspathClassLoader.loadClass(AbstractClasspathClassLoader.java:71)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 59 more
2020-09-14 21:08:13.139 INFO 16896 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-09-14 21:08:15.195 INFO 16896 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 4 endpoint(s) beneath base path '/actuator'
2020-09-14 21:08:15.816 INFO 16896 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2020-09-14 21:08:15.827 INFO 16896 --- [ main] .i.SofaBootClassIsolationDemoApplication : Started SofaBootClassIsolationDemoApplication in 22.613 seconds (JVM running for 28.704)
Ark container started in 28143 ms.