Crossdomain.xml, JBoss6, SWFs, EARs, and headaches

1763
8
07-28-2011 05:22 AM
JanicePeal
Occasional Contributor
Greetings!  I am in a quandry and was wondering if someone could help me.  I am attempting to deploy  a sample from the Flex API 2.3.1 samples (just load a map) as an *.ear through JBOSS6/NetBeans.  I have a Windows Server 2003 machine running JBOSS 6 and I can deploy the application just fine (I can see the map).  BTW, ArcGISServer(Java) resides on a different machine.  I have a new development environment (Windows7) also running JBoss6.  When I attempt to access the same application through this machine, I get an Error #2032 (no map), which I have read is a crossdomain issue.  I have updated the crossdomain.xml file located in <ArcGISServer Install location>/Server10.0/java/manager/web-output to include the ip address of the Windows7 development machine, and I am still getting the error and no map.  I am completely new to server configurations, etc. and was wondering if I'm missing something important.  Why can't I get this new development server to connect to the ArcGISServer maps if the new machine's ip is listed in the crossdomain.xml file? 

Here's the current crossdomain file hosted in my *.EAR:
<?xml version="1.0"?>
<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*" to-ports="8399" />
    <allow-access-from domain="*" to-ports="8080" />
</cross-domain-policy>

Pretty simple....here's the crossdomain.xml from the ArcGISServer server:

<?xml version="1.0"?>
   <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
   <cross-domain-policy>
   <allow-access-from domain="192.168.111.60" />><!--IP of Windows7 machine that doesn't work-->

   <allow-access-from domain="192.168.90.32" /><!--IP of Windows Server 2003 machine that works-->
   <allow-access-from domain="arcgis3" /><!--name of machine of ArcGISServer -->
   </cross-domain-policy>

I'm at day 25 of this, with no formal training, and I'm not getting anywhere!  Any guidance would be greatly appreciated.  If I'm leaving out an important tidbit, please let me know and I'll post it.
Tags (2)
0 Kudos
8 Replies
RobertScheitlin__GISP
MVP Emeritus
Janice,

  I have absolutely no JBOSS or Java Server experience but I do know that if you have the machines ip address allowed in the crossdomain.xml than you have to be using the machines ip address in the url for the map service as will in your app. You can not mix and match IP, machine name, and/or fully qualified machine name. They all have to be the same.
0 Kudos
JanicePeal
Occasional Contributor
The url I am using that connects appropriately to ArcGISServer (shows the map) through the deployed SWF:
http://192.168.90.32/MCPRIMA_5x-war/HistoricInventory

The url I am using that does not connect to ArcGISServer (no map and Error #2032):
http://192.168.111.60/MCPRIMA_5x-war/HistoricInventory

My swf connects to the map in this fashion:
<esri:ArcGISDynamicMapServiceLayer url="http://morrisgis.co.morris.nj.us:8399/arcgis/rest/services/MCPRIMA_4X_HistoricInventory/MapServer"/>

Now then, morrisgis.co.morris.nj.us:8399 is the same as arcgis3.  It sounds like that shouldn't work on the working Windows 2003 Server machine (192.168.90.32), but it does!  I neglected to mention also that the Windows7 machine is 64 bit, and the Windows Server 2003 machine is 32 bit.  Not sure if that is what's making the difference.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Janice,

   So in the SWF you are also using :

http://192.168.111.60/ArcGIS/rest/services/YourMapService/MapServer for the layer URL right?
0 Kudos
JanicePeal
Occasional Contributor
No, because the ArcGISServer does not reside on that machine.  I am using
<esri:ArcGISDynamicMapServiceLayer url="http://morrisgis.co.morris.nj.us:8399/arcgis/rest/services/MCPRIMA_4X_HistoricInventory/MapServer"/>

where morrisgis.co.morris.nj.us:8399 is arcgis3 which is another Windows Server 2003 machine.

JBoss (web server) resides on a local machine (192.168.111.60 - not working, and 192.168.90.32 - working).  ArcGIS Server resides on a different machine than both of these, yet the 192.168.90.32 machine is connecting to ArcGIS Server, but 192.168.111.60 is not.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Janice,

   OK so if I understand correctly than you are definitely mixing ip and machine names in your deployment and this is an issue.

If you use http://192.168.111.60/MCPRIMA_5x-war/HistoricInventory as the url for the application and
http://morrisgis.co.morris.nj.us:8399/arcgis/rest/services/MCPRIMA_4X_HistoricInventory/MapServer for the layers url
and <allow-access-from domain="192.168.111.60" /> in the crossdomain.xml than it is going to be a security violation.

Try this in your crossdomain.xml

<?xml version="1.0"?>
   <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
   <cross-domain-policy>
   <allow-access-from domain="192.168.111.60" /><!--IP of Windows7 machine-->
   <allow-access-from domain="192.168.90.32" /><!--IP of Windows Server 2003 machine that works-->
   <allow-access-from domain="morrisgis.co.morris.nj.us:8399" /><!--name of machine of ArcGISServer -->
   </cross-domain-policy>
0 Kudos
JanicePeal
Occasional Contributor
Which crossdomain.xml, the one on the arcgis server or the one on the local development machine?  The additional problem I have is that we only have one arcgis server that is connecting to older apps that were built in arcgis api 3.1/flash builder 4 with flex library 3.2 that are running on a production server (yet another server) just fine.  When I modify the crossdomain.xml on the arcgis server, things are breaking.  I'll give it a shot though and see what happens.  If it breaks the old stuff, I can't make the change.  I also noticed that new crossdomain.xml start with a different DOCTYPE cross-domain-policy SYSTEM dtd location.  Our old one is using www.macromedia.com, and the new one is using www.adobe.com.  When I changed that line of code, all of my old apps stopped connecting to the arcgis server. 

Thanks again for the pointers.  I'll let you know what happens with your recommended change shortly.
0 Kudos
JanicePeal
Occasional Contributor
If I change the crossdomain.xml on arcgis server, it breaks my old apps, so I can't make this change.   The thing that's confusing me is that I have two machines configured exactly the same, except that the Windows Server 2003 machine shows the map just fine, but the Windows 7 machine does not.  I deployed the same ear file on both.  Odly enough, after compiling the flex mxml on the windows 7 machine, if I just hit the run button in Flash Builder, I can see my map.  It's just when I try to run it through the web server on the same machine that it breaks.

PS - just downloaded Flash Player 10.3 debug and received additional information on the #2032 error:   
Error #2032: Stream Error. URL: http://192.168.111.60/MCPRIMA_5x-war/framework_4.5.0.20967.swf
0 Kudos
JanicePeal
Occasional Contributor
PROBLEM SOLVED!  Turns out, it wasn't an issue with the crossdomain.xml at all, but a corrupt NetBeans project.  Thanks to all who helped.  Your feedback taught me a lot as I struggle through this process!
0 Kudos