read only db and luceneSupport

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

read only db and luceneSupport

Tulay Sri
Hi,

Within a java app I created a read-only database db.jar with lucenesupport and created a lucene index. I am now trying to use it to query within another java code as part of a large ETL job, However, when it comes to using the db to query lucene based tools, I get null pointer exception even to get the list of lucene indexes. If I simply query the base tables or if I unzip this db.jar and run lucene based queries, things are fine. Not sure where to start. Can anyone give me a hand to figure out what I am missing?

Thanks,
Tulay
Reply | Threaded
Open this post in threaded view
|

Re: read only db and luceneSupport

Tulay Sri

1. Query:
SELECT * FROM TABLE( LUCENESUPPORT.LISTINDEXES() ) T

2. StackTrace:

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.SQLExceptionFactory.getSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
    at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown 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.EmbedStatement.execute(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(Unknown Source)
   ...
Caused by: ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression.
    at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
    ... 18 more
Caused by: java.lang.NullPointerException
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI$1.run(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI.listDirectories(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI.<init>(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneSupport.listIndexes(Unknown Source)
    at org.apache.derby.exe.acf81e0010x015fx305axd8b7x000074ebfc881.g0(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
    at org.apache.derby.impl.sql.execute.VTIResultSet.openCore(Unknown Source)
    at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source)
    at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
    at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
    ... 11 more
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.SQLExceptionFactory.getSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
    at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown 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.EmbedStatement.execute(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(Unknown Source)
   ....
Caused by: ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression.
    at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
    ... 18 more
Caused by: java.lang.NullPointerException
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI$1.run(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI.listDirectories(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI.<init>(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneSupport.listIndexes(Unknown Source)
    at org.apache.derby.exe.acf81e0010x015fx305axd8b7x000074ebfc881.g0(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
    at org.apache.derby.impl.sql.execute.VTIResultSet.openCore(Unknown Source)
    at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source)
    at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
    at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
    ... 11 more


3. derby.log

Booting Derby (version The Apache Software Foundation - Apache Derby - 10.11.1.1 - (1616546)) instance a816c00e-015f-3087-b056-000074ebfde8
on database directory jar:(/sample/institution_name_to_type_db.jar)/institution_name_to_type_db in READ ONLY mode with class loader sun.misc.Launcher$AppClassLoader@18b4aac2.
Loaded from file:/export/home/foo/.gradle/caches/modules-2/files-2.1/org.apache.derby/derby/10.11.1.1/df4b50061e8e4c348ce243b921f53ee63ba9bbe1/derby-10.11.1.1.jar.
java.vendor=Oracle Corporation
java.runtime.version=1.8.0_144-b01
user.dir=/export/home/foo/IdeaProjects/bar
os.name=Linux
os.arch=amd64
os.version=4.4.0-93-generic
derby.system.home=null
derby.stream.error.file=/export/home/foo/IdeaProjects/bar/STREAMERROR.LOG
Database Class Loader started - derby.database.classpath=''


Error file is empty. 

Thanks,
Tulay

On Wed, Oct 18, 2017 at 9:46 AM, Tulay Sri <[hidden email]> wrote:
On 10/17/17 5:05 PM, Tulay Sri wrote:
> Hi,
>
> Within a java app I created a read-only database db.jar with 
> lucenesupport and created a lucene index. I am now trying to use it to 
> query within another java code as part of a large ETL job, However, 
> when it comes to using the db to query lucene based tools, I get null 
> pointer exception even to get the list of lucene indexes. If I simply 
> query the base tables or if I unzip this db.jar and run lucene based 
> queries, things are fine. Not sure where to start. Can anyone give me 
> a hand to figure out what I am missing?
>
> Thanks,
> Tulay

Can you post the following:

1) The SQL statement you are issuing which incurs the NPE

2) The full error message which comes back

3) The contents of derby.log or the portion of derby.log which records 
the details of this error

Thanks,

-Rick

Reply | Threaded
Open this post in threaded view
|

Re: read only db and luceneSupport

Rick Hillegas-3
The stack trace has no line numbers, so I can't tell what is failing. Can you try your experiment with a debug version of Derby (e.g., db-derby-10.13.1.1-lib-debug.zip)?

Thanks,
-Rick

On 10/18/17 10:34 AM, Tulay Sri wrote:

1. Query:
SELECT * FROM TABLE( LUCENESUPPORT.LISTINDEXES() ) T

2. StackTrace:

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.SQLExceptionFactory.getSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
    at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown 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.EmbedStatement.execute(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(Unknown Source)
   ...
Caused by: ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression.
    at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
    ... 18 more
Caused by: java.lang.NullPointerException
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI$1.run(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI.listDirectories(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI.<init>(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneSupport.listIndexes(Unknown Source)
    at org.apache.derby.exe.acf81e0010x015fx305axd8b7x000074ebfc881.g0(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
    at org.apache.derby.impl.sql.execute.VTIResultSet.openCore(Unknown Source)
    at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source)
    at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
    at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
    ... 11 more
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.SQLExceptionFactory.getSQLException(Unknown Source)
    at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
    at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(Unknown 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.EmbedStatement.execute(Unknown Source)
    at org.apache.derby.impl.jdbc.EmbedStatement.executeQuery(Unknown Source)
   ....
Caused by: ERROR 38000: The exception 'java.lang.NullPointerException' was thrown while evaluating an expression.
    at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
    at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(Unknown Source)
    ... 18 more
Caused by: java.lang.NullPointerException
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI$1.run(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI.listDirectories(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneListIndexesVTI.<init>(Unknown Source)
    at org.apache.derby.optional.lucene.LuceneSupport.listIndexes(Unknown Source)
    at org.apache.derby.exe.acf81e0010x015fx305axd8b7x000074ebfc881.g0(Unknown Source)
    at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.derby.impl.services.reflect.ReflectMethod.invoke(Unknown Source)
    at org.apache.derby.impl.sql.execute.VTIResultSet.openCore(Unknown Source)
    at org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.open(Unknown Source)
    at org.apache.derby.impl.sql.GenericPreparedStatement.executeStmt(Unknown Source)
    at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
    ... 11 more


3. derby.log

Booting Derby (version The Apache Software Foundation - Apache Derby - 10.11.1.1 - (1616546)) instance a816c00e-015f-3087-b056-000074ebfde8
on database directory jar:(/sample/institution_name_to_type_db.jar)/institution_name_to_type_db in READ ONLY mode with class loader sun.misc.Launcher$AppClassLoader@18b4aac2.
Loaded from file:/export/home/foo/.gradle/caches/modules-2/files-2.1/org.apache.derby/derby/10.11.1.1/df4b50061e8e4c348ce243b921f53ee63ba9bbe1/derby-10.11.1.1.jar.
java.vendor=Oracle Corporation
java.runtime.version=1.8.0_144-b01
user.dir=/export/home/foo/IdeaProjects/bar
os.name=Linux
os.arch=amd64
os.version=4.4.0-93-generic
derby.system.home=null
derby.stream.error.file=/export/home/foo/IdeaProjects/bar/STREAMERROR.LOG
Database Class Loader started - derby.database.classpath=''


Error file is empty. 

Thanks,
Tulay

On Wed, Oct 18, 2017 at 9:46 AM, Tulay Sri <[hidden email]> wrote:
On 10/17/17 5:05 PM, Tulay Sri wrote:
> Hi,
>
> Within a java app I created a read-only database db.jar with 
> lucenesupport and created a lucene index. I am now trying to use it to 
> query within another java code as part of a large ETL job, However, 
> when it comes to using the db to query lucene based tools, I get null 
> pointer exception even to get the list of lucene indexes. If I simply 
> query the base tables or if I unzip this db.jar and run lucene based 
> queries, things are fine. Not sure where to start. Can anyone give me 
> a hand to figure out what I am missing?
>
> Thanks,
> Tulay

Can you post the following:

1) The SQL statement you are issuing which incurs the NPE

2) The full error message which comes back

3) The contents of derby.log or the portion of derby.log which records 
the details of this error

Thanks,

-Rick