akarshan2701 / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

General error: "java.lang.NullPointerException"; #153

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
(simple SQL scripts or simple standalone applications are preferred)
Not always reproducable. The query either runs indefinetly or returns with
the error shown at the end of the comment.

What is the expected output? What do you see instead?
None or some rows.

What version of the product are you using? On what operating system, file
system, and virtual machine?
I just update to the latest h2 1.2.126. I'm using linux 2.6.31.6 on ext3
with java "1.6.0_12"

Do you know a workaround?
Nope.

How important/urgent is the problem for you?
I've looked into this for some days because I thought I used some slow
queries. Have the "same" problem with other queries that contain a lot of
" WHERE NOT EXISTS (SELECT... ) ". But now I have found a query that
doesn't finish and doen't contain a sub select. Now I'm lost. :(

In your view, is this a defect or a feature request?
defect

Please provide any additional information below.

Maybe a hint. I'm using the TEXT datatype for most of the columns.
The table objectPropertyAssertion has about 8k rows and classAssertion
about 20k rows.

SELECT prp1.subject AS left, prp2.subject AS right, MIN(prp1.id) AS
sourceId1, 'objectPropertyAssertion' AS sourceTable1, MIN(prp1.id) AS
sourceId2, 'objectPropertyAssertion' AS sourceTable2, MIN(clsA.id) AS
sourceId3, 'classAssertionEnt' AS sourceTable3
FROM classAssertionEnt AS clsA
INNER JOIN objectPropertyAssertion AS prp1 ON clsA.entity = prp1.property
INNER JOIN objectPropertyAssertion AS prp2 ON clsA.entity = prp2.property
AND prp1.object = prp2.object
WHERE clsA.class = 'http://www.w3.org/2002/07/owl#InverseFunctionalProperty';
Allgemeiner Fehler: "java.lang.NullPointerException"
General error: "java.lang.NullPointerException"; SQL statement:
SELECT prp1.subject AS left, prp2.subject AS right, MIN(prp1.id) AS
sourceId1, 'objectPropertyAssertion' AS sourceTable1, MIN(prp1.id) AS
sourceId2, 'objectPropertyAssertion' AS sourceTable2, MIN(clsA.id) AS
sourceId3, 'classAssertionEnt' AS sourceTable3
FROM classAssertionEnt AS clsA
INNER JOIN objectPropertyAssertion AS prp1 ON clsA.entity = prp1.property
INNER JOIN objectPropertyAssertion AS prp2 ON clsA.entity = prp2.property
AND prp1.object = prp2.object
WHERE clsA.class =
'http://www.w3.org/2002/07/owl#InverseFunctionalProperty' [50000-126]
HY000/50000 (Help)
org.h2.jdbc.JdbcSQLException: Allgemeiner Fehler:
"java.lang.NullPointerException"
General error: "java.lang.NullPointerException"; SQL statement:
SELECT prp1.subject AS left, prp2.subject AS right, MIN(prp1.id) AS
sourceId1, 'objectPropertyAssertion' AS sourceTable1, MIN(prp1.id) AS
sourceId2, 'objectPropertyAssertion' AS sourceTable2, MIN(clsA.id) AS
sourceId3, 'classAssertionEnt' AS sourceTable3
     FROM classAssertionEnt AS clsA
         INNER JOIN objectPropertyAssertion AS prp1 ON clsA.entity =
prp1.property
         INNER JOIN objectPropertyAssertion AS prp2 ON clsA.entity =
prp2.property AND prp1.object = prp2.object
     WHERE clsA.class =
'http://www.w3.org/2002/07/owl#InverseFunctionalProperty' [50000-126]
    at org.h2.message.Message.getSQLException(Message.java:110)
    at org.h2.message.Message.convert(Message.java:287)
    at org.h2.message.Message.convert(Message.java:248)
    at org.h2.command.Command.executeQuery(Command.java:134)
    at org.h2.server.TcpServerThread.process(TcpServerThread.java:283)
    at org.h2.server.TcpServerThread.run(TcpServerThread.java:137)
    at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
    at org.h2.util.CacheLRU.removeOld(CacheLRU.java:137)
    at org.h2.util.CacheLRU.removeOldIfRequired(CacheLRU.java:124)
    at org.h2.util.CacheLRU.put(CacheLRU.java:102)
    at org.h2.store.PageStore.getPage(PageStore.java:548)
    at org.h2.index.PageDataIndex.getPage(PageDataIndex.java:213)
    at org.h2.index.PageDataNode.getNextPage(PageDataNode.java:241)
    at org.h2.index.PageDataLeaf.getNextPage(PageDataLeaf.java:377)
    at org.h2.index.PageDataCursor.nextRow(PageDataCursor.java:96)
    at org.h2.index.PageDataCursor.next(PageDataCursor.java:55)
    at org.h2.index.IndexCursor.next(IndexCursor.java:184)
    at org.h2.table.TableFilter.next(TableFilter.java:279)
    at org.h2.table.TableFilter.next(TableFilter.java:310)
    at org.h2.command.dml.Select.queryGroup(Select.java:309)
    at org.h2.command.dml.Select.queryWithoutCache(Select.java:553)
    at org.h2.command.dml.Query.query(Query.java:243)
    at org.h2.command.CommandContainer.query(CommandContainer.java:81)
    at org.h2.command.Command.executeQuery(Command.java:132)
    ... 3 more

    at org.h2.engine.SessionRemote.done(SessionRemote.java:522)
    at org.h2.command.CommandRemote.executeQuery(CommandRemote.java:161)
    at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:172)
    at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:151)
    at org.h2.server.web.WebApp.getResult(WebApp.java:1290)
    at org.h2.server.web.WebApp.query(WebApp.java:931)
    at org.h2.server.web.WebApp.process(WebApp.java:192)
    at org.h2.server.web.WebApp.processRequest(WebApp.java:139)
    at org.h2.server.web.WebThread.process(WebThread.java:137)
    at org.h2.server.web.WebThread.run(WebThread.java:94)
    at java.lang.Thread.run(Thread.java:619)

Original issue reported on code.google.com by stefan.l...@gmail.com on 21 Dec 2009 at 3:34

GoogleCodeExporter commented 8 years ago
Hi,

This looks like a serious problem. I have a few questions:

- What is your database URL?
- Did you use multiple connections?
- Did the application run out of memory (once, or multiple times)?
- Do you use any settings or special features (for example, the setting
    LOG=0, or two phase commit, linked tables, cache settings)?
- Is the application multi-threaded?
- What operating system, file system, and virtual machine
    (java -version) do you use?
- Is it (or was it at some point) a networked file system?
- How big is the database (file sizes)?
- How much heap memory does the Java process have?
- Is the database usually closed normally, or is process terminated
    forcefully or the computer switched off?
- Is it possible to reproduce this problem using a fresh database
    (sometimes, or always)?
- Are there any other exceptions (maybe in the .trace.db file)?
    Could you send them please?
- Do you still have any .trace.db files, and if yes could you send them?

Regards,
Thomas

Original comment by thomas.t...@gmail.com on 21 Dec 2009 at 4:04

GoogleCodeExporter commented 8 years ago
- What is your database URL?
 jdbc:h2:tcp://localhost//absolutepath;MULTI_THREADED=TRUE
- Did you use multiple connections?
 My application used a single connection but I used the web inferface at the same time.
- Did the application run out of memory (once, or multiple times)?
 Not that I know of.
- Do you use any settings or special features (for example, the setting
    LOG=0, or two phase commit, linked tables, cache settings)?
MULTI_THREADED=TRUE but I just used it two access the db from the website while 
the
query was runnning.
- Is the application multi-threaded?
 No.
- What operating system, file system, and virtual machine
    (java -version) do you use?
 is stated above
- Is it (or was it at some point) a networked file system?
 no
- How big is the database (file sizes)?
 about 50MB
- How much heap memory does the Java process have?
 I'm not sure but around 500-800MB
- Is the database usually closed normally, or is process terminated
    forcefully or the computer switched off?
 Normally not but when the queries didn't finish I had to kill the process.
- Is it possible to reproduce this problem using a fresh database
    (sometimes, or always)?
Not really. I have used a fresh database and the query didn't finish but I 
wasn't
able to reproduce the thrown exception.
- Are there any other exceptions (maybe in the .trace.db file)?
    Could you send them please?
- Do you still have any .trace.db files, and if yes could you send them?
I don't have the failed .trace.db but my memory tells me and further tests 
showed
that the file stays empty.

I want to correct the stated table sizes. The table classAssertionEnt has about 
6k
rows and the table objectPropertyAssertion has about 36k rows. The tables are 
joined
on columns that are primary keys and the column in the where condition is also 
part
of a primary key.

Original comment by stefan.l...@gmail.com on 22 Dec 2009 at 10:58

GoogleCodeExporter commented 8 years ago
Could you try without using MULTI_THREADED=TRUE ? This setting is not fully 
tested
yet. See also http://www.h2database.com/html/faq.html#reliable "Areas considered
experimental are". Also documented at
http://www.h2database.com/html/grammar.html#set_multi_threaded

I'm not saying it's not a bug, but that could be the reason.

Original comment by thomas.t...@gmail.com on 22 Dec 2009 at 8:19

GoogleCodeExporter commented 8 years ago
I change the bug to "works for me", because I don't have enough information to
reproduce the problem.

Original comment by thomas.t...@gmail.com on 30 Jan 2010 at 3:01