Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Trouble with configuring Context DataSource (SQlite) in Tomcat6

 
Rj Kattke
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
( 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)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic