<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unable to instantiate ArcGISMap from this webMapUrl in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/unable-to-instantiate-arcgismap-from-this/m-p/1397778#M2849</link>
    <description>&lt;P&gt;I'm just starting with the Java SDK. I'm using OpenJDK 19.0.2. The map loads fine when running from the IDE. Once I build a standalone package using jlink, things start to act strangely. It works most of the times, but from time to time it fails to start and gives this error:&lt;/P&gt;&lt;P&gt;java.lang.IllegalArgumentException: Unable to instantiate ArcGISMap from this webMapUrl&lt;BR /&gt;at b4j/com.esri.arcgisruntime.mapping.ArcGISMap.&amp;lt;init&amp;gt;(Unknown Source)&lt;BR /&gt;... 28 more&lt;/P&gt;&lt;P&gt;Is there any way to get more information about the cause of failure?&lt;/P&gt;</description>
    <pubDate>Tue, 19 Mar 2024 12:54:53 GMT</pubDate>
    <dc:creator>ErelUziel</dc:creator>
    <dc:date>2024-03-19T12:54:53Z</dc:date>
    <item>
      <title>Unable to instantiate ArcGISMap from this webMapUrl</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/unable-to-instantiate-arcgismap-from-this/m-p/1397778#M2849</link>
      <description>&lt;P&gt;I'm just starting with the Java SDK. I'm using OpenJDK 19.0.2. The map loads fine when running from the IDE. Once I build a standalone package using jlink, things start to act strangely. It works most of the times, but from time to time it fails to start and gives this error:&lt;/P&gt;&lt;P&gt;java.lang.IllegalArgumentException: Unable to instantiate ArcGISMap from this webMapUrl&lt;BR /&gt;at b4j/com.esri.arcgisruntime.mapping.ArcGISMap.&amp;lt;init&amp;gt;(Unknown Source)&lt;BR /&gt;... 28 more&lt;/P&gt;&lt;P&gt;Is there any way to get more information about the cause of failure?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 12:54:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/unable-to-instantiate-arcgismap-from-this/m-p/1397778#M2849</guid>
      <dc:creator>ErelUziel</dc:creator>
      <dc:date>2024-03-19T12:54:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to instantiate ArcGISMap from this webMapUrl</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/unable-to-instantiate-arcgismap-from-this/m-p/1397937#M2850</link>
      <description>&lt;P&gt;I've added some code below which shows you how to check the cause of an error when loading a Portal or a PortalItem&lt;/P&gt;&lt;LI-CODE lang="java"&gt;Portal portal = new Portal("https://www.arcgis.com/");
      System.out.println("loading portal");
      portal.loadAsync();
      portal.addDoneLoadingListener(()-&amp;gt; {
        //check status of portal loading
        System.out.println("Portal load status " + portal.getLoadStatus());
        if (portal.getLoadStatus() == LoadStatus.LOADED) {
          // portal loaded okay so let's try the portal item
          PortalItem portalItem = new PortalItem(portal, "92ad152b9da94dee89b9e387dfe21acd");
          portalItem.loadAsync();
          portalItem.addDoneLoadingListener(()-&amp;gt; {
            // check portal item load status
            System.out.println("portal item load status " + portalItem.getLoadStatus());
            if (portalItem.getLoadStatus() == LoadStatus.LOADED) {
              // make map from portal item and add to mapview it displays
              ArcGISMap map = new ArcGISMap(portalItem);
              mapView = new MapView();
              mapView.setMap(map);

              // add the map view to the stack pane
              stackPane.getChildren().addAll(mapView);

            } else {
              System.out.println("portal item failed to load");
              System.out.println(portalItem.getLoadError().getCause());
            }
          });
        } else {
          System.out.println("portal failed to load");
          System.out.println(portal.getLoadError().getCause());
        }
      });&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure why you are specifically getting the error above, but you might get some clues from the code above.&lt;/P&gt;&lt;P&gt;I would also not use Java 19, this isn't an LTS release and isn't supported.&amp;nbsp; Ideally you should be using Java 21.&lt;/P&gt;&lt;P&gt;You should also read this &lt;A href="https://www.esri.com/arcgis-blog/products/sdk-java/announcements/announcing-the-deprecation-of-arcgis-maps-sdk-for-java/" target="_self"&gt;blog&lt;/A&gt; post which says that we are about to deprecate the Java SDK, so you should consider an alternative technology for new projects.&lt;/P&gt;&lt;P&gt;Does this help?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Mar 2024 16:12:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/unable-to-instantiate-arcgismap-from-this/m-p/1397937#M2850</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2024-03-19T16:12:20Z</dc:date>
    </item>
  </channel>
</rss>

