Search code examples
javajettygeoserverhttp-status-code-503

UnavailableException when trying to set up Jetty CORS access


I've been trying to follow this and linked within answers to try and setup a CORS access as apparently localhost and localhost:8080 are two different domains. sigh

Either way, the issue I'm having is that when starting the server a javax.servlet.UnavailableException: org.eclipse.jetty.servlets.CrossOriginFilter exception is thrown. I've no clue what's causing it.

When trying to use the services in it I get a 503 error.

Steps taken:

  1. Copied the jetty-servlet-9.2.13.v20150730.jar from the Geoserver lib folder to the webapps WEB-INF's lib folder.
  2. Pasted the following into my web.xml: Pastebin because editor didn't cooperate

If I remove those lines it works fine, apart from the CORS issues I have. (I'm trying to access colour values of specific pixels.

Other than that and an added WMS, the Geoserver instance is pretty much a fresh install.

UPDATE:

So, following @sideshowbarker's advice, I have inserted a servlets file. Now I'm getting a 404 error, seemingly caused by the GeoServer setup not being able to find the definition of org/eclipse/jetty/util/StringUtil. Errr, what?

Please find the pastebin of this: http://pastebin.com/4R8hZNcM

UPDATE 2:

So, I've inserted the required jar into the WEB-INF folder, and now it's throwing a NoSuchMethodError in regards to the csvSplit method... what? o.O


Solution

  • The jetty-util had a faulty StringUtil class, with a faulty csvSplit method. Replacing this with the most recent (9.4.*) jar solved the issue.