Java SDK: AWT-EventQueue exception inside SwingUtilities.InvokeLater

172
2
10-21-2010 06:39 AM
New Contributor
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 exception

Exception 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
Reply
0 Kudos
2 Replies
New Contributor
Hello,

I am trying to get some samples from ArcGIS running. I get the same exception in some of them.
I always get the AutomationException: 0x80040112 - even in the RubberBandZoom example.
For e.g.
Exception in thread "main" java.lang.RuntimeException: AutomationException: 0x80
040112 -
        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.RubberBandZoom.getToolbarbean1(Unknown Source)
        at arcgissamples.display.RubberBandZoom.getJContentPane(Unknown Source)
        at arcgissamples.display.RubberBandZoom.initialize(Unknown Source)
        at arcgissamples.display.RubberBandZoom.<init>(Unknown Source)
        at arcgissamples.display.RubberBandZoom.main(Unknown Source)
        at arcgissamples.loadsample.Main.main(Unknown Source)
Caused by: AutomationException: 0x80040112 -
        ... 10 more


Could you get a solution to this? If so, please share...
I have a windows 7, 64-bit machine. I am running the samples with a 32-bit jvm.
Reply
0 Kudos
New Contributor
ToolbarBean class is also generating and Error on my setup as well even in the4 most basic capacity.

Here is the ST from the sample project run inside eclipse.

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.init(Unknown Source)
at com.esri.arcgis.beans.toolbar.ToolbarBean.<init>(Unknown Source)
at BasicViewer.getToolbarBean(BasicViewer.java:156)
at BasicViewer.getJContentPane(BasicViewer.java:115)
at BasicViewer.initialize(BasicViewer.java:88)
at BasicViewer.<init>(BasicViewer.java:77)
at BasicViewer.main(BasicViewer.java:144)
Caused by: AutomationException: 0x80040112 -

Any thought on this would be helpful.
Reply
0 Kudos