2016-08-30 5 views
0

最近、Access_violation例外を含むログファイルを生成する際にクラッシュが発生しました。 問題のあるフレームはawt.dllであることがログファイルに記録されています。これは何を指していますか?なぜこのクラッシュが発生するのですか?この問題を解決するには?実際にはJavaに新しいですので、これを認識していません。私は同じウェブサイトで同様のタイプの質問を見つけましたが、私はまだ解決策を見つけることができませんでした。私はこれについてのアイデアを得るように誰もが明確に説明してください。前もって感謝します。以下のエラーログファイルの一部を添付しました。EXCEPTION_ACCESS_VIOLATIONがJREによって検出されました問題のフレーム:C [awt.dll + 0x7959b]

# 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. 
+1

が見えます。最小限のテストケースを作成して作成する準備をしてください。 http://www.oracle.com/technetwork/java/javase/awt-138016.html#gdaeyも参照してください。それ以外は、ここに誰も本当にあなたの情報を助けてくれる人はいません。それ以降のJavaバージョンにアップグレードして、問題が修正されたかどうかを確認してください。今は1.8.0_102までです。 –

答えて

0

Problematic frameセクションのDLLを使用すると、JVMが使用するいくつかのカスタムクラスローダーではなく、デフォルト値を使用して、そのライブラリのロードを考える必要があり、ここでは、あなたのクラスパスにライブラリの残りの部分と互換性がありませんsourceです、ここでは簡単な例です:あなたはより良い、指示に従ってくださいhttp://bugreport.java.com/bugreport/crash.jspを訪問し、バグレポートをファイルのように

/** 
* 
* @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)); 
    } 

} 
関連する問題