我正在尝试设置GeoServer JNDI。但是,我收到了HTTP503。在设置JNDI之前,我在GeoServer中上传了一个shapefile,可以从本地计算机中的QGIS对其进行访问。但是,设置JNDI后,我无法访问geoserver。
我所做的是
从https://jdbc.postgresql.org/download.html下载了jdbcconfig(PostgreSQL JDBC 4.2 Driver, 42.2.5
)。
解压缩此文件并将JAR放在/usr/local/geoserver/webapps/geoserver/WEB-INF/lib
中(两个JAR是gs-jdbcconfig-2.14-SNAPSHOT.jar
和compress-lzf-1.0.3.jar
在/Library/Tomcat/conf/context.xml
<Resource name="jdbc/postgres"
auth="Container"
type="javax.sql.DataSource"
driverClassName="org.postgresql.Driver"
url="jdbc:postgresql://<host>:<port>/<database>"
username="" password=""
maxActive="20"
initialSize="0"
minIdle="0"
maxIdle="8"
maxWait="10000"
timeBetweenEvictionRunsMillis="30000"
minEvictableIdleTimeMillis="60000"
testWhileIdle="true"
validationQuery="SELECT 1"
maxAge="600000" <!-- only on Tomcat >= 7 -->
rollbackOnReturn="true" <!-- only on Tomcat >= 7 -->
/>
重新启动地理服务器,jdbcconfig
已在data_dir
已配置/usr/local/geoserver/data_dir/jdbcconfig
-设置enabled = true
,initdb = true
和import = true
。
再次启动Geoserver。我收到了HTTP ERROR: 503
。
看来我的编辑使Tomcat崩溃了。和我一样
$tail -f logs/catalina.out
我收到了
17-Dec-2018 10:43:49.232 WARNING [main] org.apache.tomcat.util.digester.Digester.endElement No rules found matching 'Context/Context/Valve'.
17-Dec-2018 10:43:49.232 WARNING [main] org.apache.tomcat.util.digester.Digester.endElement No rules found matching 'Context/Context/Manager'.
17-Dec-2018 10:43:49.232 WARNING [main] org.apache.tomcat.util.digester.Digester.endElement No rules found matching 'Context/Context'.
17-Dec-2018 10:43:49.238 SEVERE [main] org.apache.catalina.startup.ContextConfig.configureStart Marking this application unavailable due to previous error(s)
17-Dec-2018 10:43:49.238 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal One or more components marked the context as not correctly configured
17-Dec-2018 10:43:49.239 SEVERE [main] org.apache.catalina.core.StandardContext.startInternal Context [/host-manager] startup failed due to previous errors
17-Dec-2018 10:43:49.240 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/Library/Tomcat/webapps/host-manager] has finished in [12] ms
17-Dec-2018 10:43:49.241 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
17-Dec-2018 10:43:49.247 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
17-Dec-2018 10:43:49.248 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 262 ms`
我该如何解决?
谢谢。