5 Replies Latest reply on May 25, 2006 11:29 AM by Ovidiu Feodorov

    Messaging Tests: How to deploy your own DS?

    mskonda Apprentice

      I have a situation where I have to use Sybase as my persistence in place of HSQL. I modified the configutations accordingly in container.xml to reflect the sybase database configuration

      <database-configuration name="sybase">
       <url>jdbc:sybase:Tds:<servername>:4100/<database_name></url>
       <driver>com.sybase.jdbc3.jdbc.SybXADataSource</driver>
       <username><username></username>
       <password>*****</password>
      </database-configuration>
      

      I created sybase-ds.xml file in jms/src/etc/server/default/deploy (I expected this file to be deployed and create a DS with SybaseDS as the jndi-name)

      Changed the value of functional.tests.database in build.xml to sybase (see the name attribute of the database-configuration above) and added
      <!-- Sybase JDBC driver -->
      <path location="../src/resources/jconn3.jar"/>
      

      to the library.classpath id.

      When I run the tests, it complains it couldn't find SybaseDS jndi name.

      Any ideas/pointers?

      Thanks
      Madhu






        • 1. Re: Messaging Tests: How to deploy your own DS?
          Tim Fox Master

          I am unsure what you are trying to do.

          Are you trying to run the test suite against a sybase database, or use a sybase datasource in a deployed jboss messaging installation?

          • 2. Re: Messaging Tests: How to deploy your own DS?
            mskonda Apprentice

            trying to run testsuite against sybase database

            • 4. Re: Messaging Tests: How to deploy your own DS?
              mskonda Apprentice

              Tim, there is one thing that's not clear to me -

              in *-persistence-service.xml file, there's a reference to Datasource attribute as shown below(example from sybase-persistence):

              <server>
              <mbean code="org.jboss.messaging.core.plugin.JDBCPersistenceManager"
               name="jboss.messaging:service=PersistenceManager"
               xmbean-dd="xmdesc/JDBCPersistenceManager-xmbean.xml">
               <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
               <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
               <depends optional-attribute-name="ChannelMapper">jboss.messaging:service=ChannelMapper</depends>
               <attribute name="DataSource">java:/DefaultDS</attribute>
              

              and
              <mbean code="org.jboss.jms.server.plugin.JDBCChannelMapper"
               name="jboss.messaging:service=ChannelMapper"
               xmbean-dd="xmdesc/JDBCChannelMapper-xmbean.xml">
               <depends>jboss.jca:service=DataSourceBinding,name=DefaultDS</depends>
               <depends optional-attribute-name="TransactionManager">jboss:service=TransactionManager</depends>
               <attribute name="DataSource">java:/DefaultDS</attribute>
              


              First thing, there's no (or I couldn't find) *ds.xml that deploys DefaultDS so not sure where is it picking it from

              In my case, I have deployed a sybase-ds.xml which deploys a DS with SybaseDS jndi name. Hence I changed the above datasource names to SybaseDS instead of DefaultDS to reflect the change.

              However, when I run the tests, it complains the NameNotFoundException (for SybaseDS).

              • 5. Re: Messaging Tests: How to deploy your own DS?
                Ovidiu Feodorov Master

                The minimalistic ServiceContainer we use for testing deploys only one data source under java:/DefaultDS, and that datasource corresponds to the database configuration you specify in tests/etc/container.xml. So, if you add your sybase configuration in tests/etc/container.xml and configure the database to use as follows

                <database>sybase</database>
                

                in the same container.xml, you should be fine.

                By the way, if you think that http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossMessagingUnitTests needs to be improved in this respect, please feel free to do so.