Results 1 to 10 of 10
Thread: java.lang.VerifyError
- 01-20-2011, 08:48 PM #1
Member
- Join Date
- Jan 2011
- Posts
- 10
- Rep Power
- 0
java.lang.VerifyError
I got the message ON and OFF. previously i got the same message.
without changing the java code...sometime...it runs normally.
Today, i got the problem agian.
Please guide what is the problem?
TIA
Exception in thread "main" java.lang.VerifyError: (class: ResultSetTableModel, method: <init> signature: (Ljava/sql/ResultSet;)V) Constructor must call super() or this()
at ResultSetFrame.actionPerformed(ResultSetTable23.ja va:251)
at javax.swing.JComboBox.fireActionEvent(JComboBox.ja va:1240)
at javax.swing.JComboBox.contentsChanged(JComboBox.ja va:1311)
at javax.swing.AbstractListModel.fireContentsChanged( AbstractListModel.java:100)
at javax.swing.DefaultComboBoxModel.setSelectedItem(D efaultComboBoxModel.java:88)
at javax.swing.DefaultComboBoxModel.addElement(Defaul tComboBoxModel.java:126)
at javax.swing.JComboBox.addItem(JComboBox.java:696)
at ResultSetFrame.<init>(ResultSetTable23.java:220)
at ResultSetTable23.main(ResultSetTable23.java:14)
- 01-21-2011, 09:02 AM #2
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
Show us the code.
Looks like you have your constructor set up incorrectly in ResultSetFrame.
Show use the constructor around line 251 in ResyltSetTable23.java.
- 01-21-2011, 04:28 PM #3
Member
- Join Date
- Jan 2011
- Posts
- 10
- Rep Power
- 0
code
public void actionPerformed(ActionEvent evt)
{ //System.out.println(tableNames + "123");
if (evt.getSource() == tableNames)
{ // show the selected table from the combo box
if (scrollPane != null)
//System.out.println("me");
getContentPane().remove(scrollPane);
try
{ String tableName
= (String)tableNames.getSelectedItem();
if (rs != null) rs.close();
//System.out.println(tableName);
//System.out.println("PROVEN??????");
String query = "SELECT * FROM " + tableName;
rs = stmt.executeQuery(query);
//System.out.println(SCROLLABLE+"z1y2");
if (SCROLLABLE)
modelzyx = new ScrollingResultSetTableModel(rs);
else
modelzyx = new CachingResultSetTableModel(rs);
JTable table = new JTable(modelzyx);
scrollPane = new JScrollPane(table);
getContentPane().add(scrollPane, "Center");
pack();
doLayout();
}
catch(SQLException e)
{ System.out.println("Error " + e);
}
}
}
- 01-24-2011, 10:58 AM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
So, which is line 251?
Also please use code tags.
Oh, and while you're at it can you show us the constructor?
That seems to be the root of this.
- 01-26-2011, 08:41 PM #5
Member
- Join Date
- Jan 2011
- Posts
- 10
- Rep Power
- 0
Dear Tolls,
sorry i miss the reference line 251 by now as i have added some comment line in it.
Here is the structure of the public class:
Java Code:public class ResultSetTable23 { public static void main(String[] args) { JFrame frame = new ResultSetFrame(); .....
1st InnerClass
2nd InnerClassJava Code:abstract class ResultSetTableModel extends AbstractTableModel { public ResultSetTableModel(ResultSet aResultSet) { rstm23 = aResultSet;
Java Code:class ScrollingResultSetTableModel extends ResultSetTableModel { public ScrollingResultSetTableModel(ResultSet aResultSet) { super(aResultSet); ...
3rd InnerClass:
Java Code:class CachingResultSetTableModel extends ResultSetTableModel { public CachingResultSetTableModel(ResultSet aResultSet) { super(aResultSet); ...
4th InnerClass:
Java Code:class ResultSetFrame extends JFrame implements ActionListener { public ResultSetFrame() { setTitle("ResultSet"); . ..... } public void actionPerformed(ActionEvent evt) .... ///I think this is the problem: if (SCROLLABLE) modelzyx = new ScrollingResultSetTableModel(rsFrame); else modelzyx = new CachingResultSetTableModel(rsFrame); .... public ResultSetTableModel modelzyx; public ResultSet rsFrame; }
Other Public Class.
Java Code:public class ResultSetTableModel implements TableModel { public ResultSet resultsTM; public ResultSetMetaData metadataTM; public int numcolsTM, numrowsTM; /////the constructor public ResultSetTableModel(ResultSet aResultSet) throws SQLException { this.resultsTM = aResultSet; metadataTM = resultsTM.getMetaData(); numcolsTM = metadataTM.getColumnCount(); resultsTM.last(); numrowsTM = resultsTM.getRow(); } ...
TQ
- 01-27-2011, 08:24 AM #6
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
What is the rest of this constructor:
?Java Code:abstract class ResultSetTableModel extends AbstractTableModel { public ResultSetTableModel(ResultSet aResultSet) { rstm23 = aResultSet;
This is what it's complaining about (I got the wrong class earlier, sorry).
- 01-27-2011, 06:57 PM #7
Member
- Join Date
- Jan 2011
- Posts
- 10
- Rep Power
- 0
Here is the complete constructor of InnerClass of public class ResultSetTable23
TIAJava Code:abstract class ResultSetTableModel extends AbstractTableModel involving ResultSetTableModel. { public ResultSetTableModel(ResultSet aResultSet) { rstm23 = aResultSet; try { rsmd23 = rstm23.getMetaData(); ///System.out.println(rsmd); } catch(SQLException e) { System.out.println("Error " + e); } }
- 01-28-2011, 08:39 AM #8
Moderator
- Join Date
- Apr 2009
- Posts
- 10,476
- Rep Power
- 16
I've just noticed that you have two classes with the same name.
OK, one is an inner class, but it's still a bit confusing to read...
Anyway, your frame is still being built and you already have events being fired. It looks like you are trying to do something with one of these not-yet-built objects. Either don't attach the listeners until after you've added all the data you want, or (and this may not work) use anonymous listeners, or a different listener class, rather than having the Frame being a listener.
Personally I find extending JFrame to be a mistake anyway. You're nto extending the Frame, you're using it. But that's by the by.
- 01-28-2011, 03:21 PM #9
Member
- Join Date
- Jan 2011
- Posts
- 10
- Rep Power
- 0
i am so confused...because sometime it works Properly...but when i do with other java...it is NOT work again.
Trying to get the error from var\cache\index.
Here is the err of "ResultSetTable.java.err"
:Java Code:ERROR:15:duplicate class\d A_JavaCode.ResultSet.ResultSetTableModel ERROR:26:method does not override or implement a method from a supertype ERROR:62:cannot find symbol\n symbol\d method getResultSet()\n location\d class A_JavaCode.ResultSet.ScrollingResultSetTableModel ERROR:77:cannot find symbol\n symbol\d method getResultSet()\n location\d class A_JavaCode.ResultSet.ScrollingResultSetTableModel ERROR:57:unreported exception java.sql.SQLException; must be caught or declared to be thrown ERROR:97:cannot find symbol\n symbol\d method getResultSet()\n location\d class A_JavaCode.ResultSet.CachingResultSetTableModel ERROR:93:unreported exception java.sql.SQLException; must be caught or declared to be thrown
- 01-29-2011, 06:19 AM #10
Member
- Join Date
- Jan 2011
- Posts
- 10
- Rep Power
- 0
Similar Threads
-
java.lang.NoSuchMethodError: org.apache.log4j.Logger.log(Ljava/lang/String;Lorg/apach
By rameshraj in forum JDBCReplies: 5Last Post: 03-17-2011, 02:26 PM -
java.lang.ClassNotFoundException: com.sun.star.lang.XEventListener
By Leroy in forum Advanced JavaReplies: 8Last Post: 11-04-2010, 01:46 PM -
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/lang/XEventLi
By baktha.thalapathy in forum New To JavaReplies: 5Last Post: 06-02-2010, 01:05 PM -
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/lang/XEventLi
By baktha.thalapathy in forum Advanced JavaReplies: 3Last Post: 06-01-2010, 03:01 PM -
Error: cannot resolve symbol' on Person (java.lang.String, java.lang.String)
By baltimore in forum New To JavaReplies: 2Last Post: 09-18-2008, 07:30 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks