3.0 api error adding WMS layer. first one fails all rest are ok.

Discussion created by jeff.pace on Jun 19, 2012
I am having trouble loading WMS layers in the new api.  After I create my WMS layer, I do map.addLayer(layer) . On the first WMS layer, I get

error Loading map service at url: TypeError: _9.spatialReference is null

however, the line before add layer is

console.log("mm llh: " + " "+layer.spatialReference.wkid );

which results in

mm llh: 2011 Aerials 102100

so the spatial reference is set properly.  I am looping through 6 layers, 1st one always fails, next 5 always succeed.  Regardless of order.

The result is the layer draws!!! however it is created on top of the graphics layer.

I reported this before, but wanted to re-report now that 3.0 is final. 

Code for creating layer
mapServiceInfo.label = "2011"
mapServiceInfo.url = ""
mapServiceInfo.catalog = "2011"

2003, 2007, 2008, 2009, 2010, 2011 are all valid values

  else if (mapServiceInfo.type === "wms") {
                   var layerInfo = new esri.layers.WMSLayerInfo({
                    var resourceInfo = {
                        extent: new esri.geometry.Extent({
                                "wkid": 102100
                        layerInfos: [layerInfo],
                            layer = new esri.layers.WMSLayer(mapServiceInfo.url, {
                            resourceInfo: resourceInfo,
                            id: mapServiceInfo.label,
                            visibleLayers: [mapServiceInfo.catalog],
                            type: "wms"