=====  3   java.lang.reflect.InvocationTargetException 异常解决方法

在做djunit测试的时候,发生下面异常:

  1. java.lang.reflect.InvocationTargetException
  2. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  3. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
  4. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  5. at java.lang.reflect.Method.invoke(Method.java:600)
  6. at jp.co.dgic.testing.common.DJUnitClassLoader.getModifiedClass(DJUnitClassLoader.java:106)
  7. at jp.co.dgic.testing.common.DJUnitClassLoader.findClass(DJUnitClassLoader.java:56)
  8. at java.lang.ClassLoader.loadClass(ClassLoader.java:653)
  9. at jp.co.dgic.testing.common.DJUnitClassLoader.loadClass(DJUnitClassLoader.java:45)
  10. at jp.co.dgic.testing.common.DJUnitEclipseClassLoader.loadClass(DJUnitEclipseClassLoader.java:59)
  11. at java.lang.ClassLoader.loadClass(ClassLoader.java:619)
  12. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:683)
  13. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:425)
  14. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
  15. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
  16. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
  17. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
  18. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  19. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
  20. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  21. at java.lang.reflect.Method.invoke(Method.java:600)
  22. at jp.co.dgic.eclipse.jdt.internal.junit.runner.DJUnitRunner.main(DJUnitRunner.java:49)
  23. Caused by: java.io.IOException: Class not found
  24. at org.objectweb.asm.ClassReader.a(Unknown Source)
  25. at org.objectweb.asm.ClassReader.<init>(Unknown Source)
  26. at org.objectweb.asm.ClassReader.<init>(Unknown Source)
  27. at jp.co.dgic.testing.common.AsmClassModifier.getModifiedClass(AsmClassModifier.java:49)
  28. ... 21 more
  29. java.lang.reflect.InvocationTargetException
  30. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  31. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
  32. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  33. at java.lang.reflect.Method.invoke(Method.java:600)
  34. at jp.co.dgic.testing.common.DJUnitClassLoader.getModifiedClass(DJUnitClassLoader.java:106)
  35. at jp.co.dgic.testing.common.DJUnitClassLoader.findClass(DJUnitClassLoader.java:56)
  36. at java.lang.ClassLoader.loadClass(ClassLoader.java:653)
  37. at jp.co.dgic.testing.common.DJUnitClassLoader.loadClass(DJUnitClassLoader.java:45)
  38. at jp.co.dgic.testing.common.DJUnitEclipseClassLoader.loadClass(DJUnitEclipseClassLoader.java:59)
  39. at java.lang.ClassLoader.loadClass(ClassLoader.java:619)
  40. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:683)
  41. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:425)
  42. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:445)
  43. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
  44. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
  45. at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
  46. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  47. at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
  48. at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  49. at java.lang.reflect.Method.invoke(Method.java:600)
  50. at jp.co.dgic.eclipse.jdt.internal.junit.runner.DJUnitRunner.main(DJUnitRunner.java:49)
  51. Caused by: java.io.IOException: Class not found
  52. at org.objectweb.asm.ClassReader.a(Unknown Source)
  53. at org.objectweb.asm.ClassReader.<init>(Unknown Source)
  54. at org.objectweb.asm.ClassReader.<init>(Unknown Source)
  55. at jp.co.dgic.testing.common.AsmClassModifier.getModifiedClass(AsmClassModifier.java:49)
  56. ... 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.java:85)

This thing can be an easy fix for this

just add this line in your application tag in manifest file

android:largeHeap="true"

like this

<application
android:largeHeap="true"
android:allowBackup="true"

======

bug_ _ 常见的bug1的更多相关文章

  1. c语言_常见图片格式判断

    c语言_常见图片格式判断 我想尽各种思路.今天,终于把图片判断搞定了. 在此,我写一下我的思路.希望对那些不想看代码的朋友们有帮助. 常风的的图片格式有:bmp,png,jpg,gif等图片格式. 我 ...

  2. bug_ _ _常见的bug??

    ======= 7    Failure [INSTALL_FAILED_INVALID_APK] 执行  adb install -r test.apk.时出现错误  Failure [INSTAL ...

  3. bug_ _ 应用汇==常见错误列表

    应用汇的安装功能是基于安卓系统的adb开发的,adb的安装过程分为传输与安装两步.在出错后,助手会在右下角弹出详细的错误编号及建议. 下面列举出几种常见的错误及解决方法. Q1:无效的安装包,安装包已 ...

  4. 第10章 同步设备I/O和异步设备I/O(1)_常见设备及CreateFile函数

    10.1 打开和关闭设备 10.1.1 设备的定义——在Windows中可以与之进行通信的任何东西. (1)常见设备及用途 设备 用途 用来打开设备的函数 文件 永久存储任何数据 CreateFile ...

  5. bug_ _小心android-support-v4.jar版本混乱造成的NoClassDefFoundError

    当你的项目出现以下红色提示的时候,要小心了, 因为很可能因为这个错误而导致解释不通的异常出现. Found 2 versions of android-support-v4.jar in the de ...

  6. bug_ _ android.view.WindowManager$BadTokenException: Unable to add window -- token

    ========4       关于android的一个常见错误:Unable to add window --token is not valid android.view.WindowManage ...

  7. 【Excel】绘图案例_常见复合图:簇状图+堆积图+折线图

    前言 最近有朋友让我帮忙用excel画图,老实说我很讨厌用excel画图,点来点去,复杂一些还不能复用,非常繁琐.当然,入门也很简单.需求时不同城市.不同产品的2016和2017销量及环比数据,这应该 ...

  8. Java学习_常见异常

    JAVA常见异常 Java.io.NullPointerException null 空的,不存在的 NullPointer 空指针 空指针异常,该异常出现在我们操作某个对象的属性或方法时,如果该对象 ...

  9. bug_ _

    java.lang.SecurityException: Not allowed to bind to service I app中加了百度定位功能,大部分手机测试没问题,但有部分手机会定位失败,提示 ...

随机推荐

  1. poj1511 最短路

    题意:与poj3268一样,所有人需要从各点到一点再从一点到各点,求最短路总和. 与poj3268一样,先正向建图跑 dijkstra ,得到该点到其他所有各点的最短路,即这些人回去的最短路,再用反向 ...

  2. Java——多线程安全问题

     静态代码块中没有this /* * 线程安全问题产生的原因: * 1.多个线程操作共享的数据 * 2.操作共享数据的线程代码有多条 * * 当一个线程在执行操作共享数据的多条代码过程中,其他线程 ...

  3. 为mysql在表的某一位置增加一列

    如果想在一个已经建好的表中添加一列,可以用诸如: alter table t1 add column addr varchar(20) not null; 这条语句会向已有的表t1中加入一列addr, ...

  4. windows环境下安装python模块大招

    python发展到今天,感觉版本有点控制不住了,同时出现多个版本python2.5,python2.7 python 3 ,同时跨越windows,mac,*inux等多个平台,还有32位,64位等不 ...

  5. Java Debugging

    1, https://visualvm.java.net/oqlhelp.html#top http://docs.oracle.com/javase/7/docs/technotes/samples ...

  6. share point 2013 显示详细错误信息?

    Wednesday, April 6, 2011 at 17:40 |  Post a Comment SharePoint "Unknown Error": How to Sho ...

  7. shell脚本实例-命令记录

    http://bbs.51cto.com/thread-594667-1.html script使用注意事项输入1: [root@-shiyan rec]# cat record1 #!/bin/ba ...

  8. python input() 与 raw_input()

    使用input和raw_input都可以读取控制台的输入,但是input和raw_input在处理数字时是有区别的 当输入为纯数字时: input返回的是数值类型,如int,floatraw_inpo ...

  9. 使用ExpandableListView——当有Group选项展开时,如何正确获取长按的Group选项。

    当我们使用ExpandableListView时,实现点击一个GroupView则展开ChidView,那么这个时候,Adapter的大小前后是有变化的. 例如:假设有20个GroupView,每个G ...

  10. 你了解System.out.println()的真正含义吗?

    在Java编程中,我们常常用 System.out.println(); 来输出字符串,也许我们都已经猜到println()是方法名,但System是什么,out又是什么呢? 其实System是jav ...