1 Reply Latest reply on Nov 18, 2002 5:37 PM by Bob Barnes

    Configuring an XA Datasource

    Bob Barnes Newbie

      Just as background, I'm a driver developer attempting to get my company's driver working with JBoss. The standard DataSource seems to be working fine, but I'm having trouble getting the XADataSource implementation working.
      I originally posted a question entitled "Configuring XA Support Problem" in the Installation & Configuration forum and based on a response modified my JBoss xml with some success. I'm now encountering a different set of errors and hope that someone can shed some light on what's happening.

      I get the following error output on the console when attempting to get an XA connection.

      10:04:54,220 WARN [XAManagedConnectionFactory] No setter method for attribute user (value=XXXXXX).
      10:04:54,223 WARN [XAManagedConnectionFactory] No setter method for attribute port (value=XXXX).
      10:04:54,224 WARN [XAManagedConnectionFactory] No setter method for attribute password (value=XXXXXXXX).
      10:04:54,225 WARN [XAManagedConnectionFactory] No setter method for attribute databaseName (value=XXXXXX).
      10:04:54,227 WARN [XAManagedConnectionFactory] No setter method for attribute serverName (value=XXX.XXX.XXX.XXX).
      10:04:54,250 ERROR [LogInterceptor] Unexpected Error:
      java.lang.ClassFormatError: com/company/jdbc/XYZDriver (Illegal Variable name "")
      at java.lang.ClassLoader.defineClass0(Native Method)
      at java.lang.ClassLoader.defineClass(ClassLoader.java:488)
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)
      at java.net.URLClassLoader.defineClass(URLClassLoader.java:243)
      at java.net.URLClassLoader.access$100(URLClassLoader.java:51)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:190)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:183)
      at org.jboss.mx.loading.UnifiedClassLoader.findClass(UnifiedClassLoader.java:226)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:294)
      at org.jboss.mx.loading.UnifiedClassLoader.loadClassLocally(UnifiedClassLoader.java:234)
      at org.jboss.mx.loading.UnifiedLoaderRepository2.loadClassFromRepository(UnifiedLoaderRepository2.java:269)
      at org.jboss.mx.loading.UnifiedLoaderRepository2.loadClass(UnifiedLoaderRepository2.java:149)
      at org.jboss.mx.loading.UnifiedClassLoader.loadClass(UnifiedClassLoader.java:283)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:250)
      at com.company.datasource.XYZXADataSource.getXAConnection(XYZXADataSource.java:57)
      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:368)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnection(InternalManagedConnectionPool.java:259)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:106)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:323)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:467)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:532)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
      at org.jboss.resource.adapter.jdbc.JDBCDataSource.getConnection(JDBCDataSource.java:110)
      at TestBean.getConnection(TestBean.java:525)

      The attributes for which the error/warning messages are being displayed do in fact have setter and getter methods (Note that they are in a subclass of the XYZXADataSource class, but I certainly hope that makes no difference). The java.lang.ClassFormatError also seems very strange considering that this driver works fine outside of JBoss and even works inside JBoss when using simple DataSources rather than XA. This is the relevant portion of the xxx-xa-service.xml file:



      <config-property>
      <config-property-name>XADataSourceClass</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <config-property-value>com.company.datasource.XYZXADataSource</config-property-value>
      </config-property>
      <config-property>
      <config-property-name>XADataSourceProperties</config-property-name>
      <config-property-type>java.lang.String</config-property-type>
      <!-- Put any required datasource properties on the next line seperated by ';'.
      For MS DTC enabled XA add the property DtcEnabled=true -->
      <config-property-value>serverName=XXX.XXX.XXX.XXX;port=XXXX;databaseName=XXXXXX;user=XXXXXX;password=XXXXXXXX</config-property-value>
      </config-property>

        • 1. Re: Configuring an XA Datasource
          Bob Barnes Newbie

          I've resolved the following problem, but wonder if this isn't a JBoss bug.

          10:04:54,220 WARN [XAManagedConnectionFactory] No setter method for attribute user (value=XXXXXX).
          10:04:54,223 WARN [XAManagedConnectionFactory] No setter method for attribute port (value=XXXX).
          10:04:54,224 WARN [XAManagedConnectionFactory] No setter method for attribute password (value=XXXXXXXX).
          10:04:54,225 WARN [XAManagedConnectionFactory] No setter method for attribute databaseName (value=XXXXXX).
          10:04:54,227 WARN [XAManagedConnectionFactory] No setter method for attribute serverName (value=XXX.XXX.XXX.XXX).

          If I modify the xml as follows:
          <config-property-value>ServerName=XXX.XXX.XXX.XXX;Port=XXXX;DatabaseName=XXXXXX;User=XXXXXX;Password=XXXXXXXX</config-property-value>

          (Note that the first letter of each attribute is now uppercase) the errors disappear. My impression was that this should be following java bean conventions and the attributes are really lower case. The new error is

          13:43:30,477 ERROR [STDERR] java.lang.IllegalArgumentException: null xaRes
          13:43:30,478 ERROR [STDERR] at org.jboss.tm.TxCapsule.enlistResource(TxCapsule.java:646)
          13:43:30,488 ERROR [STDERR] at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:102)
          13:43:30,489 ERROR [STDERR] at org.jboss.resource.connectionmanager.XATxConnectionManager$XAConnectionEventListener.enlist(XATxConnectionManager.java:262)
          13:43:30,491 ERROR [STDERR] at org.jboss.resource.connectionmanager.XATxConnectionManager.managedConnectionReconnected(XATxConnectionManager.java:202)
          13:43:30,493 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:534)
          13:43:30,495 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)