I've adapted the working example from geo-solutions website but still it is not working, it seems the problem is with jetty. below is the previous question

I'm using Geoserver with jetty web server, I've published WMS layer in GeoServer and when i call it from QGIS it works perfectly, but when i call it with OpenLayers it is not loading, it says HTTP ERROR: 404 Not found, both my html file (with the OpenLayers script) and GeoServer are running on localhost:8083.

         <title>Counties of enschede</title>
         <link rel="stylesheet" href="localhost:8083/www/openlayers/theme/default/style.css" type="text/css">
                 #map-id {
                         width: 512px;
                         height: 300px;
         <script src="localhost:8083/www/openlayers/OpenLayers.js"></script>
         <h1>Counties of enschede</h1>
     <div id="map-id"></div>
             var bounds = new OpenLayers.Bounds(
                    760709.059251067, 6834146.95621378,
                     775589.940002763, 6845228.94005499

             var options = {
                             controls: [],
                             maxExtent: bounds,
                             maxResolution: 0.02741796875,
                             projection: "EPSG:3857",
                             units: 'm'

             map = new OpenLayers.Map('map-id', options);

             var ccounties = new OpenLayers.Layer.WMS(
                             "Map - Enschede", "http://localhost:8083/geoserver/thesis/wms",
                                     srs: 'EPSG:3857',
                                     layers: 'thesis:Ensche',
                                     styles: '',
                             {singleTile: true, ratio: 1}


             // build up all controls
             map.addControl(new OpenLayers.Control.PanZoomBar({
                     position: new OpenLayers.Pixel(2, 15)
             map.addControl(new OpenLayers.Control.Navigation());
             map.addControl(new OpenLayers.Control.Scale());
             map.addControl(new OpenLayers.Control.MousePosition());


1 Answer 1


Check that the url created by OpenLayers in your app matches the one from the 'Layer Preview' in GeoServer using the developer tools in your browser. Check the network tab.

  • I did that to check my url, and i've used also that same url, but still it is not working
    – user30839
    Oct 31, 2014 at 10:03
  • 1
    Could you paste the urls here? Or perhaps share your HTML, CSS and JS on jsfiddle?
    – omarkljung
    Nov 3, 2014 at 20:20

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.