sqlite-jdbc: java.lang.UnsatisfiedLinkError: org.sqlite.core.NativeDB._open(Ljava/lang/String;I)V
I am getting this error only in . Sqlite JDBC version 3.8.11.2
Windows Server 2012 R2
javax.persistence.PersistenceException: java.lang.UnsatisfiedLinkError: org.sqlite.core.NativeDB._open(Ljava/lang/String;I)V
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:815)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.getAbstractSession(EntityManagerFactoryDelegate.java:205)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryDelegate.createEntityManagerImpl(EntityManagerFactoryDelegate.java:305)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:337)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:303)
at com.accelerite.radialive.cs.storage.dao.ClusterPropertiesDAO.getPropertyByTypeAndKeyWithSubType(ClusterPropertiesDAO.java:42)
at com.accelerite.radialive.cs.storage.dao.ClusterPropertiesDAO.addClusterProperty(ClusterPropertiesDAO.java:149)
at com.accelerite.radialive.cs.util.Bootstrap.contextInitialized(Bootstrap.java:56)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5003)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5517)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1095)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1930)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.UnsatisfiedLinkError: org.sqlite.core.NativeDB._open(Ljava/lang/String;I)V
at org.sqlite.core.NativeDB._open(Native Method)
at org.sqlite.core.DB.open(DB.java:161)
at org.sqlite.core.CoreConnection.open(CoreConnection.java:220)
at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:76)
at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:24)
at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:23)
at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45)
at org.sqlite.JDBC.createConnection(JDBC.java:114)
at org.sqlite.JDBC.connect(JDBC.java:88)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.eclipse.persistence.sessions.DefaultConnector.connect(DefaultConnector.java:98)
at org.eclipse.persistence.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:162)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.setOrDetectDatasource(DatabaseSessionImpl.java:207)
at org.eclipse.persistence.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:760)
at org.eclipse.persistence.internal.jpa.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:265)
at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:731)
... 20 more
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Reactions: 2
- Comments: 19 (2 by maintainers)
Check that your
/tmpis not mountednoexec. Debian 9, for example, mounts/tmpwithnoexec.If this is the case, there are 2 workarounds:
Solution 1. Edit
/etc/fstaband removenoexecfrom/tmp. Then remount/tmp:Solution 2. Use another
tmplocation.If running
tomcat8on Debian, edit/etc/default/tomcat8and add:I’m getting the same error on ubuntu linux 14.04 running on a pandaboard (armhf architecture):
03/14/2016 14:59:31: Caused by: java.lang.UnsatisfiedLinkError: org.sqlite.core.NativeDB._open(Ljava/lang/String;I)V 03/14/2016 14:59:31: at org.sqlite.core.NativeDB._open(Native Method) 03/14/2016 14:59:31: at org.sqlite.core.DB.open(DB.java:161) 03/14/2016 14:59:31: at org.sqlite.core.CoreConnection.open(CoreConnection.java:220) 03/14/2016 14:59:31: at org.sqlite.core.CoreConnection.<init>(CoreConnection.java:76) 03/14/2016 14:59:31: at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:24) 03/14/2016 14:59:31: at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:23) 03/14/2016 14:59:31: at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:45) 03/14/2016 14:59:31: at org.sqlite.JDBC.createConnection(JDBC.java:114) 03/14/2016 14:59:31: at org.sqlite.JDBC.connect(JDBC.java:88) 03/14/2016 14:59:31: at java.sql.DriverManager.getConnection(DriverManager.java:571) 03/14/2016 14:59:31: at java.sql.DriverManager.getConnection(DriverManager.java:233)
Please check, that the tmpDir is set and you have the permissions. The SQLite DLL gets extracted from the jar to the tmp.
final File tmp = new File(System.getProperty("java.io.tmpdir")); if (!tmp.exists() || !tmp.isDirectory() || !tmp.canRead() || !tmp.canWrite()) { throw new Exception("error with tmpDir"); } SQLiteJDBCLoader.initialize();I have the same problem on Raspbian 2016
how to solve it on mac??? I’m having the same issue with Android and Room.
I only recently downloaded the source code, compiled it and tried to include in into my java application (console based server application with SQLite support planned). The compiled shared object in included in package /org/sqlite/native/Linux/arm and is named libsqlitejdbc.so
Now, according to some posts here, which I found useful, my server application checks “java.io.tmpdir” for correct permissions. Everything seems to be OK.
The error happens to me if my server is being executed on a Raspberry Pi 3 and the following line is executed: connection = DriverManager.getConnection(“jdbc:sqlite:” + dbPath);
dbPath specifies the file path to the database to be opened.
To my temp directory /tmp a file named sqlite-3.7.15-arm-libsqlitejdbc.so is copied.
What can I do about the error?
This is the stacktrace I got
Exception in thread “main” java.lang.UnsatisfiedLinkError: org.sqlite.NativeDB._open(Ljava/lang/String;I)V at org.sqlite.NativeDB._open(Native Method) at org.sqlite.DB.open(DB.java:157) at org.sqlite.Conn.open(Conn.java:169) at org.sqlite.Conn.<init>(Conn.java:87) at org.sqlite.JDBC.createConnection(JDBC.java:113) at org.sqlite.JDBC.connect(JDBC.java:87) at java.sql.DriverManager.getConnection(DriverManager.java:664) at java.sql.DriverManager.getConnection(DriverManager.java:270) at jsqlite.Database.open(Database.java:41) at jsqlite.Server.requestRemoteDatabase(Server.java:172) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at de.root1.simon.ProcessMessageRunnable.processInvoke(ProcessMessageRunnable.java:485) at de.root1.simon.ProcessMessageRunnable.run(ProcessMessageRunnable.java:97) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
EDIT: After updating to sqlite-jdbc-3.15.1.jar the error was gone. seems that 3.7.15 simply was too old.
Same error as above. The root cause of my error is: THERE IS NO TEMP FOLDER IN TOMCAT INSTALL DIR($CATALINA_BASE). So my solution is: cd /usr/share/tomcat8 # this is the install dir of my tomcat8 (cause I install it by apt-get) sudo mkdir temp sudo chmod 777 temp/ Then restart tomcat, the error is gone.