• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Datasource tomcat 5.5

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I'm currently creating a new forum site with JDK 5.0, Tomcat 5.5, and hsqldb. One of my requirements is to use a datasource. I have created a datasource in Tomcat and tested it with a jsp I put in my jfourm application. The jsp works fine, but when I try to use the same datasource with the jforum application I get the error below. I have included the database lines from my systemGlobals.properties and the datasource setting from my tomcat config. For the database.datasource.name I have tried everything java:jdbc/TestDB, java:/jdbc/TestDB, /jdbc/TestDB, jdbc/TestDB, java:/TestDB, java:TestDB, /TestDB, and TestDB, none of them seem to work. If any one has experience with this set up or just JDK 5.0, tomcat 5.5 and using a datasource can you please help.

Thanks
Ben


Error Message


systemGlobals.properties



Tomcat resource config

[originally posted on jforum.net by bmcguire]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have seen this happen in some situations. When I can't put it to work, I do two tests: a raw jsp file (like you did) and the same code in a Java file, usually a servlet. Then a compare the code that works with the code in JForum, and (maybe) change the differences.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I worked on this a little more and was able to come up with the solution. Retrieving datasources is different for each server. When using tomcat the property database.datasource.name needed to be prepended with java:comp/env/ not just java: . So when using a datasource named jdbc/TestDB the property looks like this


[originally posted on jforum.net by bmcguire]
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic