Win a copy of Rust Web Development this week in the Other Languages forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

sqlite java.lang. UnsatisfiedLinkError

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Please have a glance of youur session management...
Thanks,
Jaffer
 
Rancher
Posts: 43027
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it's extremely unlikely that sessions have anything to do with an issue about library loading.
 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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).
 
tarun modi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic