wood burning stoves 2.0*
The moose likes JDBC and the fly likes Trouble with configuring Context DataSource (SQlite) in Tomcat6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Trouble with configuring Context DataSource (SQlite) in Tomcat6" Watch "Trouble with configuring Context DataSource (SQlite) in Tomcat6" New topic
Author

Trouble with configuring Context DataSource (SQlite) in Tomcat6

Rj Kattke
Greenhorn

Joined: Oct 04, 2010
Posts: 12
( I hope I'm in the right forum ) Although I'm on WinXP I'm going to refer to my paths with / -hopefully more universal for configurations.
I'm using: TC6, WinXP, JDK6 --and--
SQlite which is the file-based, RDMS, and the JDBC URL should point to the file.

I was encouraged by setting up a DataSource in a test Project on Tomcat
I created a Context file, named {CATALINA_HOME}/conf/Catalina/localhost/{MyAppContext}.xml

I configured a DataSource in it and proceeded to use JSTL sql tags; everything went well.
I used a fully qualified drive/path, and didn't notice until afterwards, that I had left the slashes like \ Windows, style.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Now that that POC was done, I tried on my real project, and hoping for full portability, decided to use the local
META-INF/Context.xml

I first tried to use a relative path, but no luck.
Then tried fully qualified path (as I had done before with success) and also both style of path slashes.
I'm getting the error below, and I can't seem to shake it.... Is something fundamentally different about using the local Context ?
When using the local Context, do I also have to name it {MyAppContext}.xml

I'll paste in the error (below) but it's strange because it doesn't reflect the path I specified in Context.xml
I specified it like this:
url="jdbc:sqlite:C:\Apache\Tomcat6\webapps\{MyAppContext}\WEB-INF\my_data.sqlite"

Your thoughts, answers and solutions, greatly appreciated.


INFO: Server startup in 2247 ms
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnection
Factory (path to '/WEB-INF/my_data.sqlite': 'C:\WEB-INF' does not exist)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDat
aSource.java:1225)

 
Consider Paul's rocket mass heater.
 
subject: Trouble with configuring Context DataSource (SQlite) in Tomcat6