Spring 启动应用程序无法加入服务器上的 Coherence 集群:加入请求已中止

Spring Boot application cannot join Coherence cluster on server: Join request was aborted

我开发了一个小型 REST API 应用程序 Spring 在另一个具有经典 Spring XML 配置的示例应用程序启动之后。它从设置了 Coherence 缓存的库中导入上下文。

当我在本地开发时,运行 Spring 使用 Intellij Idea runner 启动应用程序,没有任何问题,应用程序运行良好,端点可以连接到该缓存。

当我将应用程序部署到 Unix 服务器时,在应用程序启动期间出现以下错误:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'coreSearchSync' defined in class path resource [core-search-core-context.xml]: Cannot resolve reference to bean 'corePersistenceManager' while setting bean property 'corePersistenceManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'corePersistenceManager': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ' coreSearchResultCache' defined in class path resource [core-search-coherence-context.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.tangosol.net.NamedCache]: Factory method 'getCache' threw exception; nested exception is (Wrapped: Failed to start Service "Management" (ServiceState=SERVICE_STOPPED)) java.lang.RuntimeException: Join request was aborted

服务器上的应用程序正在使用 application.properties,但它们与本地 application.yaml 中的相同。

我不知道从哪里继续调查...

问题已通过将 JVM 参数传递给脚本以启动应用程序解决:

-Dtangosol.coherence.clusterport=<port> -Dtangosol.coherence.site=<site> -Dtangosol.coherence.clusteraddress=<cluster_ip_ddress> -Dtangosol.coherence.cluster=<cluster_name>

这些属性似乎没有从应用程序属性中应用,因为在系统级别启动 coherence 集群 and/or 在属性初始化之前启动。或者那些属性对于连贯性是不可见的。