- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
检测错误
java.lang.RuntimeException: java.lang.ClassNotFoundException: Deposit
at org.objectweb.asm.ClassWriter.getCommonSuperClass(Unknown Source)
at org.objectweb.asm.ClassWriter.a(Unknown Source)
at org.objectweb.asm.Frame.a(Unknown Source)
at org.objectweb.asm.Frame.a(Unknown Source)
at org.objectweb.asm.MethodWriter.visitMaxs(Unknown Source)
at com.jConSequence.instrumentor.methodProber.AdddataBaseDetailsInstructions$AdddataBaseDetailsMethodInstructions.visitMaxs(AdddataBaseDetailsInstructions.java:131)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at com.jConSequence.instrumentor.PrintLoadedClasses.print(PrintLoadedClasses.java:31)
at com.jConSequence.tooGUI.RevEnggToolGUI.jButton1ActionPerformed(RevEnggToolGUI.java:487)
at com.jConSequence.tooGUI.RevEnggToolGUI.access$0(RevEnggToolGUI.java:471)
at com.jConSequence.tooGUI.RevEnggToolGUI$1.actionPerformed(RevEnggToolGUI.java:127)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
检测类
D:\workspaces\workspace\bankManagement\bin\Account.class
D:\workspaces\workspace\bankManagement\bin\ATM.class
D:\workspaces\workspace\bankManagement\bin\ATMCaseStudy.class
D:\workspaces\workspace\bankManagement\bin\BalanceInquiry.class
D:\workspaces\workspace\bankManagement\bin\BankDatabase.class
D:\workspaces\workspace\bankManagement\bin\CashDispenser.class
D:\workspaces\workspace\bankManagement\bin\Deposit.class
D:\workspaces\workspace\bankManagement\bin\DepositSlot.class
D:\workspaces\workspace\bankManagement\bin\Keypad.class
D:\workspaces\workspace\bankManagement\bin\Screen.class
D:\workspaces\workspace\bankManagement\bin\Transaction.class
我正在使用 apache commonsIO 将上述一组类作为字节流读取。
然后使用 asm 库检测它们。
最后将它们转换成类文件。
正是在这个检测点上,我收到了这个错误任何人都可以解释原因和可能的解决方案。
最佳答案
发生此错误是因为 ASM 正在生成堆栈映射帧,并且对于某些字节码,堆栈映射帧必须包含两个类的公共(public)父类(super class)。默认情况下,ASM 通过通过 Class.forName 加载类来实现这一点,然后使用反射实现适当的算法。据推测,ASM 库无法从其类加载器加载您的 Deposit 类。
为避免错误,您需要使用 SKIP_FRAMES(注意:Java 7 使用的类文件版本 51.0 需要堆栈映射帧,因此如果您要生成 Java 7 字节码,则不能选择此选项),或者您需要继承 ClassWriter 并覆盖 getCommonSuperClass。根据您的代码正在执行的操作,也许您可以使用字符串比较对答案进行硬编码,或者您可以采用 ASM 实现并重写它以使用您指定的 ClassLoader。
关于java - 检测类文件时出错 (asm.ClassWriter.getCommonSuperClass),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11292701/
What I am trying to do? 我正在尝试在特定方法的开头和结尾添加 try/catch 块。 Why am I overriding asm.ClassWriter.getCommo
检测错误 java.lang.RuntimeException: java.lang.ClassNotFoundException: Deposit at org.objectweb.asm.
我正在尝试使用 asm 库来检测 Apache Commons Math,对于某些类,当我尝试使用 ClassWriter 将其写入文件时,会抛出 ClassNotFoundException 。 抛
我得到以下新的异常 cobertura (2.0.2..) .我想这与在新 block 中立即创建新对象有某种关系。 WARN instrumentClass, Unable to instrum
我的 Play 2.1.1 项目使用 SBT 0.12.3,在我的开发机器上编译它时,一切正常,我没有出错,应用程序运行没有任何问题。当我尝试在用于测试的 EC2 实例上编译它时,我收到下面的超长错误
我是一名优秀的程序员,十分优秀!