3.9K Star 18.4K Fork 5.3K

卓源软件 / JeeSite 4.x and 5.x

 / 详情

jeeSite4-clould打包微服务之后启动失败

已完成
创建于  
2021-09-10 09:01

该问题是怎么引起的?

我从git仓库拉取了代码,修改了nacos的数据库地址,添加了nacos配置,本地启动所有项目都可以正常运行,但是我将所有微服务打成war包之后在本地使用java -jar web.war的方式启动结果nacos都启动失败,其他包也是,如果我再idea中本地启动nacos,然后用war包启动croe微服务也是失败的,是我的启动方式有问题吗,我做其他项目就是直接使用java -jar的方式启动的都是没问题的,期待您的解答,谢谢。

重现步骤

报错信息

2021-09-10 09:01:49.866  INFO 16368 --- [           main] c.a.n.c.l.StartingApplicationListener    : Nacos started successfully in stand alone mode. use external storage

         ,--.
       ,--.'|
   ,--,:  : |                                           Nacos 4.3.0-SNAPSHOT
,`--.'`|  ' :                       ,---.               Running in stand alone mode, All function modules
|   :  :  | |                      '   ,'\   .--.--.    Port: 8848
:   |   \ | :  ,--.--.     ,---.  /   /   | /  /    '   Pid: 16368
|   : '  '; | /       \   /     \.   ; ,. :|  :  /`./   Console: http://10.69.55.127:8848/nacos/index.html
'   ' ;.    ;.--.  .-. | /    / ''   | |: :|  :  ;_
|   | | \   | \__\/: . ..    ' / '   | .; : \  \    `.      https://nacos.io
'   : |  ; .' ," .--.; |'   ; :__|   :    |  `----.   \
|   | '`--'  /  /  ,.  |'   | '.'|\   \  /  /  /`--'  /
'   : |     ;  :   .'   \   :    : `----'  '--'.     /
;   |.'     |  ,     .-./\   \  /            `--'---'
'---'        `--`---'     `----'

2021-09-10 09:02:01.188  INFO 16368 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=282ea38b-c079-3f12-985d-4f534ed4436e
2021-09-10 09:02:01.603  INFO 16368 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler@82ea68c' of type [org.springframework.security.access.expression.method.DefaultMethodSecurityExpressionHandler] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-09-10 09:02:01.607  INFO 16368 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'methodSecurityMetadataSource' of type [org.springframework.security.access.method.DelegatingMethodSecurityMetadataSource] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2021-09-10 09:02:02.239  INFO 16368 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8848 (http)
2021-09-10 09:02:07.880  INFO 16368 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 16852 ms
2021-09-10 09:02:10.623  WARN 16368 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grpcClusterServer': Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Class com.alibaba.nacos.api.grpc.auto.Payload does not implement the requested interface com.google.protobuf.MessageLite
2021-09-10 09:02:10.650  INFO 16368 --- [           main] c.a.n.c.l.StartingApplicationListener    : Nacos Log files: C:\Users\admin\nacos\logs
2021-09-10 09:02:10.651  INFO 16368 --- [           main] c.a.n.c.l.StartingApplicationListener    : Nacos Log files: C:\Users\admin\nacos\conf
2021-09-10 09:02:10.651  INFO 16368 --- [           main] c.a.n.c.l.StartingApplicationListener    : Nacos Log files: C:\Users\admin\nacos\data
2021-09-10 09:02:10.653 ERROR 16368 --- [           main] c.a.n.c.l.StartingApplicationListener    : Startup errors :

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grpcClusterServer': Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Class com.alibaba.nacos.api.grpc.auto.Payload does not implement the requested interface com.google.protobuf.MessageLite
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:144)
        at com.jeesite.modules.NacosApplication.main(NacosApplication.java:32)
        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.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)
Caused by: java.lang.IncompatibleClassChangeError: Class com.alibaba.nacos.api.grpc.auto.Payload does not implement the requested interface com.google.protobuf.MessageLite
        at io.grpc.protobuf.lite.ProtoLiteUtils$MessageMarshaller.<init>(ProtoLiteUtils.java:128)
        at io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(ProtoLiteUtils.java:84)
        at io.grpc.protobuf.ProtoUtils.marshaller(ProtoUtils.java:57)
        at com.alibaba.nacos.core.remote.grpc.BaseGrpcServer.addServices(BaseGrpcServer.java:172)
        at com.alibaba.nacos.core.remote.grpc.BaseGrpcServer.startServer(BaseGrpcServer.java:110)
        at com.alibaba.nacos.core.remote.BaseRpcServer.start(BaseRpcServer.java:47)
        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.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)
        ... 25 common frames omitted

2021-09-10 09:02:12.289  WARN 16368 --- [           main] c.a.nacos.sys.file.WatchFileCenter       : [WatchFileCenter] start close
2021-09-10 09:02:12.289  WARN 16368 --- [           main] c.a.nacos.sys.file.WatchFileCenter       : [WatchFileCenter] start to shutdown this watcher which is watch : C:\Users\admin\nacos\data\loader
2021-09-10 09:02:12.290  WARN 16368 --- [           main] c.a.nacos.sys.file.WatchFileCenter       : [WatchFileCenter] start to shutdown this watcher which is watch : C:\Users\admin\nacos\conf
2021-09-10 09:02:12.290  WARN 16368 --- [           main] c.a.nacos.sys.file.WatchFileCenter       : [WatchFileCenter] start to shutdown this watcher which is watch : C:\Users\admin\nacos\data\tps
2021-09-10 09:02:12.291  WARN 16368 --- [           main] c.a.nacos.sys.file.WatchFileCenter       : [WatchFileCenter] already closed
2021-09-10 09:02:12.292  WARN 16368 --- [           main] c.a.nacos.common.notify.NotifyCenter     : [NotifyCenter] Start destroying Publisher
2021-09-10 09:02:12.292  WARN 16368 --- [           main] c.a.nacos.common.notify.NotifyCenter     : [NotifyCenter] Destruction of the end
2021-09-10 09:02:12.292 ERROR 16368 --- [           main] c.a.n.c.l.StartingApplicationListener    : Nacos failed to start, please see C:\Users\admin\nacos\logs\nacos.log for more details.
2021-09-10 09:02:12.301  INFO 16368 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-09-10 09:02:12.364 ERROR 16368 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grpcClusterServer': Invocation of init method failed; nested exception is java.lang.IncompatibleClassChangeError: Class com.alibaba.nacos.api.grpc.auto.Payload does not implement the requested interface com.google.protobuf.MessageLite
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:160)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:338)
        at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:144)
        at com.jeesite.modules.NacosApplication.main(NacosApplication.java:32)
        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.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
        at org.springframework.boot.loader.WarLauncher.main(WarLauncher.java:59)
Caused by: java.lang.IncompatibleClassChangeError: Class com.alibaba.nacos.api.grpc.auto.Payload does not implement the requested interface com.google.protobuf.MessageLite
        at io.grpc.protobuf.lite.ProtoLiteUtils$MessageMarshaller.<init>(ProtoLiteUtils.java:128)
        at io.grpc.protobuf.lite.ProtoLiteUtils.marshaller(ProtoLiteUtils.java:84)
        at io.grpc.protobuf.ProtoUtils.marshaller(ProtoUtils.java:57)
        at com.alibaba.nacos.core.remote.grpc.BaseGrpcServer.addServices(BaseGrpcServer.java:172)
        at com.alibaba.nacos.core.remote.grpc.BaseGrpcServer.startServer(BaseGrpcServer.java:110)
        at com.alibaba.nacos.core.remote.BaseRpcServer.start(BaseRpcServer.java:47)
        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.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:389)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:333)
        at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:157)
        ... 25 common frames omitted

评论 (3)

lxjpirate 创建了任务
lxjpirate 关联仓库设置为卓源软件/JeeSite 4.3
lxjpirate 修改了描述
lxjpirate 修改了描述
lxjpirate 修改了描述
展开全部操作日志

1、看 IncompatibleClassChangeError 这个错误应该是 jar 包有冲突,看你打包好的 protobuf-java 是不是 3.8.0;nacos-api 是不是 2.0.3

2、建议解压运行 war 包里的 package.bat,如果 java -jar web.war 可能会有性能影响

我看了,打的包protobuf-java 是 3.8.0;nacos-api 也是 2.0.3

卓源软件 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
6732 thinkgem 1651893329 Violation
Java
1
https://gitee.com/thinkgem/jeesite4.git
git@gitee.com:thinkgem/jeesite4.git
thinkgem
jeesite4
JeeSite 4.x and 5.x

搜索帮助