offheap throwing SQLite exception!

103 views
Skip to first unread message

PSI A

unread,
Jul 30, 2015, 1:03:23 PM7/30/15
to cqengine-discuss
Hi Niall,


I started getting following errors now when i switched to use offheap.


Caused by: java.lang.IllegalStateException: Failed to open SQLite connection for memory instance: cqengine_1

      at com.googlecode.cqengine.persistence.offheap.OffHeapPersistence.getConnection(OffHeapPersistence.java:104)

      at com.googlecode.cqengine.persistence.offheap.OffHeapPersistence.<init>(OffHeapPersistence.java:83)

      at com.googlecode.cqengine.persistence.offheap.OffHeapPersistence.onPrimaryKey(OffHeapPersistence.java:202)

      at gp.cq.cache.manager.impl.UserCQEQueryCacheManager.<init>(UserCQEQueryCacheManager.java:85)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

      at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)

      ... 15 more

Caused by: java.sql.SQLException: Error opening connection

      at com.googlecode.cqengine.lib.org.sqlite.core.CoreConnection.open(CoreConnection.java:213)

      at com.googlecode.cqengine.lib.org.sqlite.core.CoreConnection.<init>(CoreConnection.java:74)

      at com.googlecode.cqengine.lib.org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:24)

      at com.googlecode.cqengine.lib.org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:23)

      at com.googlecode.cqengine.lib.org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45)

      at com.googlecode.cqengine.lib.org.sqlite.JDBC.createConnection(JDBC.java:114)

      at com.googlecode.cqengine.lib.org.sqlite.SQLiteDataSource.getConnection(SQLiteDataSource.java:410)

      at com.googlecode.cqengine.lib.org.sqlite.SQLiteDataSource.getConnection(SQLiteDataSource.java:398)

      at com.googlecode.cqengine.persistence.offheap.OffHeapPersistence.getConnection(OffHeapPersistence.java:101)

      ... 23 more

Caused by: java.lang.Exception: No native library is found for os.name=Windows and os.arch=x86_64

      at com.googlecode.cqengine.lib.org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:284)

      at com.googlecode.cqengine.lib.org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:65)

      at com.googlecode.cqengine.lib.org.sqlite.core.NativeDB.load(NativeDB.java:53)

      at com.googlecode.cqengine.lib.org.sqlite.core.CoreConnection.open(CoreConnection.java:209)

      ... 31 more


Niall Gallagher

unread,
Jul 30, 2015, 2:12:56 PM7/30/15
to cqengine...@googlegroups.com
Do you declare your dependency on CQEngine as follows?
<dependency>
    <groupId>com.googlecode.cqengine</groupId>
    <artifactId>cqengine</artifactId>
    <version>x.x.x</version>
    <classifier>all</classifier>
</dependency>

If so, could you remove "all" and declare cqengine as a normal dependency instead? You will then need to allow maven to pull in transitive dependencies.

Basically I see you are using the "shaded" build of CQEngine. Let me know if the regular version is fine. If so then I can take a look at rebuilding the shaded version. Thanks!



--
-- You received this message because you are subscribed to the "cqengine-discuss" group.
http://groups.google.com/group/cqengine-discuss
---
You received this message because you are subscribed to the Google Groups "cqengine-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cqengine-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PSI A

unread,
Aug 6, 2015, 6:47:38 PM8/6/15
to cqengine-discuss
I am using, since i need string based cq queries.


        <dependency>
            <groupId>com.googlecode.cqengine</groupId>
            <artifactId>cqengine</artifactId>
            <version>2.1.0-SNAPSHOT</version>
        </dependency>

Niall Gallagher

unread,
Aug 6, 2015, 7:35:58 PM8/6/15
to cqengine...@googlegroups.com
Okay. I don’t understand what’s going on there then, because the code throwing the exception is in package com.googlecode.cqengine.lib which is only in the shaded build of CQEngine (the jar ending with “-all.jar”:  “cqengine-2.1.0-SNAPSHOT-all.jar”).

But regardless, good news- I was able to reproduce that problem with the shaded jar, and it’s fixed in trunk. It required a config change in pom.xml. So if you rebuild the jar it should work now, hopefully!
Reply all
Reply to author
Forward
0 new messages