Select to view content in your preferred language

Problems when open a samples

4636
13
09-17-2013 02:26 AM
IvanoIerace
Deactivated User
Hi,

I've installed the Runtime SDK for Java (10.1.1) without problems, but the Runtime Java Samples doesn't work very well.
It started without problems, but when I select one of samples, nothing appear on tabs and Console window shows an
exception ( see below )

has anyone had the same problem?

Thanks

Java version : 1.7.0_40 (Oracle Corporation) x86
Rendering engine : DirectX
- - - Executing sample com.esri.client.samples.mapping.tiledlayers.LocalTiledLayer - - -
Java version : 1.7.0_40 (Oracle Corporation) x86
Rendering engine : DirectX
Java version : 1.7.0_40 (Oracle Corporation) x86
Rendering engine : DirectX
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.esri.client.samples.SampleLauncher.launchSample(SampleLauncher.java:121)
at com.esri.client.samples.SampleViewer$11.valueChanged(SampleViewer.java:600)
at javax.swing.JTree.fireValueChanged(Unknown Source)
at javax.swing.JTree$TreeSelectionRedirector.valueChanged(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.fireValueChanged(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.notifyPathChange(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPaths(Unknown Source)
at javax.swing.tree.DefaultTreeSelectionModel.setSelectionPath(Unknown Source)
at javax.swing.JTree.setSelectionPath(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI.selectPathForEvent(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI$Handler.handleSelection(Unknown Source)
at javax.swing.plaf.basic.BasicTreeUI$Handler.mousePressed(Unknown Source)
at java.awt.AWTEventMulticaster.mousePressed(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at com.esri.client.samples.mapping.tiledlayers.LocalTiledLayer.createMap(LocalTiledLayer.java:137)
at com.esri.client.samples.mapping.tiledlayers.LocalTiledLayer.createUI(LocalTiledLayer.java:80)
... 48 more
0 Kudos
13 Replies
IvanoIerace
Deactivated User
Mark,

I understand, but doesn't contains non utf8 characters.

I.
0 Kudos
IvanoIerace
Deactivated User
I'm continuing my investigation and I noted that some samples, in Arcgis sdk samples application, works and other partially works.

For instance "Local Server" and "Console App" samples works without problems.
The Sample "Portal" in "Web Maps" section, partially works; the two lists are filled dynamically from the web, but when I push the "Display selected WebMap" button an error dialog appears with WebMap cannot initialize JMap message and java console shows this exception:

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
     at com.esri.map.JMap.setBounds(Unknown Source)
     at java.awt.BorderLayout.layoutContainer(Unknown Source)
     ....
     ....

After this I create an eclipse project with the source code of Portal sample. When I start it the lists are empty because an
exception is generted:

Failed to fetch portal.Error while generating a token
com.esri.core.io.EsriSecurityException: Error while generating a token
at com.esri.core.internal.io.handler.c.a(Unknown Source)
at com.esri.core.internal.io.handler.c.b(Unknown Source)
at com.esri.core.internal.io.handler.l.a(Unknown Source)
at com.esri.core.internal.io.handler.l.a(Unknown Source)
at com.esri.core.internal.tasks.a.s.a(Unknown Source)
at com.esri.core.portal.Portal.fetchPortalInfo(Unknown Source)
at com.esri.client.samples.webmap.FeaturedGroupListApp$FetchPortalThread.run(FeaturedGroupListApp.java:88)
Caused by: java.net.UnknownHostException: arcgis.com
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
at com.esri.core.internal.io.handler.j.connectSocket(Unknown Source)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:123)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:147)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:108)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:641)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:731)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:709)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:700)
at com.esri.core.internal.io.handler.c.a(Unknown Source)
... 6 more


For your information, arcgis.com is accessible by a browser from my computer and the user and pws used in the sample works.

It seems has problems with connection,but I don't understand what. (the proxy is correctly configure)

thanks
0 Kudos
JeremieJoalland1
Deactivated User
Are you sure you don't have a map services / wms access issue ?
Have you tried to replace basemap url of esri samples by your own Tile/Map Package ?

Usually, in createMap() you just need to replace ArcGISTiledMapServiceLayer by ArcGISLocalTiledLayer pointing on a local file url (..\ArcGIS SDKs\java10.1.1\sdk\samples\data\..)

I know in my case, even if I can access all ArcGIS website, I can't use samples because of proxy constraints from my company security policies, so I replace all samples to load my own TPK basemap or use a local GeoServer to test WMS.

Jeremie
0 Kudos
IvanoIerace
Deactivated User
Are you sure you don't have a map services / wms access issue ?
Have you tried to replace basemap url of esri samples by your own Tile/Map Package ?

Usually, in createMap() you just need to replace ArcGISTiledMapServiceLayer by ArcGISLocalTiledLayer pointing on a local file url (..\ArcGIS SDKs\java10.1.1\sdk\samples\data\..)

I know in my case, even if I can access all ArcGIS website, I can't use samples because of proxy constraints from my company security policies, so I replace all samples to load my own TPK basemap or use a local GeoServer to test WMS.

Jeremie


Jeremie,

I follow your suggest about ArcGISTiledMapServiceLayer  and now I watch map on my test application. Evidently our network system engineer give me wrong information about our network proxy filters.

Before open this thread, I had replaced ArcGISTiledMapServiceLayer  with ArcGISLocalDynamicMapServiceLayer , but it didn't work (probably for my mistake).

However thuesday I'm going to meet ESRI consultant.

Merci
0 Kudos