spring-boot - Spring Boot 应用程序无法加入服务器上的 Coherence 集群:加入请求被中止
问题描述
在另一个具有经典 Spring XML 配置的示例应用程序之后,我使用 Spring Boot 开发了一个小型 REST API 应用程序。它从设置了 Coherence 缓存的库中导入上下文。
当我在本地开发它时,使用 Intellij Idea runner 运行 Spring Boot 应用程序,没有任何问题,应用程序运行良好,并且端点可以连接到该缓存。
当我将应用程序部署到 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>
这些属性似乎不是从应用程序属性应用的,因为启动一致性集群在系统级别上工作和/或在属性初始化之前启动。或者这些属性对于连贯性来说是不可见的。
推荐阅读
- javascript - 从表中计算总和
- python - 从给定目录中删除损坏的 xlsx 文件
- android - 尝试使用手势处理程序运行裸 React Native 应用程序时出错
- process - Threading.Task.Run 提交两次但仅在某些调用上
- java - 错误:无法初始化主类 test.HelloLucene - 原因:java.lang.NoClassDefFoundError: org/apache/lucene/analysis/Analyzer
- java - Android 自定义异常处理
- google-cloud-platform - Google Cloud PubSub 禁用重试或设置最小值
- selenium - Salesforce 文档中偶尔不会生成模板
- python - 连接超时 - Apache2 和 Django 部署
- python - 使用 statsmodel 的 pandas 时间序列中单个比例的 95% 置信区间