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 142612 - NullPointerException at org.netbeans.modules.db.dataview.output.DataViewTablePanel.<init>
Summary: NullPointerException at org.netbeans.modules.db.dataview.output.DataViewTable...
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Show Data (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: John Baker
URL: http://statistics.netbeans.org/except...
Keywords: RANDOM
Depends on:
Blocks:
 
Reported: 2008-08-01 18:07 UTC by Roman Mostyka
Modified: 2009-06-26 08:52 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 85362


Attachments
stacktrace (1.22 KB, text/plain)
2008-08-01 18:08 UTC, Roman Mostyka
Details
stacktrace (1.14 KB, text/plain)
2008-08-04 11:17 UTC, Roman Mostyka
Details
stacktrace (1.22 KB, text/plain)
2008-08-08 15:40 UTC, ranbato
Details
stacktrace (1.22 KB, text/plain)
2008-08-19 10:17 UTC, schnappi
Details
stacktrace (1.22 KB, text/plain)
2008-08-19 14:16 UTC, Roman Mostyka
Details
stacktrace (1.22 KB, text/plain)
2008-08-23 10:44 UTC, alcmontejo
Details
Stack Traces (2.17 KB, text/plain)
2008-11-18 21:42 UTC, nleck
Details
Errro after appying patch (2.58 KB, text/plain)
2008-11-19 04:23 UTC, nleck
Details
sybase jconnect view data result (84.52 KB, image/png)
2008-11-24 22:59 UTC, John Baker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2008-08-01 18:07:51 UTC
Build: NetBeans IDE Dev (Build 080801)
VM: Java HotSpot(TM) Client VM, 11.0-b13, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b26
OS: Windows XP, 5.1, x86

User Comments: 
1. Connect to MS SQL Server (not sure that issue reproducible only on this server).
2. Rightclick some table and choose "View Data...".

Result: NullPointerException arises.

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.db.dataview.output.DataViewTablePanel.<init>(DataViewTablePanel.java:89)
        at org.netbeans.modules.db.dataview.output.DataViewUI.<init>(DataViewUI.java:146)
        at org.netbeans.modules.db.dataview.output.DataView.createComponents(DataView.java:128)
        at org.netbeans.modules.db.dataview.api.DataView.createComponents(DataView.java:88)
        at org.netbeans.modules.db.sql.loader.SQLEditorSupport$2.run(SQLEditorSupport.java:328)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
Comment 1 Roman Mostyka 2008-08-01 18:08:01 UTC
Created attachment 66339 [details]
stacktrace
Comment 2 Roman Mostyka 2008-08-04 11:17:13 UTC
Build: NetBeans IDE Dev (Build 080804)
VM: Java HotSpot(TM) Client VM, 1.5.0_13-121, Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_13-b05-241
OS: Mac OS X, 10.4.11, i386

User Comments: 
1. Connect to DB.
2. Rightclick some table ad choose "View Data...".
3. Disconnect during retrieve data.

Result: NullPointerException arises.

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.db.dataview.output.DataViewTablePanel.<init>(DataViewTablePanel.java:89)
        at org.netbeans.modules.db.dataview.output.DataViewUI.<init>(DataViewUI.java:146)
        at org.netbeans.modules.db.dataview.output.DataView.createComponents(DataView.java:130)
        at org.netbeans.modules.db.dataview.api.DataView.createComponents(DataView.java:88)
        at org.netbeans.modules.db.sql.loader.SQLEditorSupport$2.run(SQLEditorSupport.java:328)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
Comment 3 Roman Mostyka 2008-08-04 11:17:26 UTC
Created attachment 66459 [details]
stacktrace
Comment 4 David Vancouvering 2008-08-04 22:59:56 UTC
jawed, can you please evaluate this issue (that means assigning a Target Milestone).  Thanks.
Comment 5 ranbato 2008-08-08 15:40:09 UTC
Build: NetBeans IDE Dev (Build 200808061401)
VM: Java HotSpot(TM) Client VM, 10.0-b22, Java(TM) SE Runtime Environment, 1.6.0_06-b02
OS: Windows XP, 5.1, x86

User Comments: 
tried to execute sp_helptext

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.db.dataview.output.DataViewTablePanel.<init>(DataViewTablePanel.java:89)
        at org.netbeans.modules.db.dataview.output.DataViewUI.<init>(DataViewUI.java:146)
        at org.netbeans.modules.db.dataview.output.DataView.createComponents(DataView.java:128)
        at org.netbeans.modules.db.dataview.api.DataView.createComponents(DataView.java:88)
        at org.netbeans.modules.db.sql.loader.SQLEditorSupport$2.run(SQLEditorSupport.java:332)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
Comment 6 ranbato 2008-08-08 15:40:12 UTC
Created attachment 66906 [details]
stacktrace
Comment 7 schnappi 2008-08-19 10:17:31 UTC
Build: NetBeans IDE 6.5 Beta (Build 200808111757)
VM: Java HotSpot(TM) Client VM, 11.0-b12, Java(TM) SE Runtime Environment, 1.6.0_10-beta-b25
OS: Windows XP, 5.1, x86

User Comments: 
Running a SQL query (select * from table) on an Oracle database.

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.db.dataview.output.DataViewTablePanel.<init>(DataViewTablePanel.java:89)
        at org.netbeans.modules.db.dataview.output.DataViewUI.<init>(DataViewUI.java:146)
        at org.netbeans.modules.db.dataview.output.DataView.createComponents(DataView.java:130)
        at org.netbeans.modules.db.dataview.api.DataView.createComponents(DataView.java:88)
        at org.netbeans.modules.db.sql.loader.SQLEditorSupport$2.run(SQLEditorSupport.java:328)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
Comment 8 schnappi 2008-08-19 10:17:48 UTC
Created attachment 67772 [details]
stacktrace
Comment 9 Roman Mostyka 2008-08-19 14:16:24 UTC
Build: NetBeans IDE Dev (Build 080819)
VM: Java HotSpot(TM) Client VM, 11.0-b13, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b26
OS: Windows XP, 5.1, x86

User Comments: 
1. Added MS SQL Server driver.
2. Added MS SQL Server to the IDE.
3. Rightclick some table and choose "View Data...".
4. Rightclick another table quickly and choose "View Data...".

Result: NullPointerException arises.

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.db.dataview.output.DataViewTablePanel.<init>(DataViewTablePanel.java:89)
        at org.netbeans.modules.db.dataview.output.DataViewUI.<init>(DataViewUI.java:146)
        at org.netbeans.modules.db.dataview.output.DataView.createComponents(DataView.java:128)
        at org.netbeans.modules.db.dataview.api.DataView.createComponents(DataView.java:88)
        at org.netbeans.modules.db.sql.loader.SQLEditorSupport$2.run(SQLEditorSupport.java:332)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
Comment 10 Roman Mostyka 2008-08-19 14:16:33 UTC
Created attachment 67808 [details]
stacktrace
Comment 11 Exceptions Reporter 2008-08-22 11:03:12 UTC
This issue has already 5 duplicates 
see http://statistics.netbeans.org/exceptions/detail.do?id=85362
Comment 12 alcmontejo 2008-08-23 10:44:31 UTC
Build: NetBeans IDE Dev (Build 200808221401)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06, Java(TM) SE Runtime Environment, 1.6.0_02-b06
OS: Windows XP, 5.1, x86

User Comments: 
hi!

Good day!

Got this exception when I run my SQL select statement
Thanks and more power,
Allen Montejo

Stacktrace: 
java.lang.NullPointerException
        at org.netbeans.modules.db.dataview.output.DataViewTablePanel.<init>(DataViewTablePanel.java:89)
        at org.netbeans.modules.db.dataview.output.DataViewUI.<init>(DataViewUI.java:146)
        at org.netbeans.modules.db.dataview.output.DataView.createComponents(DataView.java:128)
        at org.netbeans.modules.db.dataview.api.DataView.createComponents(DataView.java:88)
        at org.netbeans.modules.db.sql.loader.SQLEditorSupport$2.run(SQLEditorSupport.java:332)
        at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
Comment 13 alcmontejo 2008-08-23 10:44:35 UTC
Created attachment 68156 [details]
stacktrace
Comment 14 jawed 2008-08-25 12:04:26 UTC
I did try with MS SQL Server to re create this problem but i don't see any exception being thrown out. It works fine for
me. can you please test with latest installer. Let me know the steps you are following in case you still get NPE.
Comment 15 Roman Mostyka 2008-08-25 12:27:01 UTC
I followed steps in desc10 and still able to reproduce this issue with latest build.
Probably it depends on connection speed, since my connection to MS SQL Server is pretty slow.
Comment 16 Roman Mostyka 2008-08-26 13:16:51 UTC
I changed my MS SQL Server driver from 1.1.1501.101 to 1.2.2828.100 and everything is fine now, so probably changing
driver to latest should help.
Comment 17 Roman Mostyka 2008-08-26 13:17:35 UTC
Verified.
Comment 18 ranbato 2008-09-22 22:47:31 UTC
I am getting this in build 200809220201 with the Merlia 7.03 driver.
Comment 19 _ ahimanikya 2008-10-09 11:31:51 UTC
Not sure about Merlia 7.03 driver, I don't think that in our supported driver list.
Comment 20 Roman Mostyka 2008-10-09 12:05:05 UTC
Actually my issue were fixed.
Comment 21 Roman Mostyka 2008-10-09 12:05:55 UTC
Fixed.
Comment 22 Roman Mostyka 2008-10-09 12:06:43 UTC
Verified.
Comment 23 ranbato 2008-10-09 16:39:54 UTC
I just got it in 200810080201 running a sp_helptext on a stored procedure with Merlia 7.03 driver
Comment 24 Roman Mostyka 2008-10-13 11:30:53 UTC
This issue for supported DBs was fixed. At least I don't see it.
ranbato, can You file new issue for particular driver with steps to reproduce and attached message.log.
Since Merlia isn't supported driver, we should track this issue in separate thread.
Sorry for inconvenience.
Comment 25 Roman Mostyka 2008-10-13 11:55:56 UTC
Verified.
Comment 26 ranbato 2008-10-21 22:59:42 UTC
I have added 150950
Comment 27 Roman Mostyka 2008-10-22 11:00:21 UTC
Thanks ranbato.
Comment 28 Exceptions Reporter 2008-11-08 06:03:49 UTC
Reopening - reproduced in NetBeans IDE 6.5 RC2 (Build 200810270001)
http://statistics.netbeans.org/exceptions/detail.do?id=137488
Comment 29 nleck 2008-11-13 04:10:49 UTC
guys, this makes the SQL editor useless in 6.5 

This worked in 6.1 and previous builds of 6.5

Comment 30 John Baker 2008-11-13 06:50:44 UTC
MS SQL Server driver is not fully JDBC compliant, maybe that's the cause ?

How about trying the jTDS driver
Comment 31 nleck 2008-11-13 07:18:06 UTC
We're using Sybase. 

This was working in the daily builds of 6.5 so it's a very recent change that has broken it. 

Which other databases aren't working now ? 
Comment 32 David Vancouvering 2008-11-13 17:36:01 UTC
We really need to get this fixed ASAP and get it into the patch release.  I am not sure what changed but we need to
track this down.  jawed, please confirm that you're working on this; if I don't hear from you in 24 hours I'll reassign.
Comment 33 John Baker 2008-11-14 08:05:19 UTC
There was a change on Oct 17 that looks suspicious.
http://hg.netbeans.org/main?cmd=changeset;node=70ca140cad82

DBMetaDataFactory.getForeignKeys(...)  was changed to return null if an exception occurred.

I see David caught this change (sent feedback) but this hasn't been fixed.
Comment 34 John Baker 2008-11-14 08:09:41 UTC
however, reverting the change mentioned in my last comment may not fix the bug - I would expect a different exception to
occur.  So, maybe that isn't the cause of this exception, just a guess.
Comment 35 nleck 2008-11-17 03:41:48 UTC
do you want me to test a patch ? 

We use a combination of Postgres, Sybase and Oracle.
Comment 36 jawed 2008-11-17 09:01:59 UTC
I am not able to re produce this with Oracle, MySQL, MS SQL Server databases, though with Merlia driver i can see the
same NPE exception but Merlia is not supported driver. Can you please help me to re-create this problem.

John, This problem is not because of the fix : http://hg.netbeans.org/main?cmd=changeset;node=70ca140cad82.
Comment 37 nleck 2008-11-17 09:21:13 UTC
We use jConnect from Sybase running on Solaris. 
Comment 38 nleck 2008-11-17 23:15:58 UTC
It has been broken very recently. It was working in previous builds of 6.5 and of course in 6.1 so we are taking a
backward step. 

For Sybase databases it doesn't work at all ( previously did) 

Works fine for Postgres thou. 

Is there more logging or some more details I can give you so that you can fix ? 
Comment 39 John Baker 2008-11-18 00:37:16 UTC
If the stack trace differs from any of the stacktraces, then yes, please attach the sybase stack trace
Comment 40 David Vancouvering 2008-11-18 17:08:40 UTC
jawed: Please try with Sybase.  

I just checked with QE, and Sybase is not on our list of supported databases.  That doesn't mean I'll close the bug, but
it does mean I'm going to downgrade this to a P2.
Comment 41 John Baker 2008-11-18 17:38:17 UTC
 nleck, instead of using the jConnect driver, could you please try the jTDS driver ?

Driver Location 	 http://sourceforge.net/project/showfiles.php?group_id=33291
Driver Version 	jTDS 1.2.1 jtds-1.2.1-dist.zip
Driver JAR File	jtds-1.2.1.jar
Driver Classname 	net.sourceforge.jtds.jdbc.Driver
URL Format 	jdbc:jtds:sqlserver://<host>[:<port>][/<database>][;<property>=<value>[;...]]
Comment 42 nleck 2008-11-18 19:54:11 UTC
wow Sybase is has a huge install base on Solaris in the banking instustry... it really should be one of your supported
databaases. 

Again this was working as of a few releases ago and it's a NPE which is normally the easiest of all bugs to fix, ie give
it a default value at the line number that it fails on. 
Comment 43 David Vancouvering 2008-11-18 20:23:57 UTC
I know, I know, but we are only a small team and can only cover so much.  Each database requires setting up an
environment and keeping it up and running.  Hey, I *worked* at Sybase for 10 years, so I know what a great database it is.

But take a look at this

http://davidvancouvering.blogspot.com/2008/11/httpstatisticsnetbeansorganalyticsgraph.html

Sybase falls within "other".  This is consistent with surveys and activity on the nbusers list.

So, we have to prioritize...

I'm not saying we won't fix this - we should and I would really like to, and let's work on getting it fixed.  I'd really
like to get it in the patch release.  It just can't be a P1 blocker if it's not a supported database vendor.

Can you please send us your *specific* stack trace that you get? That would really help.

Meanwhile, Roman, do you think you can set up a Sybase environment?
Comment 44 David Vancouvering 2008-11-18 20:24:49 UTC
By the way, we should get this to work with jConnect, it's the official TDS driver for Sybase.  But it would be
interesting to see if you can work around this by using jTDS.
Comment 45 nleck 2008-11-18 21:12:57 UTC
It works with the jTDS driver, thanks.
Comment 46 David Vancouvering 2008-11-18 21:36:54 UTC
OK, this seems like a reasonable workaround.  But I'd still like to see if we can get this fixed.  Can you please attach
the stack trace you get with jConnect?
Comment 47 nleck 2008-11-18 21:42:35 UTC
Created attachment 73888 [details]
Stack Traces
Comment 48 John Baker 2008-11-18 21:55:33 UTC
Looks very similar to 153219 - I think the fix proposed by sansan might fix this

jConnect doesn't support getTableName
Comment 49 nleck 2008-11-18 22:11:31 UTC
yes, this looks like the same issue. Should we mark this bug as a dependant of #153219 ?
Comment 50 John Baker 2008-11-18 22:23:14 UTC
Since we don't know for sure, we can just leave the issues as is 

Comment 51 John Baker 2008-11-19 03:30:36 UTC
153219 was fixed so waiting for nleck to confirm that this fixed also (possibly duplicates)
Comment 52 nleck 2008-11-19 04:23:00 UTC
Created attachment 73895 [details]
Errro after appying patch
Comment 53 John Baker 2008-11-19 05:32:13 UTC
No metadata can be retrieved using jConnect

Looks like the only way to execute Sybase queries is to use the jTDS driver.

Reducing the priority, changing TM to next
Comment 54 John Baker 2008-11-19 05:58:30 UTC
restoring the priority to 2.

I think there should be another way to execute queries for Sybase even if no metadata is available.
Comment 55 John Baker 2008-11-19 06:32:46 UTC
another user says "
"The same problem was with Merlia driver for MS SQL Server. Metadata could not be retrieved using this driver. "
Comment 56 John Baker 2008-11-19 07:27:45 UTC
Update.  The fix for 153219 fixes the problem with using the Merlia driver with MS SQLServer

At this point, the only driver that we know fails is the jConnect driver with Sybase
Comment 57 John Baker 2008-11-19 08:42:16 UTC
I'm going to try to install Sybase to try this out.

Just to be sure thought, when using jConnect you should use version 6.0.5 or later
and the driver class is com.sybase.jdbc3.jdbc.SybDriver

nleck are these the version and class you are using ?
Comment 58 John Baker 2008-11-21 04:11:34 UTC
Hi shikua , did you intend to change the component of this issue to schema2beans ?

Do you have any more comments to add, here?
Comment 59 John Baker 2008-11-21 07:04:23 UTC
This bug (in db.dataview) has mostly been fixed - fix is in the trunk builds and might be available in the 6.5 patch

The remaining bug occurs when using the jConnect driver.  A workaround is to use the jTDS driver.
Comment 60 _ ahimanikya 2008-11-21 20:53:25 UTC
*** Issue 150950 has been marked as a duplicate of this issue. ***
Comment 61 John Baker 2008-11-24 22:59:37 UTC
Created attachment 74103 [details]
sybase jconnect view data result
Comment 62 John Baker 2008-11-24 23:02:43 UTC
The fix for 153219  also fixes this issue.

To connect to Sybase, use jConnect6.0.5

Driver jar:  jconn3.jar
Driver class: com.sybase.jdbc3.jdbc.SybDataSource

See attached screenshot sybase_jconnect6_result.PNG showing successful view data result

Verified using this build:   Product Version: NetBeans IDE Dev (Build 200811240201)

*** This issue has been marked as a duplicate of 153219 ***
Comment 63 Roman Mostyka 2008-11-25 09:47:06 UTC
Fixed.
Comment 64 Roman Mostyka 2008-11-25 09:47:50 UTC
Fixed with issue #153219.
Comment 65 Roman Mostyka 2008-11-25 09:50:16 UTC
Verified.
Comment 66 nleck 2008-11-25 10:21:36 UTC
this is *NOT* fixed as of 6.5....

Unless your talking about a daily build this issue should be re-opened.
Comment 67 John Baker 2008-11-25 14:21:06 UTC
6.5 was already released, so can only be included in patch releases of 6.5

The fix has been verified using the trunk builds.  I mentioned this in a previous comment des60

Fix is going to be included in 6.5 Patch 1