jnative 异常 java-用JNative方法调用dll

问题描述

用JNative方法调用dll

运行环境是JDK1.4
报异常信息:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x4769AA6
Function=[Unknown.]
Library=C:WindowsSystem32BoostYccb.dll

NOTE: We are unable to locate the function name symbol for the error
just occurred. Please refer to release documentation for possible
reason and solutions.

Current Java thread:
at org.xvolks.jnative.JNative.nInvoke(Native Method)
at org.xvolks.jnative.JNative.invoke(JNative.java:807)
at onlyfun.dllcall.UserCall.main(UserCall.java:101)

Dynamic libraries:
0x00400000 - 0x00407000 D:JDK1.4binjavaw.exe
0x77A50000 - 0x77BD0000 C:WindowsSysWOW64ntdll.dll
0x75700000 - 0x75810000 C:Windowssyswow64kernel32.dll
0x76E40000 - 0x76E87000 C:Windowssyswow64KERNELBASE.dll
0x75220000 - 0x752C0000 C:Windowssyswow64ADVAPI32.dll
0x752C0000 - 0x7536C000 C:Windowssyswow64msvcrt.dll
0x770B0000 - 0x770C9000 C:WindowsSysWOW64sechost.dll
0x76CB0000 - 0x76DA0000 C:Windowssyswow64RPCRT4.dll
0x75110000 - 0x75170000 C:Windowssyswow64SspiCli.dll
0x75100000 - 0x7510C000 C:Windowssyswow64CRYPTBASE.dll
0x76E90000 - 0x76F90000 C:Windowssyswow64USER32.dll
0x76C10000 - 0x76CA0000 C:Windowssyswow64GDI32.dll
0x75EC0000 - 0x75ECA000 C:Windowssyswow64LPK.dll
0x770D0000 - 0x7716D000 C:Windowssyswow64USP10.dll
0x76DA0000 - 0x76E00000 C:Windowssystem32IMM32.DLL
0x75CF0000 - 0x75DBC000 C:Windowssyswow64MSCTF.dll
0x08000000 - 0x08136000 D:JDK1.4jrebinclientjvm.dll
0x74E00000 - 0x74E32000 C:Windowssystem32WINMM.dll
0x724F0000 - 0x7253C000 C:Windowssystem32apphelp.dll
0x10000000 - 0x10007000 D:JDK1.4jrebinhpi.dll
0x00340000 - 0x0034E000 D:JDK1.4jrebinverify.dll
0x00350000 - 0x00368000 D:JDK1.4jrebinjava.dll
0x00370000 - 0x0037D000 D:JDK1.4jrebinzip.dll
0x04730000 - 0x047D3000 C:WindowsSystem32BoostYccb.dll
0x75370000 - 0x753FF000 C:Windowssyswow64oleaut32.dll
0x75400000 - 0x7555C000 C:Windowssyswow64ole32.dll
0x047E0000 - 0x047EB000 C:Windowssystem32borlndmm.dll
0x75000000 - 0x75007000 C:Windowssystem32wsock32.dll
0x76E00000 - 0x76E35000 C:Windowssyswow64WS2_32.dll
0x77A20000 - 0x77A26000 C:Windowssyswow64NSI.dll
0x74F20000 - 0x74FA4000 C:WindowsWinSxSx86_microsoft.windows.common-controls_6595b64144ccf1df_5.82.7601.18201_none_ec80f00e8593ece5comctl32.dll
0x04BB0000 - 0x04C7D000 C:WindowsSystem32JNativeCpp.dll
0x6E700000 - 0x6E780000 C:Windowssystem32uxtheme.dll
0x75AA0000 - 0x75ACB000 C:Windowssyswow64imagehlp.dll
0x743E0000 - 0x744CB000 C:Windowssyswow64dbghelp.dll
0x76CA0000 - 0x76CA5000 C:Windowssyswow64PSAPI.DLL

Heap at VM Abort:
Heap
def new generation total 576K, used 183K [0x10010000, 0x100b0000, 0x104f0000)
eden space 512K, 23% used [0x10010000, 0x1002dc60, 0x10090000)
from space 64K, 99% used [0x100a0000, 0x100afff8, 0x100b0000)
to space 64K, 0% used [0x10090000, 0x10090000, 0x100a0000)
tenured generation total 1408K, used 45K [0x104f0000, 0x10650000, 0x14010000)
the space 1408K, 3% used [0x104f0000, 0x104fb518, 0x104fb600, 0x10650000)
compacting perm gen total 4096K, used 1532K [0x14010000, 0x14410000, 0x18010000)
the space 4096K, 37% used [0x14010000, 0x1418f150, 0x1418f200, 0x14410000)

Local Time = Fri Nov 14 16:11:22 2014
Elapsed Time = 0
#

The exception above was detected in native code outside the VM

#

Java VM: Java HotSpot(TM) Client VM (1.4.2-b28 mixed mode)

#

An error report file has been saved as hs_err_pid13592.log.

Please refer to the file for further information.

#
求大师指导。

解决方案

这里的错误在你的dll里,返回的非法内存访问,可能性很多,比如访问了未初始化的变量,越界访问。最好贴上你的native code来看看

时间: 2024-08-01 06:21:50

jnative 异常 java-用JNative方法调用dll的相关文章

第三方dll文件-Java中利用jawin调用dll文件,invoke的参数问题

问题描述 Java中利用jawin调用dll文件,invoke的参数问题 各位大神: dll中的被调用方法如下: long WINAPI AutoOpenComPort(long* Port, unsigned char *ComAdr, unsigned char Baud,long *FrmHandle); 其中: Port:输出变量, ComAdr:输入/输出变量 Baud:输入变量 FrmHandle:输出变量 请问它的 msgBox.invoke(instructions, stack

Java开发中方法调用出现 Java.Lang.NoSuchMethod 错误如何解决

Java开发中调用webservice,方法调用报了 Java.Lang.NoSucheMethod..........,印象中记得是jar包冲突,maven项目,一看,这一堆jar包...用eclipse的pom可视化界面,Dependency Hierarchy 看到了不少包冲突,先从webservice 依赖的jar开始,顺着这一思路,一顿排除,没管用. 网上搜了几篇文章,梳理了下解决问题的思路: 1.你调的类里缺少该方法,可能是由于jar包的版本不对 2.项目依赖的jar包,A包和B包有

java类中方法调用问题

问题描述 java类中方法调用问题 import java.awt.*;import javax.swing.*;import java.awt.event.*; public class TestTextComponent extends JFrame { private JTextField textField = new JTextField(15); private JPasswordField passwordField = new JPasswordField(15); privat

c# dllimport-DllImport 方法调用dll文件返回-4

问题描述 DllImport 方法调用dll文件返回-4 大侠们,我想问下我用下面方法调用dll文件,用方法openFile_DLL取值时返回值总是-4,请问是何原因?谢谢. [DllImport("GFileAnalysis.dll", EntryPoint = "openFile", CallingConvention = CallingConvention.Cdecl)] private static extern int openFile_DLL(strin

异常-rmi通讯部分方法调用成功,部分调用失败

问题描述 rmi通讯部分方法调用成功,部分调用失败 rmi运行一段时间后,可能是几天也可能是几周.突然rmi客户端出现部分rmi方法调用不通.抛异常java.rmi.unmarshalException:error unmarshlling return;nested exception is; java.io.EOFException at sum.rmi.server.UnicastRef.invoke(UnicastRef.java:173)

JAVA编程:方法调用传对象参数

下面是2个测试,分别测试可修改的Object和不可修改的 /** * JAVA里面对象参数的陷阱 * * @author 老紫竹的家(laozizhu.com) * */ public class Test { public static void main(String[] args) { TestValue tv = new TestValue(); tv.first(); TestInteger ti = new TestInteger(); ti.first(); } } class T

关于java中用JNative调用dll文件报错的问题,跪求大神解决

问题描述 我在Eclipse中新建一个java工程,在java文件中用JNative调用dll文件,我把JNativeCpp.dll放在的C:WindowsSystem32中,把JNative.jar放在C:ProgramFilesJavajre7libext中,可是运行的时候总是报错JNativelibrarynotloaded,sorry!求解决啊,弄了一下午了,快死人了,还没调出来! 解决方案 解决方案二:JNativeCpp.dll放在的C:Windows下试试

jnative 调用dll文件

问题描述 我在myEclipse工具中建了一个java类,里面写的是jnative调用dll文件,但不知道怎么老是错误!//源代码publicstaticvoidmain(String[]args)throwsNativeException,IllegalAccessException{System.loadLibrary("test");JNativejnative=newJNative("test","show");jnative.setRe

Java调用.dll文件的方法_java

下截JNative组件 jnative.sourceforge.net/ 到这里下载JNative开源项目,我下载的是1.3.2 解压JNative-<st1:chsdate isrocdate="False" islunardate="False" day="30" month="12" year="1899">1.3.2</st1:chsdate>.zip 获得三个文件,分别是: