This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 209834 - AbstractMethodError: oracle.sql.BLOB.free()V
Summary: AbstractMethodError: oracle.sql.BLOB.free()V
Status: RESOLVED DUPLICATE of bug 206233
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: Jiri Rechtacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-21 09:19 UTC by Maksim Khramov
Modified: 2012-03-30 20:46 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 166747


Attachments
stacktrace (1.55 KB, text/plain)
2012-03-21 09:19 UTC, Maksim Khramov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maksim Khramov 2012-03-21 09:19:47 UTC
Build: NetBeans IDE Dev (Build 201203200400)
VM: Java HotSpot(TM) 64-Bit Server VM, 20.6-b02, Java(TM) SE Runtime Environment, 1.6.0_31-rev-b23
OS: Windows 7

User Comments:
GUEST: even using thin driver not able to view image data




Stacktrace: 
java.lang.AbstractMethodError: oracle.sql.BLOB.free()V
   at org.netbeans.modules.db.dataview.util.DBReadWriteHelper.readResultSet(DBReadWriteHelper.java:227)
   at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.loadDataFrom(SQLExecutionHelper.java:511)
   at org.netbeans.modules.db.dataview.output.SQLExecutionHelper.initialDataLoad(SQLExecutionHelper.java:135)
   at org.netbeans.modules.db.dataview.output.DataView.create(DataView.java:105)
   at org.netbeans.modules.db.dataview.api.DataView.create(DataView.java:74)
   at org.netbeans.modules.db.sql.execute.SQLExecuteHelper.execute(SQLExecuteHelper.java:116)
Comment 1 Maksim Khramov 2012-03-21 09:19:52 UTC
Created attachment 116982 [details]
stacktrace
Comment 2 matthias42 2012-03-21 18:42:27 UTC
Hey, I asume this is what happend:

1. netbeans was compiled with java6 (there the method "free" is defined in the java.sql.Blob interface)
2. the oracle jdbc driver was compiled against jdk 5 or lower (there the interface java.sql.Blob misses the above method)

At runtime the bytecode references a not existing method in the oracle driver (why no one considered creating java.sql.Blob2?).

Long story short: We have to guard calls to java.sql.Blob#free either using reflection or by surrounding the call to free with a try-catch on java.lang.AbstractMethodError.

Can you compile netbeans from mercurial checkout? If you can, please try to change line 227 in DBReadWriteHelper.java:

blob.free();

to this:

try {
   blob.free();
} catch (java.lang.AbstractMethodError err) {
   // Blob gained a new method in jdbc4 (drivers compiled
   // against older jdks don't provide this methid
}

and try again.
Comment 3 Maksim Khramov 2012-03-29 07:39:26 UTC
I compiled this module with proposed fix and replace same module in installed build (Build 201203271056). No more exception throws on same action
Comment 4 matthias42 2012-03-30 20:46:51 UTC
Thanks for your test! I'll mark this bug as duplicate of bug #206233, as there is the whole issue tracked and a proposed fix placed.

*** This bug has been marked as a duplicate of bug 206233 ***