【Java】Java程序報錯:EXCEPTION_ACCESS_VIOLATION (0xc0000005)


運行Java程序的時候,報錯:EXCEPTION_ACCESS_VIOLATION (0xc0000005);
這里寫圖片描述

根據原網頁的說明:
這里寫圖片描述

EXCEPTION_ACCESS_VIOLATION

In rare circumstances, a Java program could stop with a message similar to the following:
 An unexpected error has been detected by HotSpot Virtual Machine:
 EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x7c042340, pid=1743, tid=122
 Java VM: Java HotSpot(TM) Client VM (1.5.4_02)
Problematic frame:
C [ntdll.dll+0x2430]
Essentially, Java will stop with a message such as the above if a "serious" error occurs that means the JVM can't continue to function. Usually, the most discriminating line is the first mention of a DLL, such as the line in bold above. The source of the error could be any of the following:

 1. a bug in the JVM itself; search Google and/or the Java web site for
    a mention of ntdll.dll+0x2430;
 2. a bug in some non-Java code that was being run at the time: e.g.
    Java might have been calling into a printer driver, graphics driver
    etc.

If you're not sure what to do but are not using the latest version of the JVM for your system, then a good first course of action is usually to upgrade your JVM. If the bug is in some other DLL, e.g. a printer driver, database driver, graphics driver etc, then it is best to see if you can upgrade the component in question.

If the error is occurring in some native code that you have written, then you need to find out which line of code corresponds to the offset mentioned (in this case, 0x2430, although the DLL isn't one of ours in this example). Usually you can tell your compiler to generate a "map 
    
    
    
            

這里可能的原因有:
1. a bug in the JVM itself; search Google and/or the Java web site for
a mention of ntdll.dll+0x2430;
一個JVM自身的bug,訪問谷歌或者Java網站尋求(根據 ntdll.dll+0x2430這個信息)
2. a bug in some non-Java code that was being run at the time: e.g.
Java might have been calling into a printer driver, graphics driver
etc.
一個正在運行的非Java代碼的某個bug,可能導致調用了打印驅動器,比如這個圖形驅動器等;

這里,我的建議是:
1、可能是端口號沖突,關閉不必要的其它Java程序;
2、同一個Java程序,可能內部會設置某個功能為自動啟動(會擠掉你現在用的這個Java程序),如果有暫停按鈕,先暫停同一個Java程序中的那個功能(不影響的情況下),先跑自己這部分的功能,等自己這部分功能跑完了,再啟動其它的功能;

相關資料:

(1)JNA: EXCEPTION_ACCESS_VIOLATION:https://stackoverflow.com/questions/29538130/jna-exception-access-violation

                    原文地址:https://blog.csdn.net/river_continent/article/details/78891674            </div>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM