5 Replies Latest reply on Oct 14, 2005 6:51 AM by Martin Henderson

    datasources and jboss seam

    Martin Henderson Newbie

      Hi folks,
      I'm a bit of newbie to the jboss world and have been playing with seam.
      I'm having some problems with the datasource aspect of it.

      I've created a turn-around-ds.xml that looks like:

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
       <local-tx-datasource>
       <jndi-name>propertyDatasource</jndi-name>
       <connection-url>jdbc:hsqldb:.</connection-url>
       <driver-class>org.hsqldb.jdbcDriver</driver-class>
       <user-name>sa</user-name>
       <password></password>
       </local-tx-datasource>
      </datasources>
      


      and then referenced this in the hibernate config:
      <!DOCTYPE hibernate-configuration PUBLIC
       "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
       "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
      
      <hibernate-configuration>
       <session-factory name="propertyDatabase">
       <property name="show_sql">true</property>
       <property name="connection.datasource">java:propertyDatasource</property>
       <property name="dialect">org.hibernate.dialect.HSQLDialect</property>
       <property name="hbm2ddl.auto">create-drop</property>
       <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
       <property name="transaction.flush_before_completion">true</property>
       <property name="connection.release_mode">after_statement</property>
       <property name="transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
       <property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
       <mapping class="org.mhenderson.turnaround.domain.Property"/>
       </session-factory>
      </hibernate-configuration>
      


      so.. I dropped the datasource config into the /default/deploy directory and got this:
      09:04:36,176 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=propertyDatasource' to JNDI name 'java:propertyDatasource'
      


      but then on dropping the war file into the /default/deploy directory I got this:
      09:05:44,788 INFO [Configuration] Configuration resource: /hibernate.cfg.xml
      09:05:44,838 INFO [Configuration] Configured SessionFactory: propertyDatabase
      09:05:45,209 INFO [Configuration] processing extends queue
      09:05:45,209 INFO [Configuration] processing collection mappings
      09:05:45,209 INFO [Configuration] processing association property references
      09:05:45,209 INFO [Configuration] processing foreign key constraints
      09:05:45,419 INFO [NamingHelper] JNDI InitialContext properties:{}
      09:05:45,429 ERROR [[/turn-around]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener org.hibernate.HibernateException: Could not find datasource: java:propertyDatasource
       at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:59)
      


      any help would be really appreciated... thanks.

      Marty