ring-sample icon indicating copy to clipboard operation
ring-sample copied to clipboard

`ring-sample.sqlite/init-db!` only works if I `mkdir data` first?

Open DavidMihola opened this issue 8 years ago • 0 comments

I just played around with the ring-sample and everything worked fine until I clicked on "Records in the SQLite database" on the main page. This led to the following stack trace in the shell:

["select * from characters order by name"]
Initializing SQLite database
#<SQLException java.sql.SQLException: path to 'data/characters.db': '/home/dmta/clojure/ring-sample/data' does not exist>
Exception: java.sql.SQLException: path to 'data/characters.db': '/home/dmta/clojure/ring-sample/data' does not exist
                           Conn.java:103 org.sqlite.Conn.open
                            Conn.java:57 org.sqlite.Conn.<init>
                            JDBC.java:77 org.sqlite.JDBC.createConnection
                            JDBC.java:64 org.sqlite.JDBC.connect
                  DriverManager.java:664 java.sql.DriverManager.getConnection
                  DriverManager.java:208 java.sql.DriverManager.getConnection
                            jdbc.clj:176 clojure.java.jdbc/get-connection
                            jdbc.clj:299 clojure.java.jdbc/with-connection*
                           sqlite.clj:86 ring-sample.sqlite/init-db!
...

Everything worked fine when I did mkdir data in the ring-sample root directory. I don't know if there's something wrong with my setup (missing write access or something) so that the DB driver is unable to create the directory itself but at least this report may be of help to others experiencing the same problem.

DavidMihola avatar Sep 16 '17 15:09 DavidMihola