Исключение при использовании оболочки C # с C API из приложения Java

Я пытаюсь использовать код C # из C API. C API фактически доступен из приложения Java.

Я создал оболочку C ++ / CLI для вызова простой функции C # и убедился, что она работает с помощью простого консольного приложения C ++. Я также написал C ++ DLL, которая успешно работает с C API, опубликованным с программой Java. Хотя, когда я пытаюсь использовать эту же программу для вызова оболочки C ++ / CLI, Java-программа хоста немедленно завершает работу без каких-либо ошибок. Затем я попытался создать экземпляр объекта C ++ / CLI и вызвать функцию-член в блоке try / catch, но он по-прежнему завершается немедленно. Вот мой код:

try
{
CutLoggerGraphWrapper obj;
obj.SetRdoc(1.234);
}
catch (exception & e)
{
AllocConsole();
freopen("CONIN$", "r", stdin);
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
cout << e.what() << endl;
FreeConsole();
}

Когда я присоединяю сеанс отладки в Visual Studio к приложению Java (javaw.exe), происходит сбой в строке «CutLoggerGraphWrapper obj».

Я попытался разместить свои библиотеки в нескольких местах, в том числе в той же папке, что и библиотеки Java-приложений, а затем в папке, которая указана в переменной среды PATH. Я думал, что это не может быть загрузка оболочки или C # DLL. Это ничего не изменило. Я не смог понять, в чем проблема может быть из вывода Visual Studio. Вот сообщение из окна вывода. Какие-либо предложения?

'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\javaw.exe'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\kernel32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\KernelBase.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\advapi32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\msvcrt.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\sechost.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\rpcrt4.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\user32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\gdi32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\lpk.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\usp10.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\imm32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\msctf.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\nvinitx.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\server\jvm.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\winmm.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\hpi.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\psapi.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\verify.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\java.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\zip.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\awt.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\winspool.drv'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\ole32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\shell32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\shlwapi.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\uxtheme.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\fontmanager.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\dwmapi.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\cryptbase.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\apphelp.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\net.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\ws2_32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\nsi.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\mswsock.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\wship6.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\nio.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\jpeg.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Program Files (x86)\DisplayFusion\Hooks\AppHookx64_678D2E40-CE87-49FD-B8A9-B7BDE75F14AB.dll'. Module was built without symbols.
'javaw.exe' (Win32): Loaded 'C:\Windows\winsxs\amd64_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.17514_none_a4d6a923711520a9\comctl32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\clbcatq.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\oleaut32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\vericut\CGTech.dll'. Module was built without symbols.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\wsock32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\winsxs\amd64_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.6195_none_88e41e092fab0294\msvcr80.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\avifil32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\msacm32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\msvfw32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\opengl32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\glu32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\ddraw.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\dciman32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\setupapi.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\cfgmgr32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\devobj.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\jawt.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\comdlg32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\netapi32.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\netutils.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\srvcli.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\wkscli.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\WSHTCPIP.DLL'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\nlaapi.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\NapiNSP.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\pnrpnsp.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\dnsapi.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\winrnr.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\IPHLPAPI.DLL'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\winnsi.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\FWPUCLNT.DLL'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\rasadhlp.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\netbios.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\sspicli.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\jre\bin\dcpr.dll'. Cannot find or open the PDB file.
The thread 0x1688 has exited with code 0 (0x0).
First-chance exception at 0x0000000002C380E0 in javaw.exe: 0xC0000005: Access violation reading location 0x0000000000000028.
'javaw.exe' (Win32): Loaded 'C:\Dev\CutLogger\Build\Release\OptiAPI.dll'. Symbols loaded.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\vericut\CutLoggerWrapper.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\mscoree.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\msvcr110d.dll'. Symbols loaded.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\msvcp110d.dll'. Symbols loaded.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\vericut\opapi.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\msvcp110.dll'. Symbols loaded.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\msvcr110.dll'. Symbols loaded.
'javaw.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\mscoreei.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\System32\msvcr110_clr0400.dll'. Cannot find or open the PDB file.
First-chance exception at 0x000007FEFD96A49D (KernelBase.dll) in javaw.exe: 0x04242420 (parameters: 0x0000000031415927, 0x000007FEE7E60000, 0x000000000C3FDD40).
'javaw.exe' (Win32): Loaded 'C:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\9da5bb33cd1c34b7851c088f0cf749cc\mscorlib.ni.dll'.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\vericut\CutLoggerWrapper.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\cgtech70\windows64\vericut\CutLoggerWrapper.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Unloaded 'C:\cgtech70\windows64\vericut\CutLoggerWrapper.dll'
'javaw.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clrjit.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\diasymreader.dll'. Cannot find or open the PDB file.
'javaw.exe' (Win32): Loaded 'C:\Windows\assembly\NativeImages_v4.0.30319_64\System\e3305bdbd03ef919051aa7f2783ac32a\System.ni.dll'.
First-chance exception at 0x000007FEFD96A49D in javaw.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x000000000C3FA640.
First-chance exception at 0x000007FEFD96A49D in javaw.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
First-chance exception at 0x000007FEFD96A49D in javaw.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x000000000C3FA640.
First-chance exception at 0x000007FEFD96A49D in javaw.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
First-chance exception at 0x000007FEFD96A49D in javaw.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x000000000C3FA640.
First-chance exception at 0x000007FEFD96A49D (KernelBase.dll) in javaw.exe: 0xE0434352 (parameters: 0xFFFFFFFF80070002, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x000007FEE7E60000).
First-chance exception at 0x000007FEFD96A49D in javaw.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
First-chance exception at 0x000007FEFD96A49D (KernelBase.dll) in javaw.exe: 0xE0434352 (parameters: 0xFFFFFFFF80070002, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x000007FEE7E60000).
First-chance exception at 0x00000000083170A1 (jvm.dll) in javaw.exe: 0xC0000005: Access violation reading location 0x00000000E0000000.
First-chance exception at 0x00000000083170A1 (jvm.dll) in javaw.exe: 0xC0000005: Access violation reading location 0x00000000E0000000.
The thread 0x17ac has exited with code 1 (0x1).
The thread 0x1238 has exited with code 1 (0x1).
The thread 0xf7c has exited with code 1 (0x1).
The thread 0x9c0 has exited with code 1 (0x1).
The thread 0x1080 has exited with code 1 (0x1).
The thread 0x6c0 has exited with code 1 (0x1).
The thread 0xadc has exited with code 1 (0x1).
The thread 0xcb0 has exited with code 1 (0x1).
The thread 0x1704 has exited with code 1 (0x1).
The thread 0x178c has exited with code 1 (0x1).
The thread 0x1544 has exited with code 1 (0x1).
The thread 0x1254 has exited with code 1 (0x1).
The thread 0xf0 has exited with code 1 (0x1).
The thread 0x16bc has exited with code 1 (0x1).
The thread 0x510 has exited with code 1 (0x1).
The thread 0xc44 has exited with code 1 (0x1).
The thread 0x44c has exited with code 1 (0x1).
The thread 0x15c8 has exited with code 1 (0x1).
The thread 0x1154 has exited with code 1 (0x1).
The thread 0x7fc has exited with code 1 (0x1).
The thread 0xd8c has exited with code 1 (0x1).
The thread 0xee4 has exited with code 1 (0x1).
The thread 0x165c has exited with code 1 (0x1).
The thread 0xaa8 has exited with code 1 (0x1).
The thread 0x9c4 has exited with code 1 (0x1).
The thread 0x15b0 has exited with code 1 (0x1).
The thread 0x16fc has exited with code 1 (0x1).
The thread 0x141c has exited with code 1 (0x1).
The thread 0xec0 has exited with code 1 (0x1).
The thread 0x13d0 has exited with code 1 (0x1).
The thread 0x17e8 has exited with code 1 (0x1).
The thread 0xd44 has exited with code 1 (0x1).
The thread 0x1630 has exited with code 1 (0x1).
The thread 0x1204 has exited with code 1 (0x1).
The thread 0x7f8 has exited with code 1 (0x1).
The thread 0x14ac has exited with code 1 (0x1).
The thread 0x1340 has exited with code 1 (0x1).
The thread 0x428 has exited with code 1 (0x1).
The thread 0x5ec has exited with code 1 (0x1).
The program '[4796] javaw.exe' has exited with code 1 (0x1).

1

Решение

Я нашел решение своих проблем, оказалось, что это расположение оболочки C ++ / CLI и библиотек C #. Я должен был найти dll в (appdirectory) / jre / bin. Я пришел к такому выводу, увидев некоторые Microsoft DLL в той же директории.

1

Другие решения

Других решений пока нет …

По вопросам рекламы [email protected]