1 Reply Latest reply on Dec 10, 2012 11:52 PM by ananymous7239

    How to use reportsevice.xml in place of reportds.xml

    ananymous7239

      Hi i am using Jboss as 4.3 server ,up to now i am using ds.xml to connect my DB where i mention database connection details,it is working fine

      but i want to use service.xml to connect with DB ,but i am not able to connect DB ,i am getting the following exceptions.i have no idea where to change JBoss server to look my service.xml for DB connections

      This is my reportds.xml

       

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

      <!DOCTYPE datasources

          PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN"

          "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd">

      <datasources>

           <local-tx-datasource>

            <jndi-name>mobeereportDatasource</jndi-name>

            <connection-url>jdbc:oracle:thin:@localhost:1521:mobee</connection-url>

            <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>

            <user-name>reportuser</user-name>

            <password>reportpasswd</password>

         </local-tx-datasource>

      </datasources>

       

       

      This is the reportservice.xml which now i want use

       

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

      <!DOCTYPE server>

      <server>

      <mbean code="com.mchange.v2.c3p0.jboss.C3P0PooledDataSource" name="jboss:service=C3P0PooledDataSource">

      <attribute name="JndiName">java:mobeereportDatasource</attribute>

      <attribute name="JdbcUrl">jdbc:oracle:thin:@localhost:1521:mobee</attribute>

      <attribute name="DriverClass">oracle.jdbc.driver.OracleDriver</attribute>

      <attribute name="User">reportuser</attribute>

      <attribute name="Password">reportpasswd</attribute>

      <attribute name="MinPoolSize">0</attribute>

      <attribute name="MaxPoolSize">10</attribute>

      <attribute name="AcquireIncrement">3</attribute>

      <depends>jboss:service=Naming</depends>

      </mbean>

      </server>

       

       

       

      This is the stacktrace:

       

       

      Caused by: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.ReportScheduler': java.sql.SQLException: Connections could not be acquired from the underlying database! [See nested exception: java.sql.SQLException: Connections could not be acquired from the underlying database!]

          at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:167)

          at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3652)

          at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3624)

          at org.quartz.impl.jdbcjobstore.JobStoreSupport.cleanVolatileTriggerAndJobs(JobStoreSupport.java:693)

          at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:555)

          ... 181 more

      Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!

          at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:104)

          at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:236)

          at com.mchange.v2.c3p0.PoolBackedDataSource.getConnection(PoolBackedDataSource.java:94)

          at com.mchange.v2.c3p0.ComboPooledDataSource.getConnection(ComboPooledDataSource.java:521)

          at org.springframework.scheduling.quartz.LocalDataSourceJobStore$2.getConnection(LocalDataSourceJobStore.java:125)

          at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:112)

          at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:164)

          ... 185 more

      Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.

          at com.mchange.v2.resourcepool.BasicResourcePool.awaitAcquire(BasicResourcePool.java:970)

          at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:208)

          at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:232)

          ... 190 more

       

       

      Can anyone please help me where and which file i have to change in Jboss server.

      thanks in advance

      venu

        • 1. Re: How to use reportsevice.xml in place of reportds.xml
          ananymous7239

          Hi i am able to connect to Database after some changes in Jboss server ,but now i am getting this Exception.after lot od google i am not able to find any solution ,please respond atleast for this

           

           

          StackTrace:

           

           

          javax.transaction.xa.XAException: Error trying to connect to provider java:/DefaultJMSProvider

              at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getDelegate(MessagingXAResourceWrapper.java:270)

              at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.recover(MessagingXAResourceWrapper.java:108)

              at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecovery(XARecoveryModule.java:774)

              at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecovery(XARecoveryModule.java:688)

              at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:179)

              at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWork(PeriodicRecovery.java:237)

              at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:163)

          Caused by: javax.naming.NameNotFoundException: XAConnectionFactory

              at org.jboss.ha.jndi.TreeHead.lookup(TreeHead.java:242)

              at org.jboss.ha.jndi.HAJNDI.lookup(HAJNDI.java:155)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

              at java.lang.reflect.Method.invoke(Method.java:597)

              at org.jboss.ha.framework.interfaces.HARMIClient.invoke(HARMIClient.java:312)

              at $Proxy45.lookup(Unknown Source)

              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:694)

              at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:654)

              at javax.naming.InitialContext.lookup(InitialContext.java:392)

              at org.jboss.util.naming.Util.lookup(Util.java:215)

              at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getConnectionFactory(MessagingXAResourceWrapper.java:392)

              at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.connect(MessagingXAResourceWrapper.java:338)

              at org.jboss.jms.server.recovery.MessagingXAResourceWrapper.getDelegate(MessagingXAResourceWrapper.java:260)

           

           

          Thanks in advance

           

          venu