Tuesday 11 June 2019

Enabling CORS in GeoServer 2.15.1 (jetty 9.4.12)? - NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet


I am creating a leaflet app. For this I have to use a Geoserver.


I found that CORS was not enabled, because I get this error message: Reason: CORS header 'Access-Control-Allow-Origin' missing: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS/Errors/CORSMissingAllowOrigin


enter image description here



To enable CORS filter I commented out the following in web.xml file in webapps/Geoserver/WEB-INF like explained here: https://docs.geoserver.org/latest/en/user/production/container.html and here Can't access GeoServer after CORS filter


Now it looks like this:


   

cross-origin
org.eclipse.jetty.servlets.CrossOriginFilter

chainPreflight
false



allowedOrigins
*


allowedMethods
GET,POST,PUT,DELETE,HEAD,OPTIONS


allowedHeaders

*



...



cross-origin
/*



Adding the filter will cause the Geoserver/Jetty service to not start proper. This is my error message:


 at org.eclipse.jetty.start.Main.main(Main.java:77)
2019-10-24 11:19:53.350:INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /wms, did not find org.eclipse.jetty.jsp.JettyJspServlet
2019-10-24 11:19:53.381:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@4b024fb2{wms,/wms,file:///C:/Program%20Files%20(x86)/GeoServer%202.15.1/webapps/wms/,AVAILABLE}{C:\Program Files (x86)\GeoServer 2.15.1\webapps\wms}
2019-10-24 11:19:53.444:INFO:oejs.AbstractConnector:main: Started ServerConnector@4a5cddd9{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
2019-10-24 11:19:53.444:INFO:oejs.Server:main: Started @28862ms

I checked jars like explained here Enabling CORS in GeoServer (jetty)?



enter image description here


Everything looks OK for me, but then I searched for the exact error message:


NO JSP Support for /wms, did not find org.eclipse.jetty.jsp.JettyJspServlet

I read this: https://stackoverflow.com/questions/26217143/embedded-jetty-server-no-jsp-support-for-did-not-find-org-apache-jasper-ser and I think there is missing something.


But I do not understand what is missing. here exactly I should put which JAR? I do not create a Java application. I only want to access the geoserver remotely.


I am happy about any help


For a first solution I put the line


set geoserver.xframe.shouldSetPolicy=false 


in startup.bat in the folder geoserver/bin So I can show the data in an Iframe. But I need to manipulate some texts. So I need to enable CORS.


Edit: Whole error message:


C:\Program Files (x86)\GeoServer 2.15.1>set geoserver.xframe.shouldSetPolicy=false

C:\Program Files (x86)\GeoServer 2.15.1>for /F "delims=" %i in ('dir /b/s "C:\Program Files (x86)\GeoServer 2.15.1\bin\..\webapps\geoserver\WEB-INF\lib\marlin*.jar"') do set MARLIN_JAR=%i

C:\Program Files (x86)\GeoServer 2.15.1>set MARLIN_JAR=C:\Program Files (x86)\GeoServer 2.15.1\webapps\geoserver\WEB-INF\lib\marlin-0.9.3.jar

C:\Program Files (x86)\GeoServer 2.15.1>if not "C:\Program Files (x86)\GeoServer 2.15.1\webapps\geoserver\WEB-INF\lib\marlin-0.9.3.jar" == "" set MARLIN_ENABLER=-Xbootclasspath/a:"C:\Program Files (x86)\GeoServer 2.15.1\webapps\geoserver\WEB-INF\lib\marlin-0.9.3.jar" -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine


C:\Program Files (x86)\GeoServer 2.15.1>call "C:\Program Files\Java\jdk1.8.0_221\bin\java.exe" -Xbootclasspath/a:"C:\Program Files (x86)\GeoServer 2.15.1\webapps\geoserver\WEB-INF\lib\marlin-0.9.3.jar" -Dsun.java2d.renderer=org.marlin.pisces.MarlinRenderingEngine -DGEOSERVER_DATA_DIR="C:\Program Files (x86)\GeoServer 2.15.1\data_dir" -Xmx512m -DSTOP.PORT=8079 -DSTOP.KEY=geoserver -Djetty.base="C:\Program Files (x86)\GeoServer 2.15.1" -Djetty.logs="C:\Program Files (x86)\GeoServer 2.15.1\logs" -jar "C:\Program Files (x86)\GeoServer 2.15.1\start.jar" --module=http jetty.port=8080
2019-10-24 11:58:50.823:INFO::main: Logging initialized @828ms to org.eclipse.jetty.util.log.StdErrLog
2019-10-24 11:58:51.214:WARN:oejx.XmlConfiguration:main: Property 'jetty.port' is deprecated, use 'jetty.http.port' instead
2019-10-24 11:58:51.214:WARN:oejx.XmlConfiguration:main: Property 'http.timeout' is deprecated, use 'jetty.http.idleTimeout' instead
Error binding ShutdownMonitor to port 8079: java.net.BindException: Address already in use: JVM_Bind
2019-10-24 11:58:51.230:INFO:oejs.Server:main: jetty-9.4.12.v20180830; built: 2018-08-30T13:59:14.071Z; git: 27208684755d94a92186989f695db2d7b21ebc51; jvm 1.8.0_221-b11
2019-10-24 11:58:51.276:INFO:oejdp.ScanningAppProvider:main: Deployment monitor [file:///C:/Program%20Files%20(x86)/GeoServer%202.15.1/webapps/] at interval 1
2019-10-24 11:58:53.542:INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /geoserver, did not find org.eclipse.jetty.jsp.JettyJspServlet
2019-10-24 11:58:54.573:INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
2019-10-24 11:58:54.573:INFO:oejs.session:main: No SessionScavenger set, using defaults

2019-10-24 11:58:54.589:INFO:oejs.session:main: node0 Scavenging every 600000ms
Okt 24, 2019 11:58:56 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNUNG: Extension lookup 'XStreamPersisterInitializer', but ApplicationContext is unset.
Okt 24, 2019 11:58:56 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNUNG: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
Okt 24, 2019 11:58:56 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNUNG: Extension lookup 'ExtensionProvider', but ApplicationContext is unset.
Okt 24, 2019 11:58:56 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNUNG: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
log4j:WARN File option not set for appender [geoserverlogfile].

log4j:WARN Are you using FileAppender instead of ConsoleAppender?
2019-10-24 11:58:56.276:INFO:oejshC.geoserver:main: Initializing Spring root WebApplicationContext
Okt 24, 2019 11:59:02 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNUNG: Extension lookup 'GeoServerSecurityProvider', but ApplicationContext is unset.
Okt 24, 2019 11:59:02 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNUNG: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.
Okt 24, 2019 11:59:02 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNUNG: Extension lookup 'ExtensionProvider', but ApplicationContext is unset.
Okt 24, 2019 11:59:02 AM org.geoserver.platform.GeoServerExtensions checkContext
WARNUNG: Extension lookup 'ExtensionFilter', but ApplicationContext is unset.

24 Okt 11:59:03 INFO [org.geoserver] - GeoServer configuration lock is enabled
24 Okt 11:59:03 INFO [org.geoserver] - Loaded style 'line'
...
24 Okt 11:59:08 INFO [org.geoserver] - Loaded service 'wfs', enabled
24 Okt 11:59:08 INFO [org.geoserver] - Loaded service 'wms', enabled
24 Okt 11:59:08 INFO [config.GeoserverXMLResourceProvider] - Will look for 'geowebcache.xml' in directory 'C:\Program Files (x86)\GeoServer 2.15.1\data_dir\gwc'.
24 Okt 11:59:08 INFO [config.GeoserverXMLResourceProvider] - Found configuration file in gwc
24 Okt 11:59:08 INFO [config.GeoserverXMLResourceProvider] - Found configuration file in gwc
24 Okt 11:59:08 INFO [config.GeoserverXMLResourceProvider] - Found configuration file in gwc
24 Okt 11:59:08 WARN [config.XMLConfiguration] - ********************************************************************************

24 Okt 11:59:08 WARN [config.XMLConfiguration] - *** GWC configuration validation error: cvc-elt.1: Deklaration des Elements 'gwcConfiguration' kann nicht gefunden werden.
24 Okt 11:59:08 WARN [config.XMLConfiguration] - *** Will try to use configuration anyway. Please check the order of declared elements against the schema.
24 Okt 11:59:08 WARN [config.XMLConfiguration] - ********************************************************************************
24 Okt 11:59:08 INFO [config.XMLConfiguration] - Initializing GridSets from gwc
24 Okt 11:59:08 INFO [config.XMLConfiguration] - Initializing layers from gwc
24 Okt 11:59:08 INFO [gwc.layer] - Initializing GWC configuration based on GeoServer's Catalog
24 Okt 11:59:08 INFO [gwc.layer] - GeoServer TileLayer store base directory is: gwc-layers
24 Okt 11:59:08 INFO [gwc.layer] - Loading tile layers from gwc-layers
24 Okt 11:59:09 INFO [storage.BlobStoreAggregator] - BlobStoreConfiguration gwc contained no blob store infos.
24 Okt 11:59:09 INFO [storage.DefaultStorageFinder] - ***************************************************************************************************************************************************

24 Okt 11:59:09 INFO [storage.DefaultStorageFinder] - *** Found Java environment variable GEOSERVER_DATA_DIR set to C:\Program Files (x86)\GeoServer 2.15.1\data_dir, using it as the default prefix. ***
24 Okt 11:59:09 INFO [storage.DefaultStorageFinder] - ***************************************************************************************************************************************************
24 Okt 11:59:09 INFO [gwc.config] - Initializing GeoServer specific GWC configuration from gwc-gs.xml
24 Okt 11:59:09 INFO [config.GeoserverXMLResourceProvider] - Will look for 'geowebcache-diskquota.xml' in directory 'C:\Program Files (x86)\GeoServer 2.15.1\data_dir\gwc'.
24 Okt 11:59:09 INFO [config.GeoserverXMLResourceProvider] - Will look for 'geowebcache-diskquota-jdbc.xml' in directory 'C:\Program Files (x86)\GeoServer 2.15.1\data_dir\gwc'.
24 Okt 11:59:09 INFO [diskquota.ConfigLoader] - DiskQuota configuration is not readable: gwc/geowebcache-diskquota.xml
24 Okt 11:59:09 INFO [diskquota.ConfigLoader] - DiskQuota configuration is not readable: gwc/geowebcache-diskquota.xml
24 Okt 11:59:09 INFO [diskquota.DiskQuotaMonitor] - Setting up disk quota periodic enforcement task
24 Okt 11:59:09 INFO [diskquota.DiskQuotaMonitor] - 0 layers configured with their own quotas.
24 Okt 11:59:09 INFO [diskquota.DiskQuotaMonitor] - 25 layers attached to global quota 500,0 MB

24 Okt 11:59:09 INFO [diskquota.DiskQuotaMonitor] - Disk quota periodic enforcement task set up every 10 SECONDS
24 Okt 11:59:09 INFO [geowebcache.GeoWebCacheDispatcher] - Invoked setServletPrefix(gwc)
24 Okt 11:59:09 INFO [georss.GeoRSSPoller] - Initializing GeoRSS poller in a background job...
24 Okt 11:59:09 INFO [georss.GeoRSSPoller] - No enabled GeoRSS feeds found, poller will not run.
24 Okt 11:59:10 INFO [wms.WMSService] - Will NOT recombine tiles for non-tiling clients.
24 Okt 11:59:10 INFO [wms.WMSService] - Will proxy requests to backend that are not getmap or getcapabilities.
24 Okt 11:59:13 WARN [gce.imagemosaic] - Unable to set ordering between tiff readers spi
24 Okt 11:59:23 INFO [geoserver.security] - Start reloading user/groups for service named default
24 Okt 11:59:23 INFO [geoserver.security] - Reloading user/groups successful for service named default
24 Okt 11:59:24 INFO [geoserver.security] - AuthenticationCache Initialized with 1000 Max Entries, 300 seconds idle time, 600 seconds time to live and 3 concurrency level

24 Okt 11:59:24 INFO [geoserver.security] - AuthenticationCache Eviction Task created to run every 600 seconds
2019-10-24 11:59:24.167:WARN:oejw.WebAppContext:main: Failed startup of context o.e.j.w.WebAppContext@e45f292{GeoServer,/geoserver,file:///C:/Program%20Files%20(x86)/GeoServer%202.15.1/webapps/geoserver/,UNAVAILABLE}{C:\Program Files (x86)\GeoServer 2.15.1\webapps\geoserver}
java.lang.NoClassDefFoundError: org/eclipse/jetty/util/StringUtil
at org.eclipse.jetty.servlets.CrossOriginFilter.generateAllowedOrigins(CrossOriginFilter.java:243)
at org.eclipse.jetty.servlets.CrossOriginFilter.init(CrossOriginFilter.java:176)
at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:139)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:741)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:374)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)

at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:847)
at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:46)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:192)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:505)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:151)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:432)

at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392)
at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:313)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:150)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:579)
at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:240)

at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.server.Server.start(Server.java:416)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:383)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1572)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1512)
at java.security.AccessController.doPrivileged(Native Method)

at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1511)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.jetty.start.Main.invokeMain(Main.java:220)
at org.eclipse.jetty.start.Main.start(Main.java:486)
at org.eclipse.jetty.start.Main.main(Main.java:77)
Caused by:
java.lang.ClassNotFoundException: org.eclipse.jetty.util.StringUtil

at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:591)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.jetty.servlets.CrossOriginFilter.generateAllowedOrigins(CrossOriginFilter.java:243)
at org.eclipse.jetty.servlets.CrossOriginFilter.init(CrossOriginFilter.java:176)
at org.eclipse.jetty.servlet.FilterHolder.initialize(FilterHolder.java:139)
at org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:741)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:374)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:847)

at org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:46)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:192)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:505)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:151)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:432)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)

at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392)
at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:313)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:150)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:579)
at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:240)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)

at org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.server.Server.start(Server.java:416)
at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:117)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:383)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1572)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1512)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1511)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.jetty.start.Main.invokeMain(Main.java:220)
at org.eclipse.jetty.start.Main.start(Main.java:486)
at org.eclipse.jetty.start.Main.main(Main.java:77)
2019-10-24 11:59:24.229:INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /wms, did not find org.eclipse.jetty.jsp.JettyJspServlet
2019-10-24 11:59:24.296:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@7c1e5d14{wms,/wms,file:///C:/Program%20Files%20(x86)/GeoServer%202.15.1/webapps/wms/,AVAILABLE}{C:\Program Files (x86)\GeoServer 2.15.1\webapps\wms}
2019-10-24 11:59:24.370:INFO:oejs.AbstractConnector:main: Started ServerConnector@3dfb1626{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}

2019-10-24 11:59:24.385:INFO:oejs.Server:main: Started @34377ms


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...