Skip to main content

Com4j not a proxy instance

2 replies [Last post]
Joined: 2009-02-15

I've got a problem using the com4j Framework.
I have an interface, which needs an instance of a special class as argument. First an IllegalArgumentException has been thrown caused by the fact, that the passed argument was not a proxy instance. So I tried to work around and created this argument as a proxy instance. (Proxy.newProxyInstance(...)). But now, I get a cast exception. Obviously the com4j Framework tries to cast the argument to the class "com4j.Wrapper".
What am I doing wrong?

Thank you and Best regards.

Message was edited by: datalogen

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2009-02-15

Maybe it's just a question about whether or not com4j supports callbacks.

Joined: 2009-04-08

Hi i am using latest release (com4j-20080107) from here to generate and use one of the type libraries at runtime. But i am getting following issue. Could any body suggest the solution. I have tried latest JREs as well. Can any body give me if there is any updated com4j available after to the above mentioed release?

thanks in advance

# An unexpected error has been detected by HotSpot Virtual Machine:
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c9109f9, pid=5244, tid=1704
# Java VM: Java HotSpot(TM) Client VM (1.5.0_06-b05 mixed mode)
# Problematic frame:
# C [ntdll.dll+0x109f9]

--------------- T H R E A D ---------------

Current thread (0x0aeb8f50): JavaThread "ComThread for main" daemon [_thread_in_native, id=1704]

siginfo: ExceptionCode=0xc0000005, reading address 0x00000010

EAX=0x000bca10, EBX=0x00090000, ECX=0x00000010, EDX=0x00003f50
ESP=0x0b49f734, EBP=0x0b49f740, ESI=0x000bca08, EDI=0x000bc9a0
EIP=0x7c9109f9, EFLAGS=0x00010246

Top of Stack: (sp=0x0b49f734)
0x0b49f734: 00090000 000bc9c8 00000000 0b49f814
0x0b49f744: 7c91082c 000901c8 00000010 0b49f7f8
0x0b49f754: 00000000 00000010 77606034 000bc9d0
0x0b49f764: 00000000 0b49f8f4 000c42d4 000901c8
0x0b49f774: 0b49f88c 00000004 00000000 0b49f790
0x0b49f784: 000901c8 00000010 00000018 0b49f858
0x0b49f794: 00000010 00000018 00000006 0aeb8f50
0x0b49f7a4: 00000000 6d6e5e45 00000006 0aeb8f50

Instructions: (pc=0x7c9109f9)
0x7c9109e9: 85 92 00 00 00 8b 4e 0c 8d 46 08 8b 10 89 4d 0c
0x7c9109f9: 8b 09 3b 4a 04 89 55 14 0f 85 2b 0d 00 00 3b c8

Stack: [0x0b460000,0x0b4a0000), sp=0x0b49f734, free space=253k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [ntdll.dll+0x109f9]
C [ntdll.dll+0x1082c]
C [ole32.dll+0x1d01c]
C [OLEAUT32.dll+0x4aa8]
C [OLEAUT32.dll+0x48b5]

Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com4j.Native.invoke(II[Ljava/lang/Object;[IIZI)Ljava/lang/Object;+0
j com4j.StandardComMethod.invoke(I[Ljava/lang/Object;)Ljava/lang/Object;+108
j com4j.Wrapper$;+15
j com4j.Task.invoke()V+17
j com4j.ComThread.run0()V+83
v ~StubRoutines::call_stub

--------------- P R O C E S S ---------------

Java Threads: ( => current thread )
=>0x0aeb8f50 JavaThread "ComThread for main" daemon [_thread_in_native, id=1704]
0x00aaa300 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=3012]
0x00aaf390 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2148]
0x00aa8550 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=2832]
0x00aa5578 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=5236]
0x00aa4118 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=2828]
0x00379010 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_blocked, id=5224]
0x00a88f90 JavaThread "Finalizer" daemon [_thread_blocked, id=4100]
0x00a87af8 JavaThread "Reference Handler" daemon [_thread_blocked, id=5240]
0x003787b0 JavaThread "main" [_thread_blocked, id=2544]

Other Threads:
0x00a480d0 VMThread [id=4596]
0x00aa1158 WatcherThread [id=656]

VM state:not at safepoint (normal execution)

VM Mutex/Monitor currently owned by a thread: None

def new generation total 576K, used 560K [0x02ad0000, 0x02b70000, 0x02fb0000)
eden space 512K, 97% used [0x02ad0000, 0x02b4c330, 0x02b50000)
from space 64K, 100% used [0x02b50000, 0x02b60000, 0x02b60000)
to space 64K, 0% used [0x02b60000, 0x02b60000, 0x02b70000)
tenured generation total 1408K, used 279K [0x02fb0000, 0x03110000, 0x06ad0000)
the space 1408K, 19% used [0x02fb0000, 0x02ff5cc0, 0x02ff5e00, 0x03110000)
compacting perm gen total 8192K, used 2768K [0x06ad0000, 0x072d0000, 0x0aad0000)
the space 8192K, 33% used [0x06ad0000, 0x06d841c0, 0x06d84200, 0x072d0000)
No shared spaces configured.

Dynamic libraries:
0x00400000 - 0x0040c000 C:\JDeveloper10133\jdk\bin\javaw.exe
0x7c900000 - 0x7c9af000 C:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f6000 C:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 C:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f02000 C:\WINDOWS\system32\RPCRT4.dll
0x77fe0000 - 0x77ff1000 C:\WINDOWS\system32\Secur32.dll
0x7e410000 - 0x7e4a1000 C:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f59000 C:\WINDOWS\system32\GDI32.dll
0x77c10000 - 0x77c68000 C:\WINDOWS\system32\MSVCRT.dll
0x76390000 - 0x763ad000 C:\WINDOWS\system32\IMM32.DLL
0x629c0000 - 0x629c9000 C:\WINDOWS\system32\LPK.DLL
0x74d90000 - 0x74dfb000 C:\WINDOWS\system32\USP10.dll
0x6d6e0000 - 0x6d874000 C:\JDeveloper10133\jdk\jre\bin\client\jvm.dll
0x76b40000 - 0x76b6d000 C:\WINDOWS\system32\WINMM.dll
0x6d2f0000 - 0x6d2f8000 C:\JDeveloper10133\jdk\jre\bin\hpi.dll
0x76bf0000 - 0x76bfb000 C:\WINDOWS\system32\PSAPI.DLL
0x6d3f0000 - 0x6d425000 C:\JDeveloper10133\jdk\jre\bin\jdwp.dll
0x6d6b0000 - 0x6d6bc000 C:\JDeveloper10133\jdk\jre\bin\verify.dll
0x6d370000 - 0x6d38d000 C:\JDeveloper10133\jdk\jre\bin\java.dll
0x6d6d0000 - 0x6d6df000 C:\JDeveloper10133\jdk\jre\bin\zip.dll
0x6d290000 - 0x6d297000 C:\JDeveloper10133\jdk\jre\bin\dt_socket.dll
0x71ab0000 - 0x71ac7000 C:\WINDOWS\system32\WS2_32.dll
0x71aa0000 - 0x71aa8000 C:\WINDOWS\system32\WS2HELP.dll
0x55600000 - 0x5561d000 C:\Program Files\Microsoft Firewall Client\wspwsp.dll
0x76d60000 - 0x76d79000 C:\WINDOWS\system32\iphlpapi.dll
0x71a50000 - 0x71a8f000 C:\WINDOWS\system32\mswsock.dll
0x662b0000 - 0x66308000 C:\WINDOWS\system32\hnetcfg.dll
0x71a90000 - 0x71a98000 C:\WINDOWS\System32\wshtcpip.dll
0x10000000 - 0x10044000 C:\WINDOWS\system32\com4j.dll
0x774e0000 - 0x7761d000 C:\WINDOWS\system32\ole32.dll
0x77120000 - 0x771ab000 C:\WINDOWS\system32\OLEAUT32.dll
0x5ad70000 - 0x5ada8000 C:\WINDOWS\system32\uxtheme.dll
0x74720000 - 0x7476c000 C:\WINDOWS\system32\MSCTF.dll
0x76fd0000 - 0x7704f000 C:\WINDOWS\system32\CLBCATQ.DLL
0x77050000 - 0x77115000 C:\WINDOWS\system32\COMRes.dll
0x77c00000 - 0x77c08000 C:\WINDOWS\system32\VERSION.dll
0x0b4b0000 - 0x0b775000 C:\WINDOWS\system32\xpsp2res.dll
0x7d1e0000 - 0x7d49c000 C:\WINDOWS\system32\msi.dll
0x7e720000 - 0x7e7d0000 C:\WINDOWS\system32\SXS.DLL

VM Arguments:
jvm_args: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=1329 -Dhttp.proxyHost=awrisa -Dhttp.proxyPort=8080 -Dhttp.nonProxyHosts=*|localhost|10.*|GITLDXB65DEV -Dhttps.proxyHost=awrisa -Dhttps.proxyPort=8080 -Dhttps.nonProxyHosts=*|localhost|10.*|GITLDXB65DEV
java_command: oracle.jdevimpl.junit.runner.TestRunner
Launcher Type: SUN_STANDARD

Environment Variables:
CLASSPATH=C:\product\\OraBPEL_1\MOBILE\Sdk\bin\OLITE40.JAR;C:\javaex;C:\Program Files\Java\jdk1.5.0_14\lib;.;C:\Documents and Settings\bennyj\Desktop\SWTtoCOM-1.2\args4j-2.0.1.jar;C:\Documents and Settings\bennyj\Desktop\SWTtoCOM-1.2\jatlom-1.3.jar;C:\Documents and Settings\bennyj\Desktop\SWTtoCOM-1.2\swttocom-generator-1.2.jar;
PATH=C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\oracle\product\10.2.0\client_2\bin;C:\OraHome_1\bin;C:\OracleBI\server\Bin;C:\OracleBI\web\bin;C:\OracleBI\web\catalogmanager;C:\OracleBI\SQLAnywhere;C:\Program Files\Java\jdk1.5.0_14\bin;C:\ORANT\WF\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\orant\bin;C:\Program Files\Borland\Delphi5\Bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\orant\jdk\bin;C:\product\\OraBPEL_1\MOBILE\sdk\bin;C:\Program Files\Java\jdk1.5.0_14\bin;C:\Program Files\Common Files\Telelogic\SA;c:\Program Files\Microsoft SQL Server\90\Tools\binn\

[error occurred during error reporting, step 220, id 0xc0000005]

--------------- S Y S T E M ---------------

OS: Windows XP Build 2600 Service Pack 3

CPU:total 2 family 6, cmov, cx8, fxsr, mmx, sse, sse2, ht

Memory: 4k page, physical 2097151k(1270844k free), swap 4194303k(2946160k free)

vm_info: Java HotSpot(TM) Client VM (1.5.0_06-b05) for windows-x86, built on Nov 10 2005 11:12:14 by "java_re" with MS VC++ 6.0