1 Reply Latest reply on Aug 19, 2004 2:53 AM by Stjepan Brbot

    jboss ignores datasource directive in jbosscmp-jdbc.xml

    Ian Cottingham Newbie


      I am having a problem getting JBOSS to create entity tables (using CMP) in a datasource other than my default datasource. I have defined the following in mysql-ds.xml

      MySqlDS
      nadssDS

      I JBOSS_HOME/server/default/conf/standardjbosscmp-jdbc.xml I specify the datasource as MySqlDS

      In the actual jbosscmp-jdbc.xml file I specify (for each entity) nadssDS as the data source to use. However, when I deploy the application all of the CMP for those entities tables are created in MySqlDS. Is there any bug that is preventing the override of the specified default behavior? Or am I just flat out missing something?

        • 1. Re: jboss ignores datasource directive in jbosscmp-jdbc.xml
          Stjepan Brbot Newbie

          Post what is your datasource configuration (deployment) file of datasource (*-ds.xml). It has to contain definition for two databases or you must have separate datasource configuration file for each database. Then in your JBoss deployment descriptor file you're able to define for each EJB which datasource should be used for that particular EJB or you can define general datasource for all EJBs. (Of course you can define one global datasource for all of your EJBs in application but override datasource pointer just for some of EJB's).
          I wouldn't touch standardjbosscmp-jdbc.xml because it is application server's configuration file and not your application configuration file. Changing server configuration file actually means that your loose your portability in some way. Deployment of your application on another JBoss server expects the change of its configuration file too.