bug_ _ 常见的bug1
===== 3 java.lang.reflect.InvocationTargetException 异常解决方法
在做djunit测试的时候,发生下面异常:
- java.lang.reflect.InvocationTargetException
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- at java.lang.reflect.Method.invoke(Method.java:600)
- at jp.co.dgic.testing.common.DJUnitClassLoader.getModifiedClass(DJUnitClassLoader.java:106)
- at jp.co.dgic.testing.common.DJUnitClassLoader.findClass(DJUnitClassLoader.java:56)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:653)
- at jp.co.dgic.testing.common.DJUnitClassLoader.loadClass(DJUnitClassLoader.java:45)
- at jp.co.dgic.testing.common.DJUnitEclipseClassLoader.loadClass(DJUnitEclipseClassLoader.java:59)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:619)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:683)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:425)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- at java.lang.reflect.Method.invoke(Method.java:600)
- at jp.co.dgic.eclipse.jdt.internal.junit.runner.DJUnitRunner.main(DJUnitRunner.java:49)
- Caused by: java.io.IOException: Class not found
- at org.objectweb.asm.ClassReader.a(Unknown Source)
- at org.objectweb.asm.ClassReader.<init>(Unknown Source)
- at org.objectweb.asm.ClassReader.<init>(Unknown Source)
- at jp.co.dgic.testing.common.AsmClassModifier.getModifiedClass(AsmClassModifier.java:49)
- ... 21 more
- java.lang.reflect.InvocationTargetException
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- at java.lang.reflect.Method.invoke(Method.java:600)
- at jp.co.dgic.testing.common.DJUnitClassLoader.getModifiedClass(DJUnitClassLoader.java:106)
- at jp.co.dgic.testing.common.DJUnitClassLoader.findClass(DJUnitClassLoader.java:56)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:653)
- at jp.co.dgic.testing.common.DJUnitClassLoader.loadClass(DJUnitClassLoader.java:45)
- at jp.co.dgic.testing.common.DJUnitEclipseClassLoader.loadClass(DJUnitEclipseClassLoader.java:59)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:619)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:683)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:425)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
- at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
- at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
- at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
- at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
- at java.lang.reflect.Method.invoke(Method.java:600)
- at jp.co.dgic.eclipse.jdt.internal.junit.runner.DJUnitRunner.main(DJUnitRunner.java:49)
- Caused by: java.io.IOException: Class not found
- at org.objectweb.asm.ClassReader.a(Unknown Source)
- at org.objectweb.asm.ClassReader.<init>(Unknown Source)
- at org.objectweb.asm.ClassReader.<init>(Unknown Source)
- at jp.co.dgic.testing.common.AsmClassModifier.getModifiedClass(AsmClassModifier.java:49)
- ... 21 more
发生原因:找到class相应路径下,对应的class文件没生成,有可能是某些class有错,导致没有完成编译,在clean后,经常发生。
解决方法:properties属性里的 java compiler--> building --> ビルド・パスの問題 -->
abort build when build path errors occur / ビルド・パス・エラーの発生時にビルドを中断 前面的勾去掉
======== 2 java.lang.outofmemoryerror exception?
10-30 22:53:38.246: E/AndroidRuntime(19137): FATAL EXCEPTION: Thread-1210
10-30 22:53:38.246: E/AndroidRuntime(19137): java.lang.OutOfMemoryError
10-30 22:53:38.246: E/AndroidRuntime(19137): at com.android.volley.toolbox.DiskBasedCache.streamToBytes(DiskBasedCache.java:316)
10-30 22:53:38.246: E/AndroidRuntime(19137): at com.android.volley.toolbox.DiskBasedCache.readString(DiskBasedCache.java:526)
10-30 22:53:38.246: E/AndroidRuntime(19137): at com.android.volley.toolbox.DiskBasedCache.readStringStringMap(DiskBasedCache.java:549)
10-30 22:53:38.246: E/AndroidRuntime(19137): at com.android.volley.toolbox.DiskBasedCache$CacheHeader.readHeader(DiskBasedCache.java:392)
10-30 22:53:38.246: E/AndroidRuntime(19137): at com.android.volley.toolbox.DiskBasedCache.initialize(DiskBasedCache.java:155)
10-30 22:53:38.246: E/AndroidRuntime(19137): at com.android.volley.CacheDispatcher.run(CacheDispatcher.