sofastack-guides / sofa-ark-spring-guides

sofa-ark-spring-guides
15 stars 19 forks source link

执行biz -i失败 #6

Closed zondacker closed 1 year ago

zondacker commented 2 years ago
  1. 示例项目spring-boot-ark-biz使用Java 11执行mvn clean package -Dmaven.test.skip=true报错: [ERROR] Failed to execute goal com.alipay.sofa:sofa-ark-maven-plugin:2.0.0:repackage (default-cli) on project spring-boot-ark-biz: Execution default-cli of goal com.alipay.sofa:sofa-ark-maven-plugin:2.0.0:repackage failed.: IllegalArgumentException -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.alipay.sofa:sofa-ark-maven-plugin:2.0.0:repackage (default-cli) on project spring-boot-ark-biz: Execution default-cli of goal com.alipay.sofa:sofa-ark-maven-plugin:2.0.0:repackage failed. at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal com.alipay.sofa:sofa-ark-maven-plugin:2.0.0:repackage failed. at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.lang.IllegalArgumentException at org.objectweb.asm.ClassReader. (Unknown Source) at org.objectweb.asm.ClassReader. (Unknown Source) at org.objectweb.asm.ClassReader. (Unknown Source) at com.alipay.sofa.ark.tools.MainClassFinder.createClassDescriptor (MainClassFinder.java:119) at com.alipay.sofa.ark.tools.MainClassFinder.doWithMainClasses (MainClassFinder.java:78) at com.alipay.sofa.ark.tools.MainClassFinder.findSingleMainClass (MainClassFinder.java:58) at com.alipay.sofa.ark.tools.Repackager.findMainMethod (Repackager.java:481) at com.alipay.sofa.ark.tools.Repackager.findMainMethodWithTimeoutWarning (Repackager.java:469) at com.alipay.sofa.ark.tools.Repackager.buildModuleManifest (Repackager.java:409) at com.alipay.sofa.ark.tools.Repackager.repackageModule (Repackager.java:256) at com.alipay.sofa.ark.tools.Repackager.repackage (Repackager.java:245) at com.alipay.sofa.ark.boot.mojo.RepackageMojo.repackage (RepackageMojo.java:282) at com.alipay.sofa.ark.boot.mojo.RepackageMojo.execute (RepackageMojo.java:270) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156) at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:957) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:289) at org.apache.maven.cli.MavenCli.main (MavenCli.java:193) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:566) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
  2. 将示例项目spring-boot-ark-biz换成Java 1.8后执行mvn clean package -Dmaven.test.skip=true通过,但在执行biz -i时master biz日志报错: . _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.5.0)

2022-05-18 16:40:16.469 INFO 37661 --- [et-command-1-T1] c.a.s.s.SpringBootArkBizApplication : Starting SpringBootArkBizApplication using Java 1.8.0_321 on zhujunli with PID 37661 (/var/folders/ch/df9x3c_s1hs7zryqphs768k80000gn/T/sofa-ark/null-null-20220518164016051-unpack started by zhujunli in /Users/zhujunli/Documents/GitWorkSpaceOpenSource/sofa-ark-spring-guides) 2022-05-18 16:40:16.471 INFO 37661 --- [et-command-1-T1] c.a.s.s.SpringBootArkBizApplication : No active profile set, falling back to default profiles: default 2022-05-18 16:40:16.850 WARN 37661 --- [et-command-1-T1] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to register LiveBeansView MBean; nested exception is javax.management.InstanceAlreadyExistsException: DefaultDomain:application= 2022-05-18 16:40:16.854 INFO 37661 --- [et-command-1-T1] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-05-18 16:40:16.876 ERROR 37661 --- [et-command-1-T1] o.s.boot.SpringApplication : Application run failed

org.springframework.context.ApplicationContextException: Failed to register LiveBeansView MBean; nested exception is javax.management.InstanceAlreadyExistsException: DefaultDomain:application= at org.springframework.context.support.LiveBeansView.registerApplicationContext(LiveBeansView.java:83) ~[spring-context-5.3.7.jar:5.3.7] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:942) ~[spring-context-5.3.7.jar:5.3.7] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:586) ~[spring-context-5.3.7.jar:5.3.7] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.5.0.jar:2.5.0] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:438) ~[spring-boot-2.5.0.jar:2.5.0] at org.springframework.boot.SpringApplication.run(SpringApplication.java:337) ~[spring-boot-2.5.0.jar:2.5.0] at com.alipay.sofa.springbootarkbiz.SpringBootArkBizApplication.main(SpringBootArkBizApplication.java:16) [null-null-20220518164016051-unpack/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_321] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_321] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_321] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_321] at com.alipay.sofa.ark.bootstrap.MainMethodRunner.run(MainMethodRunner.java:48) [sofa-ark-archive-2.0.0.jar!/:na] at com.alipay.sofa.ark.container.model.BizModel.start(BizModel.java:277) [sofa-ark-container-2.0.0.jar!/:na] at com.alipay.sofa.ark.api.ArkClient.installBiz(ArkClient.java:172) [sofa-ark-api-2.0.0.jar:na] at com.alipay.sofa.ark.api.ArkClient.installOperation(ArkClient.java:348) [sofa-ark-api-2.0.0.jar:na] at com.alipay.sofa.ark.api.ArkClient.installOperation(ArkClient.java:333) [sofa-ark-api-2.0.0.jar:na] at com.alipay.sofa.ark.container.service.biz.BizCommandProvider$BizCommand$1.run(BizCommandProvider.java:249) [sofa-ark-container-2.0.0.jar!/:na] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_321] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_321] at java.lang.Thread.run(Thread.java:750) [na:1.8.0_321] Caused by: javax.management.InstanceAlreadyExistsException: DefaultDomain:application= at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437) ~[na:1.8.0_321] at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898) ~[na:1.8.0_321] at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966) ~[na:1.8.0_321] at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900) ~[na:1.8.0_321] at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324) ~[na:1.8.0_321] at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522) ~[na:1.8.0_321] at org.springframework.context.support.LiveBeansView.registerApplicationContext(LiveBeansView.java:79) ~[spring-context-5.3.7.jar:5.3.7] ... 19 common frames omitted

glmapper commented 2 years ago

@zondacker 目前还不支持 1.8+ 以上的 jdk ;第二个问题看起来是 JMX 配置问题,应该和 ark 关系不大,FYI https://stackoverflow.com/questions/63069433/spring-boot-how-to-configure-jmx-default-domain

lylingzhen commented 2 years ago

JDK11 的支持正在开发,目前计划是 5 月份 Release。

glmapper commented 2 years ago

JDK11 的支持正在开发,目前计划是 5 月份 Release。

需要将 sofa-ark 的 roadmap 对社区开放,给出迭代计划;也要同步社区 commiter 进行沟通和讨论

lylingzhen commented 2 years ago

@glmapper 等时间明确了,我们再对外同步一下。

gaosaroma commented 2 years ago

@zondacker 你好,第二个问题可以在运行Springboot Application时,修改Spring Boot配置,取消勾选Enable JMX agent。

lvjing2 commented 1 year ago

时间过久,暂时关闭,有需要可以再开启