本文介绍了在tomcat 8上部署Geoserver的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近设法(并非不费吹灰之力)在Debian 8.1远程服务器上安装了tomcat 8.我的目标是运行一个名为 geoserver 的网络应用在那个tomcat服务器上.因此,在我的/var/lib/tomcat8/webapps 目录中,创建了一个名为 geoserver/的新目录,并在该目录中上传了一个名为的.war文件.geoserver.war .

I have recently managed (not without effort) to install tomcat 8 on a Debian 8.1 distant server. My goal is to run a webapp called geoserveron that tomcat server. So in my /var/lib/tomcat8/webapps directory, I created a new directory called geoserver/, and in that directory I uploaded the .war file called geoserver.war.

然后我进入了/var/lib/tomcat8/conf (实际上是一个符号链接,将我重定向到/etc/tomcat8 并编辑了tomcat-users.xml 文件,在< tomcat-users></tomcat-users> 标签之间添加以下标签:

Then I went in /var/lib/tomcat8/conf (which is actually a symbolic link that redirects me to /etc/tomcat8 and edited the tomcat-users.xml file, adding between the <tomcat-users></tomcat-users> tags the following :

<role rolename="admin-gui"/>
<role rolename="manager-gui"/>
<user username="admin" password="*****" roles="admin-gui, manager-gui"/>

我可以授予我tomcat Webapps管理器和主机管理器的访问权限.在管理器中,通过提供上下文路径和其他所需的URL,我部署了 geoserver.war 文件.之后,我可以在我的应用列表中看到/geoserver 成功运行.

Which grants me access to the tomcat webapps manager and host-manager. In the manager, I deployed my geoserver.war file, by giving the context path and other required URLs. And after that, I can see in my apps list that /geoserver is successfully running.

但是当我尝试实际连接到geoserver页面(位于MY_SERVER_IP:8080/geoserver)时,为了对其进行处理,我收到404错误,说请求的资源(/geoserver )不可用.作为记录,默认情况下提供的其他Web应用程序(例如/examples)运行良好.

But when I try to actually connect to the geoserver page (at MY_SERVER_IP:8080/geoserver), in order to work on it, I get a 404 error, saying that the requested resource (/geoserver) isn't available. For the record, other webapps, provided by default, such as /examples, work perfectly well.

我无法在互联网上找到问题的答案,这就是为什么我来这里询问是否有人知道如何解决我的问题的原因.我希望我的问题对于stackoverflow来说不是太离题,如果只是让我知道,我会把它发布在另一个网站上.预先感谢,祝您周末愉快!

I couldn't find the answer to my problem on the internet, which is why I come here to ask if anyone knows how to solve my issue. I hope my question isn't too off-topic for stackoverflow, if it is just let me know and I will post it on another website instead. Thanks in advance and have a good week-end!

这是当我尝试在tomcat Webapps管理器中启动geoserver时在catalina.out文件中写入的内容.

EDIT : Here is what gets written in the catalina.out file when I try to start the geoserver in my tomcat webapps manager.

avr. 24, 2017 5:32:55 AM org.apache.catalina.core.ApplicationContext log
INFOS: No Spring WebApplicationInitializer types detected on classpath

以下部分由于某种原因重复了5次.

The following part is, for some reason, repeated 5 times.

avr. 24, 2017 5:32:55 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Error configuring application listener of class marktest.Config org.geoserver.GeoserverInitStartupListener
java.lang.UnsupportedClassVersionError: org/geoserver/GeoserverInitStartupListener : Unsupported major.minor version 52.0 (unable to load class org.geoserver.GeoserverInitStartupListener)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(WebappClassLoaderBase.java:2476)
    at org.apache.catalina.loader.WebappClassLoaderBase.findClass(WebappClassLoaderBase.java:853)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1263)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1146)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:520)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:501)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:120)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4753)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1265)
    at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:673)
    at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:221)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:644)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:213)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:618)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
    at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1081)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)
    at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1570)
    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1527)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:745)

最后:

avr. 24, 2017 5:32:55 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Skipped installing application listeners due to previous error(s)
avr. 24, 2017 5:32:55 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
avr. 24, 2017 5:32:55 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/geoserver] startup failed due to previous errors

有些部分是用法语编写的,希望我的翻译足够准确.

Some parts were written in French, I hope my translation is accurate enough.

推荐答案

geoserver.war 移至/var/lib/tomcat8/webapps 并重新启动 tomcat-一切都应该在那个时候起作用.

Move geoserver.war to /var/lib/tomcat8/webapps and restart tomcat - everything should just work at that point.

如果失败,则需要检查的其他事情是

If that fails then other things to check are:

  1. 是否已安装Java 1.8?GeoServer需要这个
  2. 确保没有其他程序正在使用端口8080
  3. Tomcat8用户在/var/lib/tomcat8/webapps/geoserver
  4. 上具有读/写/执行权限
  5. /var/log/tomcat8/catalina.out
  6. 中检查Tomcat日志文件
  7. /var/lib/tomcat8/webapps/geoserver/data/logs/geoserver.log
  8. 中检查GeoServer日志文件
  1. Java 1.8 installed? GeoServer requires this
  2. Make sure no other programs are using port 8080
  3. Tomcat8 user has read/write/execute permissions on /var/lib/tomcat8/webapps/geoserver
  4. Check Tomcat log file in /var/log/tomcat8/catalina.out
  5. Check GeoServer log file in /var/lib/tomcat8/webapps/geoserver/data/logs/geoserver.log

这篇关于在tomcat 8上部署Geoserver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 15:44