8 Replies Latest reply on Dec 6, 2002 10:55 PM by msnair

    Oracle XA datasource

    tractoristu

      Hi there,
      I am using JBOSS 3.0.3 and I'm trying to deploy an application that connects to an Oracle XA datasource. For this I use the following oracle-xa-service.xml configuration:
      <?xml version="1.0" encoding="UTF-8"?>

      <!-- ===================================================================== -->
      <!-- -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- ===================================================================== -->




      <!-- ==================================================================== -->
      <!-- ConnectionManager setup for xa oracle dbs -->
      <!-- Thanks to igor fedorenko <ifedorenko@thinkdynamics.com> -->
      <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
      <!-- YOU MUST CHANGE THE XidFactoryMBean config (in conf/jboss-service.xml -->
      <!-- or transaction-service.xml) to this: -->
      <!--

      true

      -->
      <!-- ==================================================================== -->


      <!--make the rar deploy! hack till better deployment-->
      jboss.jca:service=RARDeployer


      <depends optional-attribute-name="ManagedConnectionFactoryName">
      <!--embedded mbean-->

      <!--hack-->
      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=Minerva JDBC XATransaction ResourceAdapter

      <!--real attributes-->


      <config-property name="XADataSourceProperties"
      type="java.lang.String">URL=jdbc:oracle:oci8:@lyra</config-property>
      <config-property name="XADataSourceClass"
      type="java.lang.String">oracle.jdbc.xa.client.OracleXADataSource</config-property>
      <!--set these only if you want only default logins, not through JAAS -->
      <config-property name="UserName" type="java.lang.String">qmeter11</config-property>
      <config-property name="Password" type="java.lang.String">qmeter11</config-property>
      <!--
      Do not try to set transaction isolation level here or you'll get
      java.sql.SQLException: ORA-01453: SET TRANSACTION must be first statement of transaction
      Read committed is a default isolation level for Oracle, so there
      is not real need to set it here. I'll take a look into it later ...maybe.
      <config-property name="TransactionIsolation"
      type="java.lang.String">TRANSACTION_READ_COMMITTED</config-property>
      -->


      XAOracleDS



      <depends optional-attribute-name="ManagedConnectionPool">
      <!--embedded mbean-->


      0
      50
      5000
      15
      <!--criteria indicates if Subject (from security domain) or app supplied
      parameters (such as from getConnection(user, pw)) are used to distinguish
      connections in the pool. Choices are
      ByContainerAndApplication (use both),
      ByContainer (use Subject),
      ByApplication (use app supplied params only),
      ByNothing (all connections are equivalent, usually if adapter supports
      reauthentication)-->
      ByContainer


      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager

      <!-- Include a login module configuration named InformixXaDbRealm.
      Update your login-conf.xml, here is an example for a
      ConfiguredIdentityLoginModule:

      <application-policy name = "InformixXaDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">yourprincipal</module-option>
      <module-option name = "userName">yourusername</module-option>
      <module-option name = "password">yourpassword</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=XATxCM,name=InformixXaDS</module-option>
      </login-module>

      </application-policy>

      NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
      module-option name = "managedConnectionFactoryName"
      must match the object name of the ConnectionManager you are configuring here.
      -->
      <!--uncomment out this line if you are using the InformixXaDbRealm above
      InformixXaDbRealm
      -->

      <!-- <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager
      -->
      java:/TransactionManager




      When deploying the application some servlet is initialized, and a bean is created. In the bean's ejbCreate() a finder is called :
      ....
      Collection patterns = npHome.findByName(defaultNotifPattern);
      ....
      When the finder method is called the following exception is thrown :
      13:03:21,984 ERROR [STDERR] java.sql.SQLException: ORA-06550: line 1, column 13:
      PLS-00201: identifier 'JAVA_XA.XA_START_NEW' must be declared
      ORA-06550: line 1, column 7:
      PL/SQL: Statement ignored
      13:03:22,015 ERROR [STDERR] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
      13:03:22,031 ERROR [STDERR] at oracle.jdbc.oci8.OCIDBAccess.check_error(OCIDBAccess.java:1597)
      13:03:22,031 ERROR [STDERR] at oracle.jdbc.oci8.OCIDBAccess.executeFetch(OCIDBAccess.java:1209)
      13:03:22,046 ERROR [STDERR] at oracle.jdbc.oci8.OCIDBAccess.parseExecuteFetch(OCIDBAccess.java:1321)
      13:03:22,062 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:1446)
      13:03:22,062 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1371)
      13:03:22,062 ERROR [STDERR] at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1900)
      13:03:22,078 ERROR [STDERR] at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java
      :363)
      13:03:22,093 ERROR [STDERR] at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:407)
      13:03:22,093 ERROR [STDERR] at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:171)
      13:03:22,109 ERROR [STDERR] at org.jboss.tm.TxCapsule.startResource(TxCapsule.java:1232)
      13:03:22,109 ERROR [STDERR] at org.jboss.tm.TxCapsule.enlistResource(TxCapsule.java:726)
      13:03:22,125 ERROR [STDERR] at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:102)
      13:03:22,125 ERROR [STDERR] at org.jboss.resource.connectionmanager.XATxConnectionManager$XAConnectionEventListener.
      enlist(XATxConnectionManager.java:262)
      13:03:22,140 ERROR [STDERR] at org.jboss.resource.connectionmanager.XATxConnectionManager.managedConnectionReconnect
      ed(XATxConnectionManager.java:202)
      13:03:22,156 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseCo
      ......

      If someone knows how to solve this problem please help me !

        • 1. Re: Oracle XA datasource
          jecop

          Are you using JDK 1.4?
          If so, you need to get JDK14 compliant drivers for Oracle
          the old classes12.zip does not work.
          go to
          http://otn.oracle.com/software/tech/java/sqlj_jdbc/htdocs/jdbc9201.html

          • 2. Re: Oracle XA datasource
            tractoristu

            Hi there,
            I think i have found my problem .... :-)
            It seems that cause of the problem was very obvious :
            When the Oracle database server was installed the packages needed for the java XA transactions were not installed .
            Sorry for wasting your time ....

            • 3. Re: Oracle XA datasource
              msnair

              Hello Mircea,

              Seems like my JBoss also gives me the same error.

              Could you please send me some information on what SQL files need to be run for using Java XA on Oracle and also how they need to be executed.

              Thanks in advance for your time.

              Best Regards
              MS

              • 4. Re: Oracle XA datasource
                msnair

                Hello Mircea,

                Seems like my JBoss also gives me the same error.

                Could you please send me some information on what SQL files need to be run for using Java XA on Oracle and also how they need to be executed.

                Thanks in advance for your time.

                Best Regards
                MS

                • 5. Re: Oracle XA datasource
                  msnair

                  Hello Mircea,

                  Seems like my JBoss also gives me the same error.

                  Could you please send me some information on what SQL files need to be run for using Java XA on Oracle and also how they need to be executed.

                  Thanks in advance for your time.

                  Best Regards
                  MS

                  • 6. Re: Oracle XA datasource
                    msnair

                    Hello Mircea,

                    Seems like my JBoss also gives me the same error.

                    Could you please send me some information on what SQL files need to be run for using Java XA on Oracle and also how they need to be executed.

                    Thanks in advance for your time.

                    Best Regards
                    MS

                    • 7. Re: Oracle XA datasource
                      msnair

                      Hello Mircea,

                      Seems like my JBoss also gives me the same error.

                      Could you please send me some information on what SQL files need to be run for using Java XA on Oracle and also how they need to be executed.

                      Thanks in advance for your time.

                      Best Regards
                      MS

                      • 8. Re: Oracle XA datasource
                        msnair

                        Hello Mircea,

                        Seems like my JBoss also gives me the same error.

                        Could you please send me some information on what SQL files need to be run for using Java XA on Oracle and also how they need to be executed.

                        Thanks in advance for your time.

                        Best Regards
                        MS