提前致歉,但我之前从未见过此错误,也不知道要包含什么内容。我正在使用NetBeans,突然开始出现此错误:
Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: (class: market/CostOperations, method: <init> signature: ()V) Constructor must call super() or this() at Bluebuild.Main.refreshTables(Main.java:748) at Bluebuild.Main.formComponentShown(Main.java:649) at Bluebuild.Main.access$100(Main.java:28) at Bluebuild.Main$2.componentShown(Main.java:374) at java.awt.Component.processComponentEvent(Component.java:6095) at java.awt.Component.processEvent(Component.java:6043) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Window.processEvent(Window.java:1836) at java.awt.Component.dispatchEventImpl(Component.java:4630) at java.awt.Container.dispatchEventImpl(Container.java:2099) at java.awt.Window.dispatchEventImpl(Window.java:2478) at java.awt.Component.dispatchEvent(Component.java:4460) at java.awt.EventQueue.dispatchEvent(EventQueue.java:599) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161) at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
我不知道发生了什么事。我什至没有修改市场/ CostOperations。
这是构造函数:
public CostOperations() throws ParserConfigurationException, SAXException, IOException { //Open the xml file DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); f = new File(dbName); doc = builder.parse(f); System.out.println(f.canWrite()); //Create the XPath XPathFactory xpfactory = XPathFactory.newInstance(); path = xpfactory.newXPath(); }
在调试模式下,我得到以下信息:
debug: Have no FileObject for C:\Program Files (x86)\Java\jdk1.6.0_20\jre\lib\sunrsasign.jar Have no FileObject for C:\Program Files (x86)\Java\jdk1.6.0_20\jre\classes
我只需要知道是什么导致了错误以及如何修复它。谢谢!
A VerifyError表示字节码无效,这指示编译器问题。我会尝试重建所有东西,以希望它消失了,但是否则,您应该提交错误。通过手动调用超类构造函数需要字节码invokenonvirtual superclass/<init>()V,但您无需添加super();源代码,编译器应处理该字节码
VerifyError
invokenonvirtual superclass/<init>()V
super();