1 Reply Latest reply on Jun 25, 2003 8:21 AM by Jon Barnett

    [JBOSS newbie] setting up a Connection pool and a DataSource

    Dominique Jean-Prost Newbie

      Hello,

      I'm currently evaluating JBoss 3.2.1. I know quite well Weblogic 6.1 as my company uses it in our production environment. But for the moment, I find it very hard to get into Jboss.
      I'm trying to setup a jdbc connection pool and a datasource to access it.
      I took the docs\examples\jca\generic-ds.xml as an example, and I modified it so that it's ok for my jdbc driver.
      here is the file I have:
      <?xml version="1.0" encoding="UTF-8"?>

      <local-tx-datasource>
      <jndi-name>DexiaSofaxis</jndi-name>
      <connection-url>jdbc:inetdae7</connection-url>
      <driver-class>com.inet.tds.TdsDriver</driver-class>
      <user-name>sa</user-name>

      <connection-property name="prepare">false</connection-property>
      <connection-property name="database">dexiasofaxis</connection-property>
      <connection-property name="host">orlwendolene</connection-property>
      <connection-property name="appname">djp_jboss_dexiasofaxis</connection-property>
      <min-pool-size>5</min-pool-size>
      <max-pool-size>10</max-pool-size>
      <blocking-timeout-millis>5000</blocking-timeout-millis>
      <idle-timeout-minutes>15</idle-timeout-minutes>
      </local-tx-datasource>

      <xa-tx-datasource>
      <jndi-name>TXDexiaSofaxis</jndi-name>
      <xa-datasource-class>com.inet.tds.DTCDataSource</xa-datasource-class>
      <connection-url>jdbc:inetdae7</connection-url>
      <user-name>sa</user-name>

      <connection-property name="prepare">false</connection-property>
      <connection-property name="database">dexiasofaxis</connection-property>
      <connection-property name="host">orlwendolene</connection-property>
      <connection-property name="appname">djp_jboss_txdexiasofaxis</connection-property>
      <min-pool-size>5</min-pool-size>
      <max-pool-size>10</max-pool-size>
      <blocking-timeout-millis>5000</blocking-timeout-millis>
      <idle-timeout-minutes>15</idle-timeout-minutes>
      </xa-tx-datasource>


      In this file I try to setup two datasources that use jdbc connection pool. One is XA-compatible and the other not.
      When I set this file (datasource.xml) in the deploy dir of my server, I get the following error :

      13:43:37,979 INFO [MainDeployer] Deployment of package: file:/C:/Bin/jboss-3.2.1/server/test/deploy/datasource.xml is waiting for an appropriate deployer.
      13:43:38,019 ERROR [URLDeploymentScanner] MBeanException: Exception in MBean operation 'checkIncompleteDeployments()'
      Cause: Incomplete Deployment listing:
      Packages waiting for a deployer:
      [org.jboss.deployment.DeploymentInfo@bd93d664 { url=file:/C:/Bin/jboss-3.2.1/server/test/deploy/datasource.xml }
      deployer: null
      status: null
      state: INIT_WAITING_DEPLOYER
      watch: file:/C:/Bin/jboss-3.2.1/server/test/deploy/datasource.xml
      lastDeployed: 1056541417979
      lastModified: 1056541417929
      mbeans:
      ]Incompletely deployed packages:
      [org.jboss.deployment.DeploymentInfo@bd93d664 { url=file:/C:/Bin/jboss-3.2.1/server/test/deploy/datasource.xml }
      deployer: null
      status: null
      state: INIT_WAITING_DEPLOYER
      watch: file:/C:/Bin/jboss-3.2.1/server/test/deploy/datasource.xml
      lastDeployed: 1056541417979
      lastModified: 1056541417929
      mbeans:
      ]MBeans waiting for classes:

      MBeans waiting for other MBeans:



      What does it mean ? What did I miss ?
      I have to say I read the Jboss3.0 quick start guide and I even bought the Jboss book Administration and Developpement book, and it's very tough to understand what a user have to setup in order to get something work.

      Regards.
      Dom

        • 1. Re: [JBOSS newbie] setting up a Connection pool and a DataSo
          Jon Barnett Master

          If it is a datasource, in 3.2.x, the naming convention requires that it ends with -ds.xml. This is so JBoss will recognise it as a datasource configuration file.

          So call it datasource-ds.xml. Also, for less confusion in the future, you may want to restrict your datasources so only one is defined per file. This is useful in development because if you change your definition while JBoss is running, JBoss will automatically redeploy your datasource configuration. When you have two in the one file, if you modify it for one, you will end up redeploying both. Which might be time consuming when your are debugging.

          Make sure the necessary JDBC driver and support classes are in the server/default/lib directory of your JBoss distribution (if you are running the default instance).