1

I've used this procedure for install GeoServer on a server based on Ubuntu 20.04 with Tomcat and Nginx. At the end I've putted under HTTPS my subdomain.

I can see without problems the WMS services and infact I've created this map that use eight WMS link.

The problem comes when I try to pick up the informations from the pixels because I see into console log many problems about CORS origin.

So, I've followed this procedure to activate CORS on GeoServer. After the edit of web.xml I've reloaded GeoServer clicked on Reload into web user interface but GeoServer goes offline with the error:

HTTP Status 404 – Not Found

Type Status Report

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Apache Tomcat/9.0.37

I've restarted Tomcat and Nginx with:

systemctl restart tomcat
systemctl restart nginx

and now I see another error:

HTTP Status 404 – Not Found

Type Status Report

Message The requested resource [/geoserver/] is not available

Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

Apache Tomcat/9.0.37

How I can solve this problem?

EDIT 1:

Inside the logs (geoserver/data/logs) there aren't indication about the problem. If I comment again the rows edited inside web.xml and use systemctl restart tomcat it is possible to use again GeoServer.

EIDT 2:

Inside web.xml I've this rows that are commented:

   <!-- Uncomment following filter to enable CORS
<filter>
        <filter-name>cross-origin</filter-name>
        <filter-class>org.eclipse.jetty.servlets.CrossOriginFilter</filter-class>
       <init-param>
           <param-name>chainPreflight</param-name>
           <param-value>false</param-value>
       </init-param>
       <init-param>
           <param-name>allowedOrigins</param-name>
           <param-value>*</param-value>
       </init-param>
       <init-param>
           <param-name>allowedMethods</param-name>
           <param-value>GET,POST,PUT,DELETE,HEAD,OPTIONS</param-value>
       </init-param>
       <init-param>
           <param-name>allowedHeaders</param-name>
           <param-value>*</param-value>
       </init-param>
    </filter>
-->
.
.
.
   <!-- Uncomment following filter to enable CORS
    <filter-mapping>
        <filter-name>cross-origin</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
-->

I uncomment the rows and then save the file.

6
  • Please look in the log files and add any relevant error messages to your question using the edit button
    – Ian Turton
    Aug 5, 2020 at 9:31
  • Where I can find the log files? Inside the GeoServer folder I see only META-INF WEB-INF data index.html Aug 5, 2020 at 9:35
  • look in data/log if it isn't there then then tomcat is failing before GeoServer starts
    – Ian Turton
    Aug 5, 2020 at 10:00
  • @IanTurton I've edited my question Aug 5, 2020 at 12:51
  • in which case we need to see exactly what you added to the web.xml file
    – Ian Turton
    Aug 5, 2020 at 13:04

1 Answer 1

1

You seem to be following the instructions for a jetty install rather than the ones for tomcat with the result that tomcat is trying to process a Jetty jar and (understandably) crashes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.