SQLiteException: [14] unable to open database file
I'm running a java web app on Ubuntu 16.04 using Tomcat 8.5.29 and trying to connect to a sqlite file named "settings.sqlite".
I get the error below. I'm not sure what is causing it. I've set the permissions to 777 for the entire tomcat folder and the file, but still I can't access it.
What else should I check?
Thanks.
06-Apr-2018 17:32:50.804 INFO [http-nio-8080-exec-1] com.almworks.sqlite4java.Internal.log [sqlite] DB[3]: instantiated [/settings.sqlite] 06-Apr-2018 17:32:50.804 SEVERE [http-nio-8080-exec-1] za.co.accsys.web.helperclasses.ServerPrefs.loadServerSettingsFromDB null com.almworks.sqlite4java.SQLiteException: [14] unable to open database file at com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1480) at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:282) at za.co.accsys.web.helperclasses.ServerPrefs.loadServerSettingsFromDB(ServerPrefs.java:560) at za.co.accsys.web.helperclasses.ServerPrefs.reloadAccountPreferences(ServerPrefs.java:46) at za.co.accsys.web.helperclasses.ServerPrefs.<init>(ServerPrefs.java:35) at za.co.accsys.web.helperclasses.ServerPrefs.getInstance(ServerPrefs.java:605) at za.co.accsys.web.beans.PageManager.isDatabasesRunning(PageManager.java:903) 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:498) at javax.el.BeanELResolver.getValue(BeanELResolver.java:94) at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) at org.apache.el.parser.AstValue.getValue(AstValue.java:169) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:184) at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) at javax.faces.component.UIComponentBase.isRendered(UIComponentBase.java:457) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1850) at javax.faces.render.Renderer.encodeChildren(Renderer.java:176) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:79) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312) at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:309) at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:115) at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:889) at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:79) at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:66) at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:49) at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:919) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1863) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1859) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:456) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:133) at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:120) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)
Comments (4)
-
-
Oh, and based on the first line, it tries to open /settings.sqlite -- are you sure you've got the database in the root folder?
-
- changed status to invalid
(not a bug)
-
reporter To Igor
Thanks for the suggestions. The previous developer set it to the tomcat/bin folder on an old sever. After migrating it from that server, I assumed the setting would be the same, but turns out you were right, it was supposed to be in the root folder.
Ipeleng
- Log in to comment
Hi,
This error is reported by SQLite - error 14, SQLITE_CANTOPEN - see http://www.sqlite.org/c3ref/c_abort.html
It means, literally, that it cannot open the file. Maybe there is a problem with the file name or file system.
To debug, I'd suggest using a utility like strace to trace system call and see which file exactly does it try to open.
Hope this helps! Igor