title: WorldWind <-> MapCache <-> MapServer
body: <p>I have a MapCache &lt;-> MapServer setup and running. MapCache is configured for WMS access and is used to cache tiles for specific layers provided by my MapServer. I can access the WMS capabilities and display a tile through my browser by accessing WMS trough MapCache and have verified that it is being cached. </p>
  
  <p>Excellent, just what I wanted.</p>
  
  <p>Next, I setup a WorldWind client to access the MapCache WMS. WorldWind complains that the rootlayer (something MapCache uses to wrap all layers) does not provide a geographic bounding box. WorldWind logs this as severe and starts throwing exceptions. I'm trying to figure out where the problem lies. Does the WMS OGC Standard require the top layer to have a bounding box or is the WorldWind client not WMS compliant? Below is the error messages that I'm seeing. Below that is the getCapabilities response. Below that is the MapCache xml file. Below that is the MapServer map file.</p>
  
  <p><a href="http://forum.worldwindcentral.com/showthread.php?44768-WorldWind-lt-gt-MapCache-lt-gt-MapServer" rel="nofollow noreferrer">I have also posted this in the WorldWind forum, but not sure if I'll get a response there.</a></p>
  
  <p>Any help will be greatly appreciated.</p>
  
  <p><strong>Exceptions:</strong></p>
  
  <pre><code>SEVERE: No geographic bounding box given in WMS capabilities for layer rootlayer
  SEVERE: No geographic bounding box given in WMS capabilities
  SEVERE: WMS capabilities document is missing values necessary for component construction
  
  UpdateSequence: none
  ServiceName: OGC:WMS
  ServiceTitle: map service
  ServiceAbstract: none
  Fees: none
  AccessConstraints: none
  Keywords:  none
  OnlineResource: href: [url]http://localhost/mapcache/?[/url], type: null
  none
  Max width = 0 Max height = 0
  
  GetMap
      Formats:    image/jpeg,     image/png, 
      DCPTypes:
          HTTP, Get, href: [url]http://localhost/mapcache/?[/url], type: null
  GetCapabilities
      Formats:    application/vnd.ogc.wms_xml, 
      DCPTypes:
          HTTP, Get, href: [url]http://localhost/mapcache/?[/url], type: null
  GetFeatureInfo
      Formats:    text/plain,     application/vnd.ogc.gml, 
      DCPTypes:
          HTTP, Get, href: [url]http://localhost/mapcache/?[/url], type: null
  
  LAYERS
  LAYER rootlayer: queryable = false
  LAYER bluemarbleJanuary: queryable = false
  
  gov.nasa.worldwind.exception.WWRuntimeException: No geographic bounding box given in WMS capabilities
      at gov.nasa.worldwind.util.DataConfigurationUtils.getWMSLayerConfigParams(Unknown Source)
      at gov.nasa.worldwind.wms.WMSTiledImageLayer.wmsGetParamsFromCapsDoc(Unknown Source)
      at gov.nasa.worldwind.wms.WMSTiledImageLayer.&lt;init&gt;(Unknown Source)
      at gov.nasa.worldwind.layers.BasicLayerFactory.doCreateFromCapabilities(Unknown Source)
      at gov.nasa.worldwind.layers.BasicLayerFactory.doCreateFromCapabilities(Unknown Source)
      at gov.nasa.worldwind.BasicFactory.createFromConfigSource(Unknown Source)
      at gov.nasa.worldwind.layers.BasicLayerFactory.createFromConfigSource(Unknown Source)
  
  gov.nasa.worldwind.exception.WWRuntimeException: Creation from configuration file failed Version: 1.1.1
      at gov.nasa.worldwind.BasicFactory.createFromConfigSource(Unknown Source)
      at gov.nasa.worldwind.layers.BasicLayerFactory.createFromConfigSource(Unknown Source)
  
  Caused by: java.lang.IllegalArgumentException: WMS capabilities document is missing values necessary for component construction
      at gov.nasa.worldwind.wms.WMSTiledImageLayer.wmsGetParamsFromCapsDoc(Unknown Source)
      at gov.nasa.worldwind.wms.WMSTiledImageLayer.&lt;init&gt;(Unknown Source)
      at gov.nasa.worldwind.layers.BasicLayerFactory.doCreateFromCapabilities(Unknown Source)
      at gov.nasa.worldwind.layers.BasicLayerFactory.doCreateFromCapabilities(Unknown Source)
      ... 14 more
  
  Caused by: gov.nasa.worldwind.exception.WWRuntimeException: No geographic bounding box given in WMS capabilities
      at gov.nasa.worldwind.util.DataConfigurationUtils.getWMSLayerConfigParams(Unknown Source)
      ... 18 more
  </code></pre>
  
  <p><strong>GetCapabilities</strong></p>
  
  
  
  <pre><code>&lt;WMT_MS_Capabilities version="1.1.1"&gt;
  &lt;Service&gt;
  &lt;Name&gt;OGC:WMS&lt;/Name&gt;
  &lt;Title&gt;map service&lt;/Title&gt;
  &lt;OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/mapcache?"/&gt;
  &lt;/Service&gt;
  &lt;Capability&gt;
  &lt;Request&gt;
  &lt;GetCapabilities&gt;
  &lt;Format&gt;application/vnd.ogc.wms_xml&lt;/Format&gt;
  &lt;DCPType&gt;
  &lt;HTTP&gt;
  &lt;Get&gt;
  &lt;OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/mapcache?"/&gt;
  &lt;/Get&gt;
  &lt;/HTTP&gt;
  &lt;/DCPType&gt;
  &lt;/GetCapabilities&gt;
  &lt;GetMap&gt;
  &lt;Format&gt;image/png&lt;/Format&gt;
  &lt;Format&gt;image/jpeg&lt;/Format&gt;
  &lt;DCPType&gt;
  &lt;HTTP&gt;
  &lt;Get&gt;
  &lt;OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/mapcache?"/&gt;
  &lt;/Get&gt;
  &lt;/HTTP&gt;
  &lt;/DCPType&gt;
  &lt;/GetMap&gt;
  &lt;GetFeatureInfo&gt;
  &lt;Format&gt;text/plain&lt;/Format&gt;
  &lt;Format&gt;application/vnd.ogc.gml&lt;/Format&gt;
  &lt;DCPType&gt;
  &lt;HTTP&gt;
  &lt;Get&gt;
  &lt;OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://localhost/mapcache?"/&gt;
  &lt;/Get&gt;
  &lt;/HTTP&gt;
  &lt;/DCPType&gt;
  &lt;/GetFeatureInfo&gt;
  &lt;/Request&gt;
  &lt;Exceptions&gt;
  &lt;Format&gt;text/plain&lt;/Format&gt;
  &lt;/Exceptions&gt;
  &lt;VendorSpecificCapabilities&gt;
  &lt;TileSet&gt;
  &lt;SRS&gt;EPSG:4326&lt;/SRS&gt;
  &lt;BoundingBox SRS="EPSG:4326" minx="-180.000000" miny="-90.000000" maxx="180.000000" maxy="90.000000"/&gt;
  &lt;Resolutions&gt;
  0.70312500000000000000 0.35156250000000000000 0.17578125000000000000 0.08789062500000000000 0.04394531250000000000 0.02197265625000000000 0.01098632812500000000 0.00549316406250000000 0.00274658203125000000 0.00137329101562500000 0.00068664550781250000 0.00034332275390625000 0.00017166137695312500 0.00008583068847656250 0.00004291534423828120 0.00002145767211914060 0.00001072883605957030 0.00000536441802978516
  &lt;/Resolutions&gt;
  &lt;Width&gt;256&lt;/Width&gt;
  &lt;Height&gt;256&lt;/Height&gt;
  &lt;Format&gt;image/png&lt;/Format&gt;
  &lt;Layers&gt;bluemarbleJanuary&lt;/Layers&gt;
  &lt;Styles/&gt;
  &lt;/TileSet&gt;
  &lt;/VendorSpecificCapabilities&gt;
  &lt;Layer&gt;
  &lt;Name&gt;rootlayer&lt;/Name&gt;
  &lt;Title&gt;map service&lt;/Title&gt;
  &lt;SRS&gt;EPSG:900913&lt;/SRS&gt;
  &lt;SRS&gt;EPSG:4326&lt;/SRS&gt;
  &lt;SRS&gt;EPSG:3857&lt;/SRS&gt;
  &lt;Layer cascaded="1" queryable="0"&gt;
  &lt;Name&gt;bluemarbleJanuary&lt;/Name&gt;
  &lt;LatLonBoundingBox minx="-180.000000" miny="-90.000000" maxx="180.000000" maxy="90.000000"/&gt;
  &lt;BoundingBox SRS="EPSG:4326" minx="-180.000000" miny="-90.000000" maxx="180.000000" maxy="90.000000"/&gt;
  &lt;SRS&gt;EPSG:4326&lt;/SRS&gt;
  &lt;/Layer&gt;
  &lt;/Layer&gt;
  &lt;/Capability&gt;
  &lt;/WMT_MS_Capabilities&gt;
  </code></pre>
  
  <p><strong>mapcache.xml</strong></p>
  
  
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!-- see the accompanying mapcache.xml.sample for a fully commented configuration file --&gt;
  
  &lt;mapcache&gt;
      &lt;metadata&gt;
       &lt;title&gt;map service&lt;/title&gt;
       &lt;abstract&gt;Contains various cached maps&lt;/abstract&gt;
      &lt;/metadata&gt;
  
      &lt;cache name="disk" type="disk"&gt;
       &lt;base&gt;D:/mapserver/ms4w/tmp/ms_tmp/cache&lt;/base&gt;
      &lt;/cache&gt;
  
      &lt;source name="bluemarbleJanuary" type="wms"&gt;
       &lt;getmap&gt;
         &lt;params&gt;
           &lt;FORMAT&gt;image/png&lt;/FORMAT&gt;
           &lt;LAYERS&gt;bluemarbleJanuary&lt;/LAYERS&gt;
           &lt;MAP&gt;D:/mapserver/data/nasaww.map&lt;/MAP&gt;
         &lt;/params&gt;
       &lt;/getmap&gt;
       &lt;http&gt;
         &lt;url&gt;http://localhost/wms?&lt;/url&gt;
       &lt;/http&gt;
      &lt;/source&gt;
  
      &lt;format name="PNGQ_FAST" type="PNG"&gt;
       &lt;compression&gt;fast&lt;/compression&gt;
       &lt;colors&gt;256&lt;/colors&gt;
      &lt;/format&gt;
  
      &lt;tileset name="bluemarbleJanuary"&gt;
       &lt;source&gt;bluemarbleJanuary&lt;/source&gt;
       &lt;cache&gt;disk&lt;/cache&gt;
       &lt;grid&gt;WGS84&lt;/grid&gt;
       &lt;format&gt;PNGQ_FAST&lt;/format&gt;
       &lt;metatile&gt;5 5&lt;/metatile&gt;
       &lt;metabuffer&gt;20&lt;/metabuffer&gt;
       &lt;expires&gt;3600&lt;/expires&gt;
      &lt;/tileset&gt;
  
      &lt;default_format&gt;PNGQ_FAST&lt;/default_format&gt;
  
      &lt;service type="wms" enabled="true"&gt;
       &lt;full_wms&gt;assemble&lt;/full_wms&gt;
       &lt;resample_mode&gt;bilinear&lt;/resample_mode&gt;
       &lt;format&gt;PNGQ_FAST&lt;/format&gt;
       &lt;maxsize&gt;4096&lt;/maxsize&gt;
      &lt;/service&gt;
      &lt;service type="wmts" enabled="true"/&gt;
      &lt;service type="tms" enabled="true"/&gt;
      &lt;service type="kml" enabled="true"/&gt;
      &lt;service type="gmaps" enabled="true"/&gt;
      &lt;service type="ve" enabled="true"/&gt;
      &lt;service type="demo" enabled="true"/&gt;
  
      &lt;errors&gt;report&lt;/errors&gt;
      &lt;lock_dir&gt;D:/mapserver/ms4w/tmp/ms_tmp&lt;/lock_dir&gt;
      &lt;log_level&gt;debug&lt;/log_level&gt;
  
  &lt;/mapcache&gt;
  </code></pre>
  
  <p><strong>Map File</strong></p>
  
  <pre><code>MAP
      NAME WMS_server
      STATUS ON
      EXTENT -180 -90 180 90
      UNITS DD
      CONFIG "MS_ERRORFILE" "ms_error.txt"
      DEBUG 5
  
      #
      # Start of web interface definition
      #
      WEB
          METADATA
              "wms_title"                  "WMS Demo Server"
              "wms_onlineresource"         "http://localhost/wms?"
              "wms_srs"                    "EPSG:4326"
              "wms_feature_info_mime_type" "text/html"
              "wms_abstract"               "This demonstration server showcases MapServer (www.mapserver.org) and its OGC support"
              "wms_enable_request"         "*"
          END # Metadata
      END # Web
  
      PROJECTION
          "init=epsg:4326"
      END # Projection
  
      #
      # Start of layer definitions
      #
  
      ##################
      # Blue Marble January 2004
      ##################
      LAYER
          NAME "bluemarbleJanuary"
          #GROUP "default"
          TYPE RASTER
          STATUS ON
  
          METADATA
              "wms_title"             "Blue Marble Raster (January 2004)"
              "wms_attribution_title" "NASA Blue Marble (January 2004)"
              "wms_srs"               "EPSG:4326"
          END # Metadata
  
          TILEINDEX "raster/bluemarble/jan/bluemarble-index.shp"
          TILEITEM "LOCATION"
  
          PROJECTION
              "+init=EPSG:4326"
          END # Projection
      END # Layer
  
  END # Map
  </code></pre>