I've just begun to test Java SDK for ArcGIS 10. I've tried to run some basic samples to test the environment, and I've found I receive an exception when I use GUI beans inside the AWT eventqueu thread (this is from DynamicDisplayApp example):public static void main(String[] args) {
initializeInterop();
initializeArcGISLicenses();
final DynamicDisplayApp map = new DynamicDisplayApp();
map.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
map.initializeUI();
map.setVisible(true);
}
});
Invoking the initialization of the mapbean causes the followind exceptionException in thread "AWT-EventQueue-0" java.lang.RuntimeException: AutomationException: 0x80040112 -
at com.esri.arcgis.interop.Ocx.<init>(Unknown Source)
at com.esri.arcgis.controls.ToolbarControl.<init>(Unknown Source)
at com.esri.arcgis.beans.toolbar.ToolbarBean.a(Unknown Source)
at com.esri.arcgis.beans.toolbar.ToolbarBean.<init>(Unknown Source)
at arcgissamples.display.DynamicDisplayApp.getToolbarBean(DynamicDisplayApp.java:156)
at arcgissamples.display.DynamicDisplayApp.getJContentPane(DynamicDisplayApp.java:113)
at arcgissamples.display.DynamicDisplayApp.initializeUI(DynamicDisplayApp.java:91)
at arcgissamples.display.DynamicDisplayApp.access$0(DynamicDisplayApp.java:89)
at arcgissamples.display.DynamicDisplayApp$2.run(DynamicDisplayApp.java:143)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: AutomationException: 0x80040112 -
... 17 more
This doesn't happen if the mapbean is created not inside the invokelater methos (see RubberBandZoom exemple).Giovanni