3 Replies Latest reply on Jul 2, 2003 1:51 AM by Pranav Kapil

    desesperatly trying to define a datasource...

    ansarim Newbie

      hi all,
      i'm working with eclipse 2.1 with Lomboz plugin and JBoss 3.2.1
      I try to make a simple Entity bean but i have a problem with configuring its datasource...
      This is my hsqldb-ds.xml (so i'm using Hypersonic database within JBoss)

      <?xml version="1.0" encoding="UTF-8"?>

      <!-- ===================================================================== -->
      <!-- -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- ===================================================================== -->

      <!-- $Id: hsqldb-ds.xml,v 1.1.2.4 2003/04/22 20:34:33 d_jencks Exp $ -->



      <local-tx-datasource>
      <!-- remove this depends tag if you are not using the tcp connection url -->
      jboss:service=Hypersonic
      <jndi-name>DefaultDS</jndi-name>
      <!-- for tcp connection, allowing other processes to use the hsqldb database -->
      <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
      <!-- for totally in-memory db, not saved when jboss stops. hsql mbean is unnecessary-->
      <!--connection-url>jdbc:hsqldb:.</connection-url-->
      <!-- for in-process db, saved when jboss stops. hsql mbean is unnecessary-->
      <!--connection-url>jdbc:hsqldb:default-db-name</connection-url-->
      <driver-class>org.hsqldb.jdbcDriver</driver-class>
      <user-name>sa</user-name>

      <!--example of how to specify class that determines if exception means connection should be destroyed-->
      <!--exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.DummyExceptionSorter</exception-sorter-class-name-->
      <min-pool-size>5</min-pool-size>
      <security-domain>HsqlDbRealm</security-domain>
      </local-tx-datasource>

      <!-- this mbean should be used only when using tcp connections -->

      1701
      true
      default
      false
      true




      this is my jbosscmp-jdbc.xml :

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">

      <jbosscmp-jdbc>

      DefaultDS
      <datasource-mapping>java:DefaultDS</datasource-mapping>
      <preferred-relation-mapping>PLEASE_MODIFY_THIS</preferred-relation-mapping>



      <enterprise-beans>

      <!--
      To add beans that you have deployment descriptor info for, add
      a file to your XDoclet merge directory called jbosscmp-jdbc-beans.xml
      that contains the markup for those beans.
      -->


      <ejb-name>Address</ejb-name>
      <table-name>address</table-name>

      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>phone</field-name>
      <column-name>phone</column-name>

      </cmp-field>

      <!-- merge point: jbosscmp-jdbc-load-{0}.xml -->



      </enterprise-beans>

      </jbosscmp-jdbc>

      when i lauch JBoss, i have an error lije this :

      org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : datasource-mapping java:DefaultDS not found
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCEntityMetaData.(JDBCEntityMetaData.java:399)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCApplicationMetaData.(JDBCApplicationMetaData.java:258)
      at org.jboss.ejb.plugins.cmp.jdbc.metadata.JDBCXmlFileLoader.load(JDBCXmlFileLoader.java:75)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadJDBCEntityMetaData(JDBCStoreManager.java:737)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:430)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:372)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:170)
      at org.jboss.ejb.EntityContainer.startService(EntityContainer.java:339)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192)
      at sun.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)

      (...)

      Thanks for your help !