• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Exception: Could not find datasource

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to put together a "simple" webapp with Tomcat, Hibernate, and the HyperSonic database but seem to be stymied by this exception.

net.sf.hibernate.HibernateException: Could not find datasource at

That's it! No path or directory is given before the rest of the stack trace. I'm guessing maybe a JDBC config problem but don't know enough to make any progress.

My webapp context from server.xml is:

<Context path="" docBase="swiss" debug="4">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="swiss-" suffix=".txt"
timestamp="true"/>

<Resource name="jdbc/AppDS" auth="Container"
type="javax.sql.DataSource"/>

<ResourceParams name="jdbc/AppDS">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<value>org.hsqldb.jdbcDriver</value>
</parameter>
<parameter>
<name>url</name>
<value>jdbc:hsqldb:webapps/swiss/db/music</value>
</parameter>
<parameter>
<name>username</name>
<value>sa</value>
</parameter>
<parameter>
<name>password</name>
<value></value>
</parameter>
<parameter>
<name>maxActive</name>
<value>40</value>
</parameter>
<parameter>
<name>maxIdle</name>
<value>10</value>
</parameter>
<parameter>
<name>maxWait</name>
<value>-1</value>
</parameter>
</ResourceParams>

</Context>


and WEB-INF/classes/hibernate.cfg.xml has

<hibernate-configuration>

<session-factory>

<property name="connection.datasource">java:comp/env/jdbc/AppDS</property>
<property name="show_sql">false</property>
<property name="dialect">net.sf.hibernate.dialect.HSQLDialect</property>

<!-- Mapping files -->
<mapping resource="com/oreilly/hh/Track.hbm.xml"/>

</session-factory>

</hibernate-configuration>


My databse lives in a db directory at the same level as WEB-INF. Any suggestions?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!