2 Replies Latest reply on Nov 15, 2002 7:45 PM by okidoky

    MS SQL Server 2000 and XA Connection problems

      I am using JMS and CMP in JBoss 3.0.2 and am having problems setting up a XA Connection pool to MS SQL Server 2000.

      Previously, I had a non-XA connection pool was working fine, both deployment and EJB use.


      The new XA pool deploys with no problems, but my EJBs cannot connect properly to it.

      My mssql-xa-service.xml is copied from the examples/jca. The issue is in the line:

      <config-property name="XADataSourceProperties" type="java.lang.String">ServerName=jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=CPI;SelectMethod=Cursor</config-property>



      With the "ServerName=" in there, I get:


      org.jboss.deployment.DeploymentException: Error while fixing table name; - nested throwable: (java.sql.SQLException: Unable to get Connection: javax.resource.ResourceException: Unable to create DB XAConnection: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.)
      at org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.fixTableName(SQLUtil.java:67)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCEntityBridge.java:103)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:397)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:339)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)
      at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)
      at org.jboss.ejb.Container.invoke(Container.java:764)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:1055)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)
      at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:967)
      at $Proxy5.start(Unknown Source)
      at org.jboss.system.ServiceController.start(ServiceController.java:396)
      at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
      ....

      So the driver is getting a bad connection string.




      When I remove the "ServerName=" from the XADataSourceProperties, I get:



      2002-09-18 06:41:07,578 WARN [org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory] Unable to create and initialize XADataSource:
      java.util.NoSuchElementException
      at java.util.StringTokenizer.nextToken(StringTokenizer.java:232)
      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.parseProperties(XAManagedConnectionFactory.java:491)
      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.getXADS(XAManagedConnectionFactory.java:455)
      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:368)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnection(InternalManagedConnectionPool.java:254)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:101)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:312)
      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 org.jboss.ejb.plugins.cmp.jdbc.SQLUtil.fixTableName(SQLUtil.java:38)
      at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCEntityBridge.(JDBCEntityBridge.java:103)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.initStoreManager(JDBCStoreManager.java:397)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.start(JDBCStoreManager.java:339)
      at org.jboss.ejb.plugins.CMPPersistenceManager.start(CMPPersistenceManager.java:198)
      at org.jboss.ejb.EntityContainer.start(EntityContainer.java:376)
      ...

      So the parsing of the DataSource properties is expecting "ServerName=" in there!


      How can I win here?


      Thanks,


      Sherman