JNIWrapper3.9 com.jniwrapper.win32.automation.AutomationException: error code: 0x80020009; DISP_E_EX

424 views
Skip to first unread message

rudresh ns

unread,
Dec 16, 2014, 2:27:11 AM12/16/14
to jniwrapp...@teamdev.com
hi,

I'm facing below mentioned exception when trying to initialize my application which calls .Automation.invokeDispatch.


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.jniwrapper.win32.MessageLoopThread$MethodInvocationAction.run(MessageLoopThread.java:732)
at com.jniwrapper.win32.MessageLoopThread$LoopThread.run(MessageLoopThread.java:562)
Caused by: com.jniwrapper.win32.automation.AutomationException: COM object method returns error code: 0x80020009; DISP_E_EXCEPTION (Exception occurred.)
at com.jniwrapper.win32.com.impl.IUnknownImpl.invokeStandardVirtualMethod(SourceFile:762)
at com.jniwrapper.win32.com.impl.IUnknownImpl.invokeStandardVirtualMethod(SourceFile:741)
at com.jniwrapper.win32.automation.impl.IDispatchImpl.invoke(SourceFile:112)
at com.jniwrapper.win32.automation.Automation$InvocationHelper.a(SourceFile:1104)
at com.jniwrapper.win32.automation.Automation$InvocationHelper.a(SourceFile:1095)
at com.jniwrapper.win32.automation.Automation$InvocationHelper.invoke(SourceFile:1082)
at com.jniwrapper.win32.automation.Automation.a(SourceFile:898)
at com.jniwrapper.win32.automation.Automation.invoke(SourceFile:875)
at com.jniwrapper.win32.automation.Automation.invoke(SourceFile:948)
at com.jniwrapper.win32.automation.Automation.invokeDispatch(SourceFile:1207)
at slpax.slpaxlib.impl._DslpaxImpl.initialize(_DslpaxImpl.java:60)

I'm currently using jniwrapper 3.9 version of jar with comfyj11
Observation: jniwrapper 3.9 package still contains jniwrap.dll 3.8 version.

Please suggest

regards,
Rudresh

rudresh ns

unread,
Dec 16, 2014, 3:10:55 AM12/16/14
to jniwrapp...@teamdev.com
hi,

Just to give a background-

Our's is 32 bit application.

I'm upgrading from JNIWrapper 3.8.4 to 3.9 version.
changes made-
jniwrap-3.9.jar
comfyj-2.11.jar
winpack-3.9.jar
jniwrap.dll
jniwrap.lic
comfyj.lic

There were no exceptions earlier and application was working fine with 3.8.4 version.
After migrating to 3.9 version, below exceptions are observed and application fails to initialize.

Sergei Piletsky

unread,
Dec 16, 2014, 7:32:55 AM12/16/14
to rudresh ns, jniwrapp...@teamdev.com
Hi,

In order to figure out a cause of that DISP_E_EXCEPTION COM exception you can add the catching of AutomationException when calling the initialize() method of _DslpaxImpl object in your application. The following code demonstrates how you can do that:
_DslpaxImpl dslpax = ...;
try {
    dslpax.initialize();
} catch (AutomationException e) {
    String description = e.getExceptionInformation().getBstrDescription();
    System.err.println("Error description: " + description);
}

Hopefully, a description provided by _Dslpax COM object should contain explanation of the issue.

Regards,
Sergei

--
You received this message because you are subscribed to the Google Groups "JNIWrapper Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jniwrapper-for...@teamdev.com.
To post to this group, send email to jniwrapp...@teamdev.com.
Visit this group at http://groups.google.com/a/teamdev.com/group/jniwrapper-forum/.
For more options, visit https://groups.google.com/a/teamdev.com/d/optout.

rudresh ns

unread,
Dec 16, 2014, 7:59:08 AM12/16/14
to jniwrapp...@teamdev.com, nsru...@gmail.com
hi,
 
Thanks for the reply.
I came across this approach in another thread on the same forum and tried to print description of AutomationException
 
Unfortunately, there is no description  returned and prints nothing.
 
regards,
Rudresh

Sergei Piletsky

unread,
Dec 16, 2014, 8:20:41 AM12/16/14
to rudresh ns, jniwrapp...@teamdev.com
Rudresh,

It's quite difficult to diagnose a cause of the issue in this case, even when a COM object itself provides no meaningful information about the error.

I also think that not the upgrading to version 3.9 was the actual cause of the issue. Most probably it has something to do with improper initialization of the object, for example the initialize() method is called before an embedded _Dslpax object is activated in OleContainer. So, in that case you just need to make sure that initialize() method is called after embedded object becomes visible.

If that suggestion does not help, then you can help you out with this issue. You just need to send your sample Java application that reproduces the issue to ComfyJ support email. We will analyze the problem and provide you with a solution.

Regards,
Sergei

rudresh ns

unread,
Dec 17, 2014, 12:57:26 AM12/17/14
to jniwrapp...@teamdev.com, nsru...@gmail.com
 
some more investigation and observation:
 
when Comfyj 2.11 is used
our code is failing when parameters are passed to Automation.invokeDispatch() method.

We are passing logFileName and eventId as parameters from Java. These are used for logging in C++ code.

if we don't pass any parameters, it goes through.

 

when Comfyj 2.10 was used

there is no error irrespective of passing or not passing parameters to Automation.invokeDispatch() method

 

 

I found the following differences for invokeDispatch() method  in Comfyj 2.11 v/s 2.10 in documentation-

 

-----------------------------------------------------

 

Comfyj 2.11 - http://www.teamdev.com/downloads/comfyj/javadoc/com/jniwrapper/win32/automation/Automation.html#invokeDispatch(com.jniwrapper.win32.automation.IDispatch, com.jniwrapper.win32.automation.types.DispID, com.jniwrapper.win32.automation.types.DispParams)

invokeDispatch

public static java.lang.Object invokeDispatch(IDispatch dispatch,java.lang.String methodName,Parameter[] args,java.lang.Class returnValueClass)

Invokes the method through dispatch interface reference.

Parameters:

dispatch - dispatch interface reference

methodName - dispid of the invoked method

args - array of arguments

returnValueClass - return value type

Returns:

result of method invocation

Throws:

ComException - when the method invocation is failed

 

--------------------------------------------------------------------

Comfyj 2.10 - http://static1.teamdev.com/downloads/comfyj/javadoc/com/jniwrapper/win32/automation/Automation.html#invokeDispatch(com.jniwrapper.win32.automation.IDispatch, com.jniwrapper.win32.automation.types.DispID, com.jniwrapper.win32.automation.types.DispParams)

invokeDispatch

public static java.lang.Object invokeDispatch(IDispatch dispatch,java.lang.String methodName,Parameter[] args,java.lang.Class returnValueClass)

Invokes the method through dispatch interface reference.

Parameters:

dispatch - dispatch interface reference

methodName - dispid of the invoked method

args -

Returns:

result of method invocation

Throws:

ComException - when the method invocation is failed

 

--------------------------------------------------------------------------

  

Not sure whether documentation for 2.10 is incomplete. May be implementation is changed in 2.11.

Any thoughts on this?

 

thanks for the support.

Rudresh

Sergei Piletsky

unread,
Dec 17, 2014, 6:29:38 AM12/17/14
to rudresh ns, jniwrapp...@teamdev.com
No, implementation of that method was not changed.

Sergei

Reply all
Reply to author
Forward
0 new messages