Deploy geoserver on tomcat 8

ⅰ亾dé卋堺 提交于 2021-01-28 05:08:12

问题


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 geoserver on 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.

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"/>

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.

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.

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!

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

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)

And at the end :

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.


回答1:


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 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


来源:https://stackoverflow.com/questions/43545078/deploy-geoserver-on-tomcat-8

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!