Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
222 views
in Technique[技术] by (71.8m points)

applet - When do we get java.lang.NoSuchMethodError even when the jar/class has the particualar method

I am using IText library to facilitate pdf export in an applet. During the export call it fails with following error:

java.lang.NoSuchMethodError: com.lowagie.text.pdf.PdfPTable.completeRow()V

I opened the Itext jar/PdfPtable.class in JD Decompiler and confirmed that the class has completeRow as a public method.

Can somebody explain the possible scenarios when a java.lang.NoSuchMethodError is thrown even when jar/class has it?

Here is the stack trace; may not be very helpful as most of the calls are our application specific.

Error while exporting to the CSV file - java.lang.NoSuchMethodError: com.lowagie.text.pdf.PdfPTable.completeRow()V
com.blox.table.action.ExportToCSVAction.actionPerformed(ExportToCSVAction.java:193)
javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
javax.swing.DefaultButtonModel.setPressed(Unknown Source)
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
java.awt.Component.processMouseEvent(Unknown Source)
javax.swing.JComponent.processMouseEvent(Unknown Source)
java.awt.Component.processEvent(Unknown Source)
java.awt.Container.processEvent(Unknown Source)
java.awt.Component.dispatchEventImpl(Unknown Source)
java.awt.Container.dispatchEventImpl(Unknown Source)
java.awt.Component.dispatchEvent(Unknown Source)
java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
java.awt.Container.dispatchEventImpl(Unknown Source)
java.awt.Window.dispatchEventImpl(Unknown Source)
java.awt.Component.dispatchEvent(Unknown Source)
java.awt.EventQueue.dispatchEvent(Unknown Source)
java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.pumpEvents(Unknown Source)
java.awt.EventDispatchThread.run(Unknown Source)
com.lowagie.text.pdf.PdfPTable.completeRow()V
com.blox.table.view.GridTableModel$PdfExportWriter.writeNewLine(GridTableModel.java:7259)
com.blox.table.view.GridTableModel.buildExportData(GridTableModel.java:3111)
com.blox.table.view.GridTableModel.export(GridTableModel.java:2541)
com.blox.table.view.GridTable.export(GridTable.java:1318)
com.blox.table.action.ExportToCSVAction.exportToFile(ExportToCSVAction.java:248)
com.blox.table.action.ExportToCSVAction.access$1(ExportToCSVAction.java:245)
com.blox.table.action.ExportToCSVAction$Worker.exportToCSVFile(ExportToCSVAction.java:111)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
spin.Invocation.evaluate(Invocation.java:175)
spin.off.SpinOffEvaluator$1.run(SpinOffEvaluator.java:108)
java.lang.Thread.run(Unknown Source)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It could be that a different version appears in your classpath or that the signature of that particular method has changed since your compiled your class


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...