我在构建GeoServer docker镜像时遇到了MultipleBeansException问题,版本:2.23.x 错误信息如下:
22 Sep 11:23:50 WARN [support.XmlWebApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'geoServerLoader' defined in URL [jar:file:/opt/apache-tomcat-9.0.75/webapps/geoserver/WEB-INF/lib/gs-main-2.23-SNAPSHOT.jar!/applicationContext.xml]: Initialization of bean failed; nested exception is org.geoserver.platform.GeoServerExtensions$MultipleBeansException: Multiple beans of type org.geoserver.config.GeoServerLoader
我使用的运行命令是:
docker run --mount type=bind,src=/home/milos/GeoServer,target=/opt/geoserver_data -it -p8080:8080 --env INSTALL_EXTENSIONS=true --env STABLE_EXTENSIONS="pyramid" --env COMMUNITY_EXTENSIONS="jdbcconfig,jms-cluster" docker.osgeo.org/geoserver:2.23.x
在执行 docker run 命令之前,文件夹 /home/milos/GeoServer 已存在且为空。 这是一个错误,还是预计这两个插件不能一起工作? 如果我在没有 jdbcconfig 的情况下安装 jms-cluster 插件,docker run 会正常执行...
它们都是集群插件,只应该使用其中一个,同时安装两者没有意义,不启动也不足为奇,它们都提供了另一种目录实现。