Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

No Native Library when Running using CLI #344

Open
duhai-alshukaili opened this issue Jan 3, 2024 · 5 comments
Open

No Native Library when Running using CLI #344

duhai-alshukaili opened this issue Jan 3, 2024 · 5 comments

Comments

@duhai-alshukaili
Copy link

When I try to run the shell script I get the following error:

Running PSL Inference.
790 [main] INFO org.linqs.psl.runtime.Runtime - PSL Runtime Version 3.0.1-SNAPSHOT-b33adfd
1992 [main] ERROR com.zaxxer.hikari.pool.HikariPool - HikariPool-1 - Exception during pool initializat
ion.
java.sql.SQLException: Error opening connection
at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:258) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
at org.sqlite.SQLiteConnection.(SQLiteConnection.java:61) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
at org.sqlite.jdbc3.JDBC3Connection.(JDBC3Connection.java:23) ~[psl-cli-3.0.1-SNAPSHOT.ja
r:?]
at org.sqlite.jdbc4.JDBC4Connection.(JDBC4Connection.java:19) ~[psl-cli-3.0.1-SNAPSHOT.ja
r:?]
at org.sqlite.JDBC.createConnection(JDBC.java:104) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
at org.sqlite.JDBC.connect(JDBC.java:77) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121) ~[psl-cli-3
.0.1-SNAPSHOT.jar:?]
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[psl-cli-3.0.1-SNAPSHOT.ja
r:?]
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[psl-cli-3.0.1-SNAPSHOT.jar
:?]
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[psl-cli-3.0.1-SNAPS
HOT.jar:?]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[psl-cli-3.0.1-SNAPSHO
T.jar:?]
at com.zaxxer.hikari.pool.HikariPool.(HikariPool.java:115) ~[psl-cli-3.0.1-SNAPSHOT.jar:?
]
at com.zaxxer.hikari.HikariDataSource.(HikariDataSource.java:81) ~[psl-cli-3.0.1-SNAPSHOT
.jar:?]
at org.linqs.psl.database.rdbms.driver.DatabaseDriver.(DatabaseDriver.java:59) ~[psl-cli-
3.0.1-SNAPSHOT.jar:?]
at org.linqs.psl.database.rdbms.driver.SQLiteDriver.(SQLiteDriver.java:53) ~[psl-cli-3.0.
1-SNAPSHOT.jar:?]
at org.linqs.psl.database.rdbms.driver.SQLiteDriver.(SQLiteDriver.java:43) ~[psl-cli-3.0.
1-SNAPSHOT.jar:?]
at org.linqs.psl.runtime.Runtime.initDataStore(Runtime.java:246) ~[psl-cli-3.0.1-SNAPSHOT.jar:?
]
at org.linqs.psl.runtime.Runtime.runInferenceInternal(Runtime.java:403) ~[psl-cli-3.0.1-SNAPSHO
T.jar:?]
at org.linqs.psl.runtime.Runtime.runInference(Runtime.java:364) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
at org.linqs.psl.runtime.Runtime.runInternal(Runtime.java:172) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
at org.linqs.psl.runtime.Runtime.run(Runtime.java:122) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
at org.linqs.psl.runtime.Runtime.run(Runtime.java:99) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
at org.linqs.psl.cli.Launcher.run(Launcher.java:126) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
at org.linqs.psl.cli.Launcher.main(Launcher.java:142) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
at org.linqs.psl.cli.Launcher.main(Launcher.java:130) ~[psl-cli-3.0.1-SNAPSHOT.jar:?]
Caused by: java.lang.Exception: No native library found for os.name=Windows .....

I am using Windows with JDK 1.8.0 (Amazon Corrto) and Maven 3.9.6.

@eriq-augustine
Copy link
Member

eriq-augustine commented Jan 3, 2024

Hello.

What are you trying to run exactly, a PSL example?
If so, which one?

Are you building your own version (I see you are using a development version)?

What happens when you use a release version (2.4.0)?
(If using PSL examples, you can git checkout 2.4.0.)

@duhai-alshukaili
Copy link
Author

duhai-alshukaili commented Jan 4, 2024

Hello Eriq,

I am trying to run the PSL examples. I tried three with the same results: simple-acquaintances, smokers, and friendship.

I am not building my version. I just followed the steps in the Getting Started with PSL:

git clone https://github.com/linqs/psl-examples.git
cd psl-examples/simple-acquaintances/cli

./run.sh

I tried with version 2.4.0. Still the same error.

Running PSL Inference.
825  [main] INFO  org.linqs.psl.runtime.Runtime  - PSL Runtime Version 2.4.0-aad67da
2032 [main] ERROR com.zaxxer.hikari.pool.HikariPool  - HikariPool-1 - Exception during pool initialization.
java.sql.SQLException: Error opening connection
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:258) ~[psl-cli-2.4.0.jar:?]
        at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:61) ~[psl-cli-2.4.0.jar:?]
        at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:23) ~[psl-cli-2.4.0.jar:?]
        at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:19) ~[psl-cli-2.4.0.jar:?]
        at org.sqlite.JDBC.createConnection(JDBC.java:104) ~[psl-cli-2.4.0.jar:?]
        at org.sqlite.JDBC.connect(JDBC.java:77) ~[psl-cli-2.4.0.jar:?]
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121) ~[psl-cli-2.4.0.jar:?]
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[psl-cli-2.4.0.jar:?]
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[psl-cli-2.4.0.jar:?]
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[psl-cli-2.4.0.jar:?]
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[psl-cli-2.4.0.jar:?]
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[psl-cli-2.4.0.jar:?]
        at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.database.rdbms.driver.DatabaseDriver.<init>(DatabaseDriver.java:59) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.database.rdbms.driver.SQLiteDriver.<init>(SQLiteDriver.java:53) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.database.rdbms.driver.SQLiteDriver.<init>(SQLiteDriver.java:43) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.runtime.Runtime.initDataStore(Runtime.java:247) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.runtime.Runtime.runInferenceInternal(Runtime.java:404) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.runtime.Runtime.runInference(Runtime.java:365) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.runtime.Runtime.runInternal(Runtime.java:172) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.runtime.Runtime.run(Runtime.java:122) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.runtime.Runtime.run(Runtime.java:99) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.cli.Launcher.run(Launcher.java:126) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.cli.Launcher.main(Launcher.java:142) ~[psl-cli-2.4.0.jar:?]
        at org.linqs.psl.cli.Launcher.main(Launcher.java:130) ~[psl-cli-2.4.0.jar:?]
Caused by: java.lang.Exception: No native library found for os.name=Windows, os.arch=x86_64, paths=[C:\Program Files\Java\jdk1.8.0_202\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Users\t104\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\t104\bin;C:\Program Files\Java\jdk1.8.0_202\bin;C:\Program Files\Python\Python311\Scripts;C:\Program Files\Python\Python311;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Git\cmd;C:\Program Files\sqlite-win-x64-3440200;C:\Program Files\apache-maven-3.9.6\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Users\t104\AppData\Local\Microsoft\WindowsApps;C:\Users\t104\AppData\Local\Programs\Microsoft VS Code\bin;C:\texlive\2017\bin\win32;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl;.]
        at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:375) ~[psl-cli-2.4.0.jar:?]
        at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:68) ~[psl-cli-2.4.0.jar:?]
        at org.sqlite.core.NativeDB.load(NativeDB.java:62) ~[psl-cli-2.4.0.jar:?]
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:255) ~[psl-cli-2.4.0.jar:?]
        ... 24 more
Unexpected exception!
com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: Error opening connection
        at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:596)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:582)
        at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
        at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
        at org.linqs.psl.database.rdbms.driver.DatabaseDriver.<init>(DatabaseDriver.java:59)
        at org.linqs.psl.database.rdbms.driver.SQLiteDriver.<init>(SQLiteDriver.java:53)
        at org.linqs.psl.database.rdbms.driver.SQLiteDriver.<init>(SQLiteDriver.java:43)
        at org.linqs.psl.runtime.Runtime.initDataStore(Runtime.java:247)
        at org.linqs.psl.runtime.Runtime.runInferenceInternal(Runtime.java:404)
        at org.linqs.psl.runtime.Runtime.runInference(Runtime.java:365)
        at org.linqs.psl.runtime.Runtime.runInternal(Runtime.java:172)
        at org.linqs.psl.runtime.Runtime.run(Runtime.java:122)
        at org.linqs.psl.runtime.Runtime.run(Runtime.java:99)
        at org.linqs.psl.cli.Launcher.run(Launcher.java:126)
        at org.linqs.psl.cli.Launcher.main(Launcher.java:142)
        at org.linqs.psl.cli.Launcher.main(Launcher.java:130)
Caused by: java.sql.SQLException: Error opening connection
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:258)
        at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:61)
        at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:23)
        at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:19)
        at org.sqlite.JDBC.createConnection(JDBC.java:104)
        at org.sqlite.JDBC.connect(JDBC.java:77)
        at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:121)
        at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
        at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
        at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)
        at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
        ... 14 more
Caused by: java.lang.Exception: No native library found for os.name=Windows, os.arch=x86_64, paths=[C:\Program Files\Java\jdk1.8.0_202\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Users\t104\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\t104\bin;C:\Program Files\Java\jdk1.8.0_202\bin;C:\Program Files\Python\Python311\Scripts;C:\Program Files\Python\Python311;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\Git\cmd;C:\Program Files\sqlite-win-x64-3440200;C:\Program Files\apache-maven-3.9.6\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Users\t104\AppData\Local\Microsoft\WindowsApps;C:\Users\t104\AppData\Local\Programs\Microsoft VS Code\bin;C:\texlive\2017\bin\win32;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl;.]
        at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:375)
        at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:68)
        at org.sqlite.core.NativeDB.load(NativeDB.java:62)
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:255)
        ... 24 more
ERROR: Failed to run infernce.

I am suspecting that there might be an issue with SQLite driver. However, I could not pin point what exactly it is.

@eriq-augustine
Copy link
Member

Humm....

It does look like some issue between Windows and SQLite.
I don't have a Windows machine, so can't say anything for sure, but here are my thoughts in the order I think you should try things.

Are you using WSL?

I could not find anything that looked exactly like your issue in the driver's bug tracker, but this issue (xerial/sqlite-jdbc#791 ) indicates that it may be a configuration issue with the machine.
Is SQLite3 installed on your machine (I thought it was pretty standard for most Windows machines).

After that, you can try downloading a new version of the driver and putting that in your classpath so it loads before the other driver bundled with the PSL jar:
https://github.com/xerial/sqlite-jdbc

If those don't work and you are not using WSL, then we could try it in WSL.

@duhai-alshukaili
Copy link
Author

It seems like it is a Windows "thing". I just ran it in a Debian Linux. Both 3.0.1-SNAPSHOT and 2.4.0 work. I noticed, though, that I am getting a warning about the LAPACK library.

@eriq-augustine
Copy link
Member

Interesting, thanks for checking.

The LAPACK warning (if it is the one I think it is) is just saying that no native LAPACK implementation is installed on the machine, so it will fall back to a native Java implementation.
You can generally ignore this unless you need high performance, then you can just install it through the normal means on your system (on Debian, probably apt install liblapack3).

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants