aspose file tools*
The moose likes Other Java Products and Servers and the fly likes sqlite  java.lang. UnsatisfiedLinkError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "sqlite  java.lang. UnsatisfiedLinkError" Watch "sqlite  java.lang. UnsatisfiedLinkError" New topic
Author

sqlite java.lang. UnsatisfiedLinkError

tarun modi
Greenhorn

Joined: Sep 05, 2007
Posts: 7
Hi,
I am using sqlite database for my small web aplication.
my application works fine, but after a small interval i got the following error as below:
Please help me regarding this.. Thanks.

May 15, 2008 6:38:40 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
java.lang.UnsatisfiedLinkError: Native Library C:\jakarta-tomcat-5.5.9-preconfigured\jakarta-tomcat-5.5.9\temp\sqlitejdbc.dll already loaded in another classloader
java.sql.SQLException: no SQLite library found
at org.sqlite.Conn.<init>(Conn.java:74)
at org.sqlite.JDBC.connect(JDBC.java:53)
at java.sql.DriverManager.getConnection(DriverManager.java:525)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at com.aumni.common.Connect.getConnection(Connect.java:18)
at com.aumni.models.KeywordModel.getKeywords(KeywordModel.java:27)
at com.aumni.servlets.Keywords.doGet(Keywords.java:30)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
May 15, 2008 6:39:38 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet keywords threw exception
java.lang.NullPointerException
at com.aumni.models.KeywordModel.getKeywords(KeywordModel.java:28)
at com.aumni.servlets.Keywords.doGet(Keywords.java:30)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
May 15, 2008 6:44:52 PM org.apache.catalina.core.StandardContext reload
INFO: Reloading this Context has started
Jaffer Sadiq
Greenhorn

Joined: May 19, 2008
Posts: 24
Hi,
Please have a glance of youur session management...
Thanks,
Jaffer
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39578
    
  27
I think it's extremely unlikely that sessions have anything to do with an issue about library loading.


Ping & DNS - updated with new look and Ping home screen widget
K Aditi
Ranch Hand

Joined: Mar 17, 2008
Posts: 89
java.lang.UnsatisfiedLinkError: Native Library C:\jakarta-tomcat-5.5.9-preconfigured\jakarta-tomcat-5.5.9\temp\sqlitejdbc.dll already loaded in another classloader

Though I am not aware of sqlite but looks like it uses JNI.
This exception happens because Tomcat uses separate classloaders for each web application. So when you have multiple instances of your webb-app getting loaded you will encounter this problem.I am sure this problem goes away when you restart Tomcat and run your web-app for the first time.
I think if you somehow manage to load the native code only once through Tomcat's ClassLoader instead of your web-app's ClassLoader it might solve your problem. You can give the following method a try,
Place all the jars required for sqlite in tomcat\common\lib and/or place the code where you use the native APIs in tomcat\common\lib folder if it's a jar or tomcat\common\classes if it's in .class format (i.e. unpacked).


Aditi
tarun modi
Greenhorn

Joined: Sep 05, 2007
Posts: 7
I have sorted my problem by using different jar for sqlite driver. Previously i was using sqlite driver that uses JNI, but now i found another driver using 100% java, which is based on nestedVM and that solves my problem.
Thanks K Aditi, as i haven't tried your method but i am founding useful for what you have said. I try that way too...
Thanks buddy for all your replies
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sqlite java.lang. UnsatisfiedLinkError
 
Similar Threads
Can't Connect to Mysql with JBuilder...
How to dynamically call a class
my first jsf app is giving error, can someone please help me!
Database
Cannot create JDBC driver of class SQLServerDriver