Blank Map in deployment

3133
10
12-19-2013 05:56 PM
HelenAraya1
New Contributor
I have deployed arcgis application which uses arc-gis sdk for java using the link below.

I created a deployment folder and deployed the jars by following the link below.
http://resources.arcgis.com/en/help/runtime-java/concepts/index.html#//01qv00000010000000

But in deployment the map does not show. It shows blank Jframe with no map contents.

I works in testing environment where I developed the code.

Does any body know what the problem is?

Regards
Helen
0 Kudos
10 Replies
JeremieJoalland1
Occasional Contributor II
What kind of layers are you adding to the JMap ? dynamic layer from local map package, online web service, local tiled layer ?
In case you are loading a TPK or MPK file, as a resource file, it's working in local because the file is accessible, but in deployment your resource file are in the jar... so you  need to deploy or copy them outside the jar file for deployment.
I hope this can help you.
0 Kudos
IbrahimHussein
Occasional Contributor
Can you post your
private Jmap createMap() 

function so we can see what types of layers you are adding.
0 Kudos
HelenAraya1
New Contributor
Can you post your
private Jmap createMap() 

function so we can see what types of layers you are adding.



Here is my code. I have removed some parts which are irrelevant for this discussion.


ArcGISRuntime.setLicense("runtimebasic,101,ruddsfdsfsdfsdfsdf,none,XXXXXXXXXXXXXXXXXXXXX");
        worldStreetMap = "http://myarcgisserver:6080/arcgis/rest/services/World_Street_Map/MapServer"
        usZipcodes = "http://myarcgisserver:6080/arcgis/rest/services/USAPostalCodes/MapServer/0"
        theFrame = new JFrame();

        theFrame.setBounds(400, 50, 900, 800);
        theFrame.setTitle("Map zipcodes");
        SpatialReference reference= SpatialReference.create(3857);
        theFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        theFrame.getContentPane().setLayout(new BorderLayout(0, 0));
     
        // dispose map just before application window is closed.
        theFrame.addWindowListener(new WindowAdapter() {
         @Override
         public void windowClosing(WindowEvent windowEvent) {
          super.windowClosing(windowEvent);
          map.dispose();
         }
        });
       
        Point minExtent= ToWebMercator(xmin, ymin);
        Point maxExtent= ToWebMercator(xmax, ymax);
       
       Envelope initialExtent = new Envelope(minExtent.getX(), minExtent.getY(),maxExtent.getX(), maxExtent.getY());
       map = new JMap(reference,initialExtent);
       theFrame.getContentPane().add(map);     
       ArcGISTiledMapServiceLayer tiledLayer = new ArcGISTiledMapServiceLayer(worldStreetMap);           
       map.getLayers().add(tiledLayer);
       map.setExtent(initialExtent);       
       GraphicsLayer graphicsLayer = new GraphicsLayer();
       Color defaultColor = new Color(255, 255, 255, 0);
       SimpleLineSymbol polygonOutline1 = new SimpleLineSymbol(Color.gray, 1, SimpleLineSymbol.Style.SOLID); 
       SimpleFillSymbol fillSymbol = new SimpleFillSymbol(defaultColor, polygonOutline1, SimpleFillSymbol.Style.SOLID);     
      
       ClassBreaksRenderer renderer = new ClassBreaksRenderer();
       renderer.setDefaultSymbol(fillSymbol);
       renderer.setAttributeName("prob");    
       Color yellow = new Color(255, 255, 0, 100);
       Color orange = new Color(255, 136, 0, 100 );
      
       Color red = new Color( 255, 0, 0, 100 );
       renderer.addBreak(0, 4 , new SimpleFillSymbol(defaultColor, polygonOutline1, SimpleFillSymbol.Style.SOLID));
       renderer.addBreak(4, 5 , new SimpleFillSymbol(yellow, polygonOutline1, SimpleFillSymbol.Style.SOLID));
       renderer.addBreak(5, 6, new SimpleFillSymbol(orange, polygonOutline1, SimpleFillSymbol.Style.SOLID));
       // Double.POSITIVE_INFINITY does not work, use very large number instead
       renderer.addBreak(6, 10000, new SimpleFillSymbol(red, polygonOutline1, SimpleFillSymbol.Style.SOLID));
       graphicsLayer.setRenderer(renderer);
       map.getLayers().add(graphicsLayer);
      
       // Query  
       QueryTask queryTask = new QueryTask(usZipcodes);
       Query query = new Query();
      query.setOutSpatialReference(map.getSpatialReference());
      query.setOutFields(new String[] { "ZIP" });
      query.setReturnGeometry(true);
     
      query.setWhere("STATE='IL'");
      query.setReturnGeometry(true);
      FeatureSet featureSet = null;
     
      try {
              featureSet = queryTask.execute(query);
          }
          catch (Exception e)
          {
              logger.info("Starting");
              e.printStackTrace();
          }
     
      for(Graphic feature : featureSet.getGraphics())
      {
          Geometry geo=   feature.getGeometry();
          Symbol symbol=   feature.getSymbol();    
           Map<String, Object> data=   feature.getAttributes();
           int currentZipcode = Integer.valueOf((String) data.get("ZIP")) ;
        
             int color = summary== null?0: GetColor(summary.getPercentage(), summary.getMean(), summary.getSDev());
           //Object added = feature.getAttributes().put("prob", 4.5);
           data.put("prob", color);

         Graphic copied = new Graphic(geo, symbol, data, null);
         graphicsLayer.addGraphic(copied);
      }
 
      theFrame.validate();
        theFrame.setVisible(true) ;
0 Kudos
HelenAraya1
New Contributor
What kind of layers are you adding to the JMap ? dynamic layer from local map package, online web service, local tiled layer ?
In case you are loading a TPK or MPK file, as a resource file, it's working in local because the file is accessible, but in deployment your resource file are in the jar... so you  need to deploy or copy them outside the jar file for deployment.
I hope this can help you.


   ArcGISTiledMapServiceLayer tiledLayer = new ArcGISTiledMapServiceLayer(worldStreetMap);
  
       QueryTask queryTask = new QueryTask(usZipcodes);
      Query query = new Query();
      query.setOutSpatialReference(map.getSpatialReference());
      query.setOutFields(new String[] { "ZIP" });
      query.setReturnGeometry(true);
     
      query.setWhere("STATE='IL'");
0 Kudos
HelenAraya1
New Contributor
Does any body have a solution to the problem?
0 Kudos
HelenAraya1
New Contributor
Just a quick update. The map works on when I deployed it in home laptop which is windows 8.
But it does not work on the actual deployment machine which is windows server 2008 service pack 2 64 bit.
0 Kudos
CarlosColón-Maldonado
Occasional Contributor III
Just a quick update. The map works on when I deployed it in home laptop which is windows 8.
But it does not work on the actual deployment machine which is windows server 2008 service pack 2 64 bit.


I ran into a similar problem some time ago. Assuming that it works in your IDE, where the SDK is installed, I'd include all available sources to your deployment folder at first to ensure the local server has them as it has  it in development mode. Note also that, apparently (have not tested), the deployment builder for 10.2 has changed in that it now requires that only one specific platform (32/64) be set per deployment folder whereas the 10.1.1 allowed both types.

It's also good to spew out any messages the local server generates on initialization so that you'd know if the problem is not with it. See Methods in com.esri.client.local.LocalServer with parameters for adding a type ServerMessageListener. It might even tell you that your deployment license is not valid. It's important to note that your local server will work in dev mode even with an invalid license because your SDK is installed there with a valid one, but not on your test box.

Good luck, and happy new year to all!!
0 Kudos
EricBader
Occasional Contributor III
Hi Helen.

You said that things work fine on one machine, but not on another.
Are they both behind your firewall? Or is one inside and the other outside?
0 Kudos
HelenAraya1
New Contributor
Hi guys the problem was with meeting hardware requirements of Video/Graphics Adapter and Display Properties


My Windows 2008 machine shows n/a in dedicated video memory, 16 bit in color depth  which could be the potential cause.

IN
http://resources.arcgis.com/en/help/system-requirements/10.1../index.html#//015100000093000000
It says
64 MB RAM minimum; 256 MB RAM minimum recommended; NVIDIA, ATI, and INTEL chipsets are supported.
24-bit color depth


All the settings can be adjusted except the  dedicated video memory which requires changing using BIOS.
0 Kudos