2 Replies Latest reply on Sep 21, 2009 12:03 PM by Pavel Nemec

    using c3p0 as DefaultDS, can`t force ejb-deployer [EJBTimerS

    Pavel Nemec Newbie

      jboss 4.2.3 GA, java version "1.6.0_15", c3p0-, linux

      I am trying to use c3p0 as only datasource and I want to get rid of hsqldb-ds and mysql-ds.

      c3p0-service.xml is default

       <mbean code="com.mchange.v2.c3p0.jboss.C3P0PooledDataSource"
       <attribute name="JndiName">PooledDS</attribute>-->
       <attribute name="JdbcUrl">URL</attribute>
       <attribute name="DriverClass">com.mysql.jdbc.Driver</attribute>
       <attribute name="User">USER</attribute>
       <attribute name="Password">PWD</attribute>

      I set ejb-deployer.xml - EJBTimerService to depend on this DS by change
      <depends optional-attribute name="DataSorce"> jboss.jca:service=DataSourceBinding,name=DefaultDS </depends>


      However I realize that c3p0 is not bound to jca, so I changed JNDI name of c3p0 bean to
      <mbean code="com.mchange.v2.c3p0.jboss.C3P0PooledDataSource"

      This worked, but EJBTimerSerivce try look up DataSource with null:
      ObjectName: jboss.ejb:service=EJBTimerService,persistencePolicy=database
       State: FAILED
       Reason: java.sql.SQLException: Failed to lookup data source: null
       I Depend On:

      This look like that EJBTimerService do not receive any DS. Putting back optional-argument=DataSource, helpd. Error message changed to:
      ObjectName: jboss.jca:service=DataSourceBinding,name=PooledDS
       Depends On Me:

      I find out that I am not alone with this problem. For example in jboss forum
      Which lead to inetersting solution http://www.nabble.com/c3p0-vs-JPA-injections-on-JBoss-td23722441.html . This helped me to fix EJBTimerService dependency on Pooled JNDI name.

      I am just thinging is it possible to live completly without any -ds.xml data source?