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 261587 - NullPointerException at org.netbeans.lib.profiler.results.jdbc.JdbcResultsSnapshot.performInit
Summary: NullPointerException at org.netbeans.lib.profiler.results.jdbc.JdbcResultsSna...
Status: CLOSED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 8.2
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-14 15:51 UTC by chunkyks
Modified: 2016-05-24 15:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter: 224042


Attachments
stacktrace (826 bytes, text/plain)
2016-05-14 15:51 UTC, chunkyks
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chunkyks 2016-05-14 15:51:44 UTC
Build: NetBeans IDE Dev (Build 201605140002)
VM: Java HotSpot(TM) 64-Bit Server VM, 25.91-b14, Java(TM) SE Runtime Environment, 1.8.0_91-b14
OS: Linux

User Comments:
chunkyks: I chose the new SQL Profiler, ran my application [swing desktop app] that uses sqlite jdbc 3.8.11 from here: https://bitbucket.org/xerial/sqlite-jdbc/downloads

This exception appeared as soon as I exit my program. As I type this, the GUI is still up on screen but locked with the "exit" button still depressed.




Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.lib.profiler.results.jdbc.JdbcResultsSnapshot.performInit(JdbcResultsSnapshot.java:375)
   at org.netbeans.lib.profiler.results.jdbc.JdbcResultsSnapshot.<init>(JdbcResultsSnapshot.java:133)
   at org.netbeans.lib.profiler.ProfilerClient.getJdbcProfilingResultsSnapshot(ProfilerClient.java:694)
   at org.netbeans.modules.profiler.ResultsManager.prepareSnapshot(ResultsManager.java:888)
   at org.netbeans.modules.profiler.ResultsManager.prepareSnapshot(ResultsManager.java:853)
   at org.netbeans.modules.profiler.ResultsManager.takeSnapshot(ResultsManager.java:1123)
Comment 1 chunkyks 2016-05-14 15:51:46 UTC
Created attachment 159770 [details]
stacktrace
Comment 2 Tomas Hurka 2016-05-18 12:19:11 UTC
Thanks for the report. Can you provide exact steps how to reproduce it? Thanks.
Comment 3 chunkyks 2016-05-21 17:15:42 UTC
1) Download
https://bitbucket.org/xerial/sqlite-jdbc/downloads/sqlite-jdbc-3.8.11.jar
2) Create a new netbeans project, add that jarfile as a library [I don't know how relevant specific version is, 3.8.11 is the one I'm using locally]
3) Sufficient test case to get the crash, here:
    public static void main(String[] args) throws SQLException {
        Connection dbConn = DriverManager.getConnection("jdbc:sqlite::memory:");
    }
4) Attempt to profile project. Choose "SQL Queries" in dropdown, and click "<green play button> Profile"
4a) Wait while program executes [it won't take long]
5) NB Exception.
Comment 4 chunkyks 2016-05-21 17:20:54 UTC
Product Version: NetBeans IDE Dev (Build 201605140002)
Java: 1.8.0_91; Java HotSpot(TM) 64-Bit Server VM 25.91-b14
Runtime: Java(TM) SE Runtime Environment 1.8.0_91-b14
System: Linux version 4.2.0-36-generic running on amd64; UTF-8; en_US (nb)
User directory: /home/chunky/.netbeans/dev
Cache directory: /home/chunky/.cache/netbeans/dev
Comment 5 Tomas Hurka 2016-05-23 09:21:00 UTC
Thanks for the steps. I am able to reproduce it.
Comment 6 Tomas Hurka 2016-05-23 12:44:43 UTC
Fixed in profiler-main

changeset:   296787:6b396808c17e
user:        Tomas Hurka <thurka@netbeans.org>
date:        Mon May 23 14:40:53 2016 +0200
summary:     bugfix #261587, allow empty snapshot
Comment 7 chunkyks 2016-05-23 15:15:57 UTC
I get the same null pointer exception with this code, which does a couple bare-bones queries:

    public static void main(String[] args) throws SQLException {
        Connection dbConn = DriverManager.getConnection("jdbc:sqlite::memory:");
        Statement stmt = dbConn.createStatement();
        stmt.executeUpdate("CREATE TABLE foo (bar INTEGER PRIMARY KEY, baz TEXT)");
        stmt.executeUpdate("INSERT INTO foo (baz) VALUES ('kittens')");
        
        ResultSet rs = stmt.executeQuery("SELECT baz FROM foo");
        if(rs.next()) {
            String baz = rs.getString("baz");
            System.out.println("Got a value of \"" + baz + "\" from query");
        }
    }

Should I be concerned that this is due to an "empty snapshot"? Or shall I try tonight's nightly build and submit a bug if I don't see any results?
Comment 8 Tomas Hurka 2016-05-23 18:07:08 UTC
(In reply to chunkyks from comment #7)
[..]
> Should I be concerned that this is due to an "empty snapshot"? Or shall I
> try tonight's nightly build and submit a bug if I don't see any results?
This looks like different issue. Please file new issue. Thanks.
Comment 9 Quality Engineering 2016-05-24 01:48:23 UTC
Integrated into 'main-silver', will be available in build *201605240002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/6b396808c17e
User: Tomas Hurka <thurka@netbeans.org>
Log: bugfix #261587, allow empty snapshot
Comment 10 chunkyks 2016-05-24 15:33:57 UTC
Confirming crash bug fixed in 201605240002, marking bug as closed.