启动报错:公共环境开启了元数据保护模式,本地开发环境需配置
错误处理 279
版本号:
镜像版本harbor.oinone.top/oinone/oinone-designer-full-v5.1:5.1.6
错误信息:
协同开发时,启动容器服务报错
2024-09-05 11:10:27.039 ERROR 7660 --- [ main] o.s.boot.SpringApplication : Application run failed
java.lang.reflect.UndeclaredThrowableException: Failed to invoke event listener method
HandlerMethod details:
Bean [pro.shushi.pamirs.boot.common.initial.PamirsBootMainInitial]
Method [public void pro.shushi.pamirs.boot.common.initial.PamirsBootMainInitial.init(org.springframework.boot.context.event.ApplicationStartedEvent) throws java.lang.InterruptedException,java.util.concurrent.ExecutionException]
Resolved arguments:
[0] [type=org.springframework.boot.context.event.ApplicationStartedEvent] [value=org.springframework.boot.context.event.ApplicationStartedEvent[source=org.springframework.boot.SpringApplication@52f030b1]]
at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:322) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:190) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:153) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.started(EventPublishingRunListener.java:102) ~[spring-boot-2.3.8.RELEASE.jar:2.3.8.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.started(SpringApplicationRunListeners.java:71) ~[spring-boot-2.3.8.RELEASE.jar:2.3.8.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:321) ~[spring-boot-2.3.8.RELEASE.jar:2.3.8.RELEASE]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140) [spring-boot-2.3.8.RELEASE.jar:2.3.8.RELEASE]
at com.akdsj.manage.boot.AkdsjManageApplication.main(AkdsjManageApplication.java:56) [classes/:na]
Caused by: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException: 公共环境开启了元数据保护模式,本地开发环境需配置 [pamirs.distribution.session.ownSign]
at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) ~[na:1.8.0_131]
at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895) ~[na:1.8.0_131]
at pro.shushi.pamirs.boot.common.initial.PamirsBootMainInitial.init(PamirsBootMainInitial.java:66) ~[pamirs-boot-api-5.1.5.jar:5.1.5]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:305) ~[spring-context-5.2.12.RELEASE.jar:5.2.12.RELEASE]
... 12 common frames omitted
Caused by: java.lang.UnsupportedOperationException: 公共环境开启了元数据保护模式,本地开发环境需配置 [pamirs.distribution.session.ownSign]
at pro.shushi.pamirs.boot.standard.service.MetadataProtectedChecker.unsupportedLocalOperation(MetadataProtectedChecker.java:72) ~[pamirs-boot-standard-5.1.5.jar:5.1.5]
at pro.shushi.pamirs.boot.standard.service.MetadataProtectedChecker.process(MetadataProtectedChecker.java:67) ~[pamirs-boot-standard-5.1.5.jar:5.1.5]
at pro.shushi.pamirs.boot.common.spi.api.boot.BootModuleLifecycleBeginApi.run(BootModuleLifecycleBeginApi.java:27) ~[pamirs-boot-api-5.1.5.jar:5.1.5]
at pro.shushi.pamirs.boot.common.process.PamirsBootMainProcessor.lambda$installOrLoad$3(PamirsBootMainProcessor.java:133) ~[pamirs-boot-api-5.1.5.jar:5.1.5]
at pro.shushi.pamirs.boot.standard.spi.StandardBootModuleLifecycleAround.run(StandardBootModuleLifecycleAround.java:23) ~[pamirs-boot-standard-5.1.5.jar:5.1.5]
at pro.shushi.pamirs.boot.common.process.PamirsBootMainProcessor.installOrLoad(PamirsBootMainProcessor.java:105) ~[pamirs-boot-api-5.1.5.jar:5.1.5]
at pro.shushi.pamirs.boot.common.initial.PamirsBootMainInitial.installOrLoad(PamirsBootMainInitial.java:119) ~[pamirs-boot-api-5.1.5.jar:5.1.5]
at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1626) ~[na:1.8.0_131]
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) ~[na:1.8.0_131]
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1618) ~[na:1.8.0_131]
at java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:289) ~[na:1.8.0_131]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java) ~[na:1.8.0_131]
at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056) ~[na:1.8.0_131]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692) ~[na:1.8.0_131]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157) ~[na:1.8.0_131]
你的期望:
启动成功
如何重现问题:
启动容器
-
已被采纳为最佳回答
启用元数据保护,只有配置相同启动参数的服务才允许对元数据进行更新
用于测试环境和设计器环境的参数
java -jar boot.jar -PmetaProtected=pamirs
用于本地环境的配置
- 使用命令配置ownSign
java -jar boot.jar --pamirs.distribution.session.ownSign=demo
- 使用yaml配置ownSign
pamirs:
distribution:
session:
allMetaRefresh: false # 启用元数据全量刷新(备用配置,如遇元数据错误或混乱,启用该配置可进行恢复,使用一次后关闭即可)
ownSign: demo # 协同开发元数据隔离标记,用于区分不同开发人员的本地环境,其他环境不允许使用
业务后端boot工程引入协同开发包
<dependency>
<groupId>pro.shushi.pamirs.distribution</groupId>
<artifactId>pamirs-distribution-session-cd</artifactId>
</dependency>
Oinone协同开发使用手册2个月前 - 使用命令配置ownSign