I had a gui set up that displayed menu items a window and some buttons at the bottom. i am having it communicate with an outside program using commands. i recieved a strange error msg after i tried to have it communicate with the other program. I know the gui worked before i tried linking it to the outside program.

this is the error stack....

agi.core.AgCoreException: java.lang.reflect.InvocationTargetException
at agi.core.AgUnknown.createInstance(Unknown Source)
at agi.core.AgUnknown.initialize(Unknown Source)
at agi.core.AgUnknown.<init>(Unknown Source)
at agi.stkobjects.AgStkObjectRootClass.<init>(Unknown Source)
at windowPanel.buildPanel(windowPanel.java:115)
at windowPanel.<init>(windowPanel.java:85)
at windowPanel.main(windowPanel.java:309)
Caused by: agi.core.awt.AgAwtException: java.lang.reflect.InvocationTargetException
at agi.core.awt.AgAwtToolkitThreadDelegate.invokeAndWait(Unknown Source)
at agi.AgWindowToolkitThreadDelegate.invokeAndWait(Unknown Source)
... 7 more
Caused by: java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(EventQueue.java:1042)
at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1326)
... 9 more
Caused by: agi.core.AgComException: Error creating the class instance.
at agi.stkobjects.AgStkObjectRootClass.CreateInstance(Native Method)
at agi.core.AgUnknown$CreateInstanceRunner.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:641)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:602)
at java.awt.EventQueue$1.run(EventQueue.java:600)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:611)
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)

i can attach the code if you want but its kinda long and has a lot of calls to the outside program that might not be understandable. let me know.

Dani AI

Generated

The stack names classes in the agi.* packages (notably AgStkObjectRootClass), which indicates this is the AGI / STK Java COM API rather than an Asterisk issue. ’s suggestion is understandable, but the trace and the AgComException: Error creating the class instance point to a failure instantiating the native COM/STK object — typically an environment/installation/licensing or bitness problem, not a Swing layout bug. ’s trace shows the failure happens while the COM object is created on the AWT/Swing thread.

Key triage steps (in order):

  • Confirm STK runs standalone and does not show license errors when launched.
  • Verify JVM/native bitness match (STK is often 32-bit): print the JVM arch and data model.
System.out.println(System.getProperty("os.arch"));
System.out.println(System.getProperty("sun.arch.data.model"));
  • Ensure the AGI/STK installation folders and native DLLs are on the process PATH and that the same user/permissions are used as for the STK GUI.
  • Run a minimal non-GUI test to isolate the problem from Swing and to capture the full native exception chain:
public class StkTest {
  public static void main(String[] args) {
    try {
      agi.stkobjects.AgStkObjectRootClass root = new agi.stkobjects.AgStkObjectRootClass();
      System.out.println("STK root created");
    } catch (Throwable e) {
      Throwable t = e;
      while (t != null) {
        System.err.println(t.getClass().getName() + ": " + t.getMessage());
        t = t.getCause();
      }
      e.printStackTrace();
    }
  }
}

Notes on threading and next steps:

  • AGI provides an AWT bridge (the AgAwtToolkitThreadDelegate/invokeAndWait pattern) so COM initialization on the EDT is normal; since the trace already shows that, a threading bug is less likely than an environment issue.
  • If the minimal test also fails, check bitness and licensing first, then compare PATH/classpath with any AGI sample applications that ship with STK. Avoid manual registry changes unless guided by vendor instructions.
  • When contacting AGI support, gather OS version, STK version, JVM vendor/version/bitness, and the full printed exception chain from the minimal test.

Looks like Exceptions being thrown and chained inside AGI - is the is Asterisk interface? If so, you will probably get an answer from their support forum.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.