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 152342 - IllegalArgumentException: Called DataObject.find on null
Summary: IllegalArgumentException: Called DataObject.find on null
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: SQL Editor (show other bugs)
Version: 6.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: John Baker
URL: http://statistics.netbeans.org/except...
Keywords:
: 152341 152343 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-11-04 19:18 UTC by Michel Graciano
Modified: 2008-11-06 16:31 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 136047


Attachments
sql history file (151 bytes, text/xml)
2008-11-06 08:01 UTC, John Baker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2008-11-04 19:18:40 UTC
Build: NetBeans IDE 6.5 RC2 (Build 200810270001)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-b33
OS: Linux, 2.6.27-7-generic, i386
User comments: 
STACKTRACE: (first 10 lines)
java.lang.IllegalArgumentException: Called DataObject.find on null
        at org.openide.loaders.DataObject.find(DataObject.java:477)
        at
org.netbeans.modules.db.sql.history.SQLHistoryPersistenceManager$AtomicFileAction.run(SQLHistoryPersistenceManager.java:216)
        at org.openide.filesystems.EventControl.runAtomicAction(EventControl.java:120)
        at org.openide.filesystems.FileSystem.runAtomicAction(FileSystem.java:502)
        at org.netbeans.modules.db.sql.history.SQLHistoryPersistenceManager.retrieve(SQLHistoryPersistenceManager.java:138)
        at
org.netbeans.modules.db.sql.history.SQLHistoryPersistenceManager.updateSQLSaved(SQLHistoryPersistenceManager.java:166)
        at org.netbeans.modules.db.sql.execute.ui.SQLHistoryPanel.updateSaveLimitUponReset(SQLHistoryPanel.java:425)
        at org.netbeans.modules.db.sql.execute.ui.SQLHistoryPanel.verifySQLLimit(SQLHistoryPanel.java:388)
        at org.netbeans.modules.db.sql.execute.ui.SQLHistoryPanel.sqlLimitButtonActionPerformed(SQLHistoryPanel.java:357)
        at org.netbeans.modules.db.sql.execute.ui.SQLHistoryPanel.access$900(SQLHistoryPanel.java:102)
Comment 1 Michel Graciano 2008-11-04 19:21:00 UTC
I executed several SQL during the day but now, end of the day, when I was search for history, no history was found and
this execption was thrown. What kind of details you need?
I can't reproduce it now again, but trying.
Comment 2 David Vancouvering 2008-11-04 20:50:35 UTC
*** Issue 152341 has been marked as a duplicate of this issue. ***
Comment 3 David Vancouvering 2008-11-04 20:50:54 UTC
*** Issue 152343 has been marked as a duplicate of this issue. ***
Comment 4 John Baker 2008-11-05 07:35:13 UTC
From the stack trace, it looks like first you changed or deleted your userdir then tried to change the save limit value
in the dialog.

SQLHistoryPersistenceManager.updateSQLSaved(SQLHistoryPersistenceManager.java:166)
uses the path of the history file which is located in the userdir.
However, this path was null so the history file could not be found.

Did you remove or change the location of the NetBeans userdir ?
Comment 5 Michel Graciano 2008-11-05 12:30:42 UTC
NO, I didn't change my userdir. I really have no idea what cause this problem, but if I am not wrong, it was the first
time I open the SQL history since I installed the RC2.
Comment 6 Michel Graciano 2008-11-05 12:42:04 UTC
Hi,
now I can reproduce it.
1-Open the RC2 and import settings from 6.1 (my 6.1 settings, in the truth is a renamed RC1 userdir) :)
2-Open the SQL history, and press Apply button. A message the history was cleaned is shown.
3-Press Apply again and you can see the exception in the IDE corner

I sent my history file to John privately and hope it could help.
 
Regards.
Comment 7 Michel Graciano 2008-11-05 12:44:16 UTC
BTW, there is any chance to fix it for FCS?
Comment 8 John Baker 2008-11-05 18:58:16 UTC
Thank you Michel for the steps to reproduce.

I have a question about the first step
> 1-Open the RC2 and import settings from 6.1 (my 6.1 settings, in the truth is a renamed RC1 userdir) :)

This means that RC2 is using the RC1 userdir?
Comment 9 David Vancouvering 2008-11-05 19:04:44 UTC
Sorry, RC2 is in the process of being "hardened" for FCS.  We could only check in serious showstoppers at this point
(maybe not even that).

Assuming we can identify the issue, we will get it into the first patch release.
Comment 10 John Baker 2008-11-05 19:16:18 UTC
If RC2 imports actual 6.1 settings then I can't reproduce.

Also, I tried the following (which is really not a valid use case):
1) Install RC1
2) Start RC1, import 6.1 settings
3) Execute a bunch of SQL statements
4) Install RC2
5) Copy RC1 userdir from 6.5rc1 to 6.5rc2
6) Start RC2 
7) Open SQL History

Result - many statements are missing 

Michel, is this the same thing you did?

If so, then this doesn't look like a bug to me since the userdir is copied from an earlier build not through the import
facility.  As a result, other features may not work as expected either.
Comment 11 John Baker 2008-11-05 19:22:32 UTC
correction:

Even for the invalid use case previously mentioned, there weren't any missing statements.
Comment 12 Michel Graciano 2008-11-05 19:41:23 UTC
No, I did:
1) Install RC1
2) Start RC1, import 6.1 settings
3) Execute a bunch of SQL statements
4) Copy .netbeans/rc1 to .netbeans/6.1
4) Install RC2
6) Start RC2, import "6.1" settings 
7) Open SQL History
8) Click Apply and a message that history was cleaned up is shown
9) Click Apply again and the exception is thrown.

It was I did. I understand this could be a patch, since just some users will import settings like that and 6.1 don't
have SQL history. I used this approach during all the NetCAT program, to don't lose so much time reconfiguring the IDE
time after time, and this is the first time I had this kind of problem.
Just to be clear, all the settings are imported correctly, maybe the file I sent to John privately has some problem, I
really don't know. Just let me know if you need more details. If necessary, I can send to you my rc1 userdir to
reproduce the issue.

Regards
Comment 13 John Baker 2008-11-05 21:43:17 UTC
I think I see what the problem is.
Nothing to do with importing previous version, etc.

It looks like the date executed is not parsed to a java.util.Date 
Comment 14 John Baker 2008-11-06 00:46:49 UTC
I think this bug can only occur if the user changes locales, but will test to confirm.

I have tested in ja locale and haven't seen this error.
Comment 15 Michel Graciano 2008-11-06 00:58:22 UTC
I don't change my locale for this, but I updated my Ubuntu from 8.04 to 8.10 and change encoding from UTF-8 to
ISO-8859-1. In the truth, I am always using ISO encoding, but after update, I needed to change the Ubuntu settings again
for some reason. Do you think that something like that could 'broke' the history file?
BTW, the update was done without run IDE, so, theoretically IDE was always executed with the same environment.

Regards
Comment 16 Michel Graciano 2008-11-06 01:20:40 UTC
Hi,
I just remember something that could help you. I always used my IDE without --locale parameter, but after RC@ where
pt_BR version is included, I switch to english using --locale en:US un netbeans.conf file. So, the original file was
created with pt_BR locale and now I tried to use it in en_US. What do you think?
Comment 17 John Baker 2008-11-06 01:34:22 UTC
Yes, I think the problem is changing the locale.
The DateFormat class expects the same locale.

Still, I should try to fix this for patch 1

Can you try running NetBeans with the pt_BR locale (the same locale used when executing the SQL) and see if History
opens correctly.  Thank you
Comment 18 John Baker 2008-11-06 05:58:22 UTC
I have a fix that changes the date format. Since this will go into the patch I need to make sure History is
forward-compatible
Comment 19 John Baker 2008-11-06 06:18:21 UTC
Steps to reproduce:

1) Run NetBeans in some locale 
2) Execute some SQL statements
3) Exit NetBeans, change locale, restart NetBeans
4) Try to open SQL History

dialog opens empty

If the Apply button is clicked to set the limit, then the IllegalArgumentException  occurs (but this is kind of a red
herring)
Comment 20 John Baker 2008-11-06 06:32:06 UTC

I'm going to create a new issue for SQL History not supporting the executing of SQL when NetBeans is running in another
locale.  This can be fixed for 7.0

Basically what happens in 6.5 is if there is any error parsing the sql_history.xml file then this file is removed
automatically.

The exception mentioned in this issue occurs when clicking the Apply button.  I'll fix this issue, but it's not that
serious.
Comment 21 John Baker 2008-11-06 08:00:40 UTC
To reproduce this exception:

1) create directory under userdir :
          config/Databases/SQLHISTORY
   and copy attached file sql_history.xml to this directory

2) Start NB and open the SQL Editor and SQL History

3) Click the Apply button a couple of times

The IllegalArgumentException occurs

Comment 22 John Baker 2008-11-06 08:01:26 UTC
Created attachment 73349 [details]
sql history file
Comment 23 John Baker 2008-11-06 08:03:57 UTC
acc0fb74a193
Comment 24 John Baker 2008-11-06 08:07:53 UTC
I forgot to mention to run NB in the en locale

Note, that due to the locale issues mentioned, the sql_history.xml file won't parse and SQL History will open blank
and after clicking Apply the sql_history.xml file is removed.  Message in the dialog says the sql_history file is reset.

I'll file a separate issue for the locale problem when running NB in multiple locales.
Comment 25 Michel Graciano 2008-11-06 11:53:26 UTC
I don't agree with P3. In the truth, it is P1 since cause data loss, but since happens just in special circumstances we
can use P2, but not P3. As I said in a similar issue on local history, if we can't trust in a feature, this feature is
totally unnecessary. BTW, any change to fix it for a patch1?

Regards.
Comment 26 Quality Engineering 2008-11-06 16:31:11 UTC
Integrated into 'main-golden', will be available in build *200811061401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/acc0fb74a193
User: John Baker <jbaker@netbeans.org>
Log: #152342 fix