You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by vibhuti <vi...@ThePSI.com> on 2008/07/01 11:11:18 UTC
java.sql.SQLException: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression.
Hi
Following exception occurs while running our application with embedded derby
database. The application uses multithreading. This exception occurs while
insert query is executed. The insert query is run using JDBC:
insert into sign (sign, month, day, offset, digest) values (?,?,?,?,?).
The table for which insert query is fired is:
create table sign(ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY PRIMARY
KEY, sign varchar(32), month char(6) not null, day char(2) not null, offset
bigint not null, digest varchar(32) for bit data not null)
There are multiple threads inserting data in database. I tried to search a
lot on net but could not find any solution. We're using derby 10.3.1.4. Not
sure about the root cause. It will be great if anybody provides some
solution because it is creating lot of problems in our application.
----------------------------------------------------------------------------
---------------------------------
Caused by: java.sql.SQLException: The exception
'java.lang.NullPointerException' was thrown while evaluating an expression.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknow
n
Source)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedConnection.handleException(Unknown
Source)
at
org.apache.derby.impl.jdbc.ConnectionChild.handleException(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown
Source)
at
org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown
Source)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Delegating
PreparedStatement.java:101)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(Delegating
PreparedStatement.java:101)
at src.app.database.derby.Derby.insertData(Derby.java:132)
... 17 more
Caused by: java.sql.SQLException: The exception
'java.lang.NullPointerException' was thrown while evaluating an expression.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossD
RDA(Unknown
Source)
... 30 more
Caused by: java.sql.SQLException: Java exception: ':
java.lang.NullPointerException'.
at
org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
Source)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransportAcrossD
RDA(Unknown
Source)
at
org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
Source)
at org.apache.derby.impl.jdbc.Util.javaException(Unknown Source)
at
org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknow
n
Source)
... 27 more
Caused by: java.lang.NullPointerException
at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unkno
wn
Source)
at
org.apache.derby.impl.store.raw.data.BaseDataFileFactory.openContainer(Unkno
wn
Source)
at org.apache.derby.impl.store.raw.xact.Xact.openContainer(Unknown
Source)
at
org.apache.derby.impl.store.access.conglomerate.OpenConglomerate.init(Unknow
n
Source)
at org.apache.derby.impl.store.access.heap.Heap.open(Unknown Source)
at
org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown
Source)
at
org.apache.derby.impl.store.access.RAMTransaction.openConglomerate(Unknown
Source)
at
org.apache.derby.impl.sql.catalog.DataDictionaryImpl.getSetAutoincrementValu
e(Unknown
Source)
at
org.apache.derby.impl.sql.execute.InsertResultSet.getSetAutoincrementValue(U
nknown
Source)
at
org.apache.derby.impl.sql.execute.BaseActivation.getSetAutoincrementValue(Un
known
Source)
at
org.apache.derby.exe.acd89d8024x0119xf710x52e1x000002ea2ea00.e0(Unknown
Source)
at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown
Source)
at
org.apache.derby.impl.sql.execute.RowResultSet.getNextRowCore(Unknown
Source)
at
org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown
Source)
at
org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown
Source)
at org.apache.derby.impl.sql.execute.InsertResultSet.open(Unknown
Source)
at
org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown
Source)
... 23 more
----------------------------------------------------------------------------
------
Regards
Vibhuti
Re: java.sql.SQLException: The exception
'java.lang.NullPointerException' was thrown while evaluating an expression.
Posted by Kristian Waagan <Kr...@Sun.COM>.
vibhuti wrote:
>
>
> Hi
>
>
>
> Following exception occurs while running our application with embedded
> derby database. The application uses multithreading. This exception
> occurs while insert query is executed. The insert query is run using JDBC:
>
>
>
> insert into sign (sign, month, day, offset, digest) values (?,?,?,?,?).
>
>
>
> The table for which insert query is fired is:
>
>
>
> create table sign(ID INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY
> PRIMARY KEY, sign varchar(32), month char(6) not null, day char(2) not
> null, offset bigint not null, digest varchar(32) for bit data not null)
>
>
>
> There are multiple threads inserting data in database. I tried to search
> a lot on net but could not find any solution. We’re using derby
> 10.3.1.4. Not sure about the root cause. It will be great if anybody
> provides some solution because it is creating lot of problems in our
> application.
Hello,
If this bug is reproducible, are you able to replace the jar files with
the debug version?
You can download them from
http://db.apache.org/derby/releases/release-10.3.3.0.cgi
You could also try the 10.4 version, but that would require a database
update or starting with a fresh database.
The debug version will give us line number information, but you might
also see an assertion error instead of the NPE. This can give us a
better idea of what has gone wrong.
As always, providing a runnable repro is the best way to get someone to
fix the bug :)
For reference, this bug has been logged as DERBY-3746:
https://issues.apache.org/jira/browse/DERBY-3746
thanks,
--
Kristian
[ snip - NPE stack trace ]