<?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 Re: Accessing a webmap in Arcgis enterprise from ArcGIS Runtime Java Application in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/accessing-a-webmap-in-arcgis-enterprise-from/m-p/1055076#M2357</link>
    <description>&lt;P&gt;Had adding the doneLoadingListener allowed you to fix the issue?&lt;/P&gt;&lt;P&gt;For detecting loading issues, you can look at the load status to see if it failed to load.&amp;nbsp; I've updated my code to include a bad web address and reported the error in the console:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;            // portal we want to use.  NOTE the bad web address!
            Portal portal = new Portal("chttp://www.arcgis.com/");

            //trigger a load
            portal.loadAsync();

            // listen to it loading before reading
            portal.addDoneLoadingListener(() -&amp;gt; {
                // check is has loaded
                if (portal.getLoadStatus() == LoadStatus.LOADED) {
                    // all is well and we can now read the portal info
                    System.out.println("waiting for it to load we get : " + portal.getPortalInfo().getPortalName());
                }

                // check for error condition
                if (portal.getLoadStatus() == LoadStatus.FAILED_TO_LOAD) {
                    System.out.println("load failure message : " + portal.getLoadError().getMessage());
                    System.out.println("load failure cause " + portal.getLoadError().getCause());
                }
            });&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 06 May 2021 08:58:49 GMT</pubDate>
    <dc:creator>MarkBaird</dc:creator>
    <dc:date>2021-05-06T08:58:49Z</dc:date>
    <item>
      <title>Accessing a webmap in Arcgis enterprise from ArcGIS Runtime Java Application</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/accessing-a-webmap-in-arcgis-enterprise-from/m-p/1053116#M2352</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to access a webmap in my enterprise portal (airgapped) from&amp;nbsp; a runtime java application. When I try to access my enterprise portal using the following code&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;AuthenticationManager.setAuthenticationChallengeHandler(&lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt;&lt;SPAN&gt; DefaultAuthenticationChallengeHandler());&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Portal portal = new Portal("&lt;A href="http://xyz.com/arcgisportal&amp;quot;,true&amp;quot;)&amp;nbsp;" target="_blank"&gt;http://xyz.com/arcgisportal",true")&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;portal.loadAsync()&lt;/P&gt;&lt;P&gt;&amp;nbsp;A new window for entering user credentials is appearing on the screen and I have entered the credentials,&amp;nbsp; but I am not able to access the webmap and when i Print&lt;/P&gt;&lt;P&gt;System.out.println(portal.getPortalInfo);&lt;/P&gt;&lt;P&gt;Null is coming.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Pls Suggest a solution&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;J Jacob&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 11:33:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/accessing-a-webmap-in-arcgis-enterprise-from/m-p/1053116#M2352</guid>
      <dc:creator>JomonJacob</dc:creator>
      <dc:date>2021-04-30T11:33:30Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing a webmap in Arcgis enterprise from ArcGIS Runtime Java Application</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/accessing-a-webmap-in-arcgis-enterprise-from/m-p/1054149#M2353</link>
      <description>&lt;P&gt;I wonder if you are reading the portalInfo on the line of code which is after portal.loadAsync() ?&lt;/P&gt;&lt;P&gt;It is entirely possible you will get a null value back because you've read the value before the portal has had chance to load.&amp;nbsp; Some asynchronous coding which uses the loadable pattern will help you here, even it only helps to diagnose the issue.&lt;/P&gt;&lt;P&gt;Some background notes on this are &lt;A href="https://developers.arcgis.com/java/programming-patterns/loadable/" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;So in your example you should add a DoneLoadingListener something like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="java"&gt;// portal we want to use
Portal portal = new Portal("http://www.arcgis.com/");

//trigger a load
portal.loadAsync();

// listen to it loading before reading
portal.addDoneLoadingListener(() -&amp;gt; {
    // check it is has loaded
    if (portal.getLoadStatus() == LoadStatus.LOADED) {
         // all is well and we can now read the portal info
         System.out.println("waiting for it to load we get : " + portal.getPortalInfo().getPortalName());
    }
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also use the listener to diagnose loading issues.&lt;/P&gt;&lt;P&gt;Does this help?&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 16:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/accessing-a-webmap-in-arcgis-enterprise-from/m-p/1054149#M2353</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2021-05-04T16:11:29Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing a webmap in Arcgis enterprise from ArcGIS Runtime Java Application</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/accessing-a-webmap-in-arcgis-enterprise-from/m-p/1055064#M2355</link>
      <description>&lt;P&gt;Thank you for replying.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with addDoneLoadListner only.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you pls elaborate on "You can also use the listener to diagnose loading issues"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;</description>
      <pubDate>Thu, 06 May 2021 07:12:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/accessing-a-webmap-in-arcgis-enterprise-from/m-p/1055064#M2355</guid>
      <dc:creator>JomonJacob</dc:creator>
      <dc:date>2021-05-06T07:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing a webmap in Arcgis enterprise from ArcGIS Runtime Java Application</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/accessing-a-webmap-in-arcgis-enterprise-from/m-p/1055076#M2357</link>
      <description>&lt;P&gt;Had adding the doneLoadingListener allowed you to fix the issue?&lt;/P&gt;&lt;P&gt;For detecting loading issues, you can look at the load status to see if it failed to load.&amp;nbsp; I've updated my code to include a bad web address and reported the error in the console:&lt;/P&gt;&lt;LI-CODE lang="java"&gt;            // portal we want to use.  NOTE the bad web address!
            Portal portal = new Portal("chttp://www.arcgis.com/");

            //trigger a load
            portal.loadAsync();

            // listen to it loading before reading
            portal.addDoneLoadingListener(() -&amp;gt; {
                // check is has loaded
                if (portal.getLoadStatus() == LoadStatus.LOADED) {
                    // all is well and we can now read the portal info
                    System.out.println("waiting for it to load we get : " + portal.getPortalInfo().getPortalName());
                }

                // check for error condition
                if (portal.getLoadStatus() == LoadStatus.FAILED_TO_LOAD) {
                    System.out.println("load failure message : " + portal.getLoadError().getMessage());
                    System.out.println("load failure cause " + portal.getLoadError().getCause());
                }
            });&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 06 May 2021 08:58:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/accessing-a-webmap-in-arcgis-enterprise-from/m-p/1055076#M2357</guid>
      <dc:creator>MarkBaird</dc:creator>
      <dc:date>2021-05-06T08:58:49Z</dc:date>
    </item>
  </channel>
</rss>

