Java JRE问题帧检测到异常访问冲突:C[awt.dll+;0x7959b]

Java JRE问题帧检测到异常访问冲突:C[awt.dll+;0x7959b],java,exception,logging,access-violation,Java,Exception,Logging,Access Violation,最近,我在生成带有Access\u违例异常的日志文件时遇到了一个故障。 日志文件中提到有问题的帧是awt.dll。这指的是什么?。为什么会发生这种崩溃?如何解决这个问题?。实际上我是java新手,所以我没有意识到这一点。我在同一个网站上发现了类似的问题,但我还没有找到任何解决方案。请任何人解释清楚,以便我能对此有所了解。提前谢谢。我在下面附上了错误日志文件的一部分 # A fatal error has been detected by the Java Runtime Environment:

最近,我在生成带有Access\u违例异常的日志文件时遇到了一个故障。 日志文件中提到有问题的帧是awt.dll。这指的是什么?。为什么会发生这种崩溃?如何解决这个问题?。实际上我是java新手,所以我没有意识到这一点。我在同一个网站上发现了类似的问题,但我还没有找到任何解决方案。请任何人解释清楚,以便我能对此有所了解。提前谢谢。我在下面附上了错误日志文件的一部分

# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x60bf959b, pid=5188, tid=5736
#
# JRE version: Java(TM) SE Runtime Environment (8.0_45-b15) (build 1.8.0_45-b15)
# Java VM: Java HotSpot(TM) Client VM (25.45-b02 mixed mode windows-x86 )
# Problematic frame:
# C  [awt.dll+0x7959b]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.

problemble frame
部分中的dll与类路径中的其余库不兼容,下面是一个示例,您应该考虑使用一些自定义类加载器加载该库,而不是JVM使用的默认值,下面是一个简单的示例:

 /**
 * 
 * @author http://codeslices.net team
 * 
 */

import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

/**
 * 
 * Simple custom class loader implementation
 * 
 */
public class CustomClassLoader extends ClassLoader {

    /**
     * The HashMap where the classes will be cached
     */
    private Map<String, Class<?>> classes = new HashMap<String, Class<?>>();

    @Override
    public String toString() {
        return CustomClassLoader.class.getName();
    }

    @Override
    protected Class<?> findClass(String name) throws ClassNotFoundException {

        if (classes.containsKey(name)) {
            return classes.get(name);
        }

        byte[] classData;

        try {
            classData = loadClassData(name);
        } catch (IOException e) {
            throw new ClassNotFoundException("Class [" + name
                    + "] could not be found", e);
        }

        Class<?> c = defineClass(name, classData, 0, classData.length);
        resolveClass(c);
        classes.put(name, c);

        return c;
    }

    /**
     * Load the class file into byte array
     * 
     * @param name
     *            The name of the class e.g. com.codeslices.test.TestClass}
     * @return The class file as byte array
     * @throws IOException
     */
    private byte[] loadClassData(String name) throws IOException {
        BufferedInputStream in = new BufferedInputStream(
                ClassLoader.getSystemResourceAsStream(name.replace(".", "/")
                        + ".class"));
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        int i;

        while ((i = in.read()) != -1) {
            out.write(i);
        }

        in.close();
        byte[] classData = out.toByteArray();
        out.close();

        return classData;
    }

    /**
     * Simple usage of the CustomClassLoader implementation
     * 
     * @param args
     * @throws ClassNotFoundException
     * @throws IllegalAccessException
     * @throws InstantiationException
     * @throws SecurityException
     * @throws NoSuchMethodException
     * @throws InvocationTargetException
     * @throws IllegalArgumentException
     */
    public static void main(String[] args) throws ClassNotFoundException,
            InstantiationException, IllegalAccessException,
            NoSuchMethodException, SecurityException, IllegalArgumentException,
            InvocationTargetException
    {
        CustomClassLoader loader = new CustomClassLoader();
        // This class should be in your application class path
        Class<?> c = loader.findClass("net.codeslices.test.TestClass");
        Object o = c.newInstance();
        Method m = c.getMethod("toString");
        System.out.println(m.invoke(o));
    }

}
/**
* 
*@作者http://codeslices.net 团队
* 
*/
导入java.io.BufferedInputStream;
导入java.io.ByteArrayOutputStream;
导入java.io.IOException;
导入java.lang.reflect.InvocationTargetException;
导入java.lang.reflect.Method;
导入java.util.HashMap;
导入java.util.Map;
/**
* 
*简单的自定义类加载器实现
* 
*/
公共类CustomClassLoader扩展了ClassLoader{
/**
*将在其中缓存类的哈希映射
*/
私人地图>();
@凌驾
公共字符串toString(){
返回CustomClassLoader.class.getName();
}
@凌驾
受保护类findClass(字符串名称)引发ClassNotFoundException{
if(类.容器(名称)){
返回类。get(name);
}
字节[]类数据;
试一试{
classData=loadClassData(名称);
}捕获(IOE异常){
抛出新的ClassNotFoundException(“类[”+名称
+“]找不到”,e);
}
c类=定义类(名称,类数据,0,类数据.length);
(c)级;
类。put(名称,c);
返回c;
}
/**
*将类文件加载到字节数组中
* 
*@param name
*类的名称,例如com.codesicles.test.TestClass}
*@以字节数组形式返回类文件
*@抛出异常
*/
私有字节[]loadClassData(字符串名称)引发IOException{
BufferedInputStream in=新的BufferedInputStream(
ClassLoader.getSystemResourceAsStream(名称.replace(“.”,“/”)
+“.class”);
ByteArrayOutputStream out=新建ByteArrayOutputStream();
int i;
而((i=in.read())!=-1){
写出(i);
}
in.close();
byte[]classData=out.toByteArray();
out.close();
返回类数据;
}
/**
*CustomClassLoader实现的简单用法
* 
*@param args
*@ClassNotFoundException
*@galacessException
*@throws实例化异常
*@抛出安全异常
*@NoSuchMethodException
*@targetException
*@galargumentException
*/
公共静态void main(字符串[]args)引发ClassNotFoundException,
实例化异常,非法访问异常,
NoSuchMethodException、SecurityException、IllegalArgumentException、,
调用目标异常
{
CustomClassLoader=新CustomClassLoader();
//此类应位于应用程序类路径中
c类=loader.findClass(“net.codeSicles.test.TestClass”);
对象o=c.newInstance();
方法m=c.getMethod(“toString”);
System.out.println(m.invoke(o));
}
}

问题框架部分中的dll与类路径中的其他库不兼容,下面是一个示例,您应该考虑使用一些自定义类加载器加载该库,而不是JVM使用的默认值,下面是一个简单的示例:

 /**
 * 
 * @author http://codeslices.net team
 * 
 */

import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.HashMap;
import java.util.Map;

/**
 * 
 * Simple custom class loader implementation
 * 
 */
public class CustomClassLoader extends ClassLoader {

    /**
     * The HashMap where the classes will be cached
     */
    private Map<String, Class<?>> classes = new HashMap<String, Class<?>>();

    @Override
    public String toString() {
        return CustomClassLoader.class.getName();
    }

    @Override
    protected Class<?> findClass(String name) throws ClassNotFoundException {

        if (classes.containsKey(name)) {
            return classes.get(name);
        }

        byte[] classData;

        try {
            classData = loadClassData(name);
        } catch (IOException e) {
            throw new ClassNotFoundException("Class [" + name
                    + "] could not be found", e);
        }

        Class<?> c = defineClass(name, classData, 0, classData.length);
        resolveClass(c);
        classes.put(name, c);

        return c;
    }

    /**
     * Load the class file into byte array
     * 
     * @param name
     *            The name of the class e.g. com.codeslices.test.TestClass}
     * @return The class file as byte array
     * @throws IOException
     */
    private byte[] loadClassData(String name) throws IOException {
        BufferedInputStream in = new BufferedInputStream(
                ClassLoader.getSystemResourceAsStream(name.replace(".", "/")
                        + ".class"));
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        int i;

        while ((i = in.read()) != -1) {
            out.write(i);
        }

        in.close();
        byte[] classData = out.toByteArray();
        out.close();

        return classData;
    }

    /**
     * Simple usage of the CustomClassLoader implementation
     * 
     * @param args
     * @throws ClassNotFoundException
     * @throws IllegalAccessException
     * @throws InstantiationException
     * @throws SecurityException
     * @throws NoSuchMethodException
     * @throws InvocationTargetException
     * @throws IllegalArgumentException
     */
    public static void main(String[] args) throws ClassNotFoundException,
            InstantiationException, IllegalAccessException,
            NoSuchMethodException, SecurityException, IllegalArgumentException,
            InvocationTargetException
    {
        CustomClassLoader loader = new CustomClassLoader();
        // This class should be in your application class path
        Class<?> c = loader.findClass("net.codeslices.test.TestClass");
        Object o = c.newInstance();
        Method m = c.getMethod("toString");
        System.out.println(m.invoke(o));
    }

}
/**
* 
*@作者http://codeslices.net 团队
* 
*/
导入java.io.BufferedInputStream;
导入java.io.ByteArrayOutputStream;
导入java.io.IOException;
导入java.lang.reflect.InvocationTargetException;
导入java.lang.reflect.Method;
导入java.util.HashMap;
导入java.util.Map;
/**
* 
*简单的自定义类加载器实现
* 
*/
公共类CustomClassLoader扩展了ClassLoader{
/**
*将在其中缓存类的哈希映射
*/
私人地图>();
@凌驾
公共字符串toString(){
返回CustomClassLoader.class.getName();
}
@凌驾
受保护类findClass(字符串名称)引发ClassNotFoundException{
if(类.容器(名称)){
返回类。get(name);
}
字节[]类数据;
试一试{
classData=loadClassData(名称);
}捕获(IOE异常){
抛出新的ClassNotFoundException(“类[”+名称
+“]找不到”,e);
}
c类=定义类(名称,类数据,0,类数据.length);
(c)级;
类。put(名称,c);
返回c;
}
/**
*将类文件加载到字节数组中
* 
*@param name
*类的名称,例如com.codesicles.test.TestClass}
*@以字节数组形式返回类文件
*@抛出异常
*/
私有字节[]loadClassData(字符串名称)引发IOException{
BufferedInputStream in=新的BufferedInputStream(
ClassLoader.getSystemResourceAsStream(名称.replace(“.”,“/”)
+“.class”);
ByteArrayOutputStream out=新建ByteArrayOutputStream();
int i;
而((i=in.read())!=-1){
写出(i);
}
in.close();
byte[]classData=out.toByteArray();
out.close();
返回类数据;
}
/**
*简单使用