2 Replies Latest reply on Jun 5, 2006 7:22 AM by tamri

    Problem with Lookup XADataSource

    tamri

      I have jboss-4.0.4.CR2 and is configured mssql-xa-ds.xml:

      <xa-datasource>
      <jndi-name>MSSQLXADS</jndi-name>
      <track-connection-by-tx/>
      <isSameRM-override-value>false</isSameRM-override-value>
      <xa-datasource-class>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</xa-datasource-class>
      <xa-datasource-property name="ServerName">Itd308-02:1433</xa-datasource-property>
      <xa-datasource-property name="DatabaseName">staff</xa-datasource-property>
      <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>
      <!-- not sure if these should be here-->
      <user-name>sa</user-name>
      sa

      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

      <type-mapping>MS SQLSERVER2000</type-mapping>

      </xa-datasource>



      when I run JBOSS, on thi consol is written that this MSSQLXADS is binded, so it' seem everything ok.
      but When I run java program and I Lookup this JNDI (context.lookup("java:/MSSQLXADS")) it throws Exception
      javax.naming.NameNotFoundException: MSSQLXADS not bound

        • 1. Re: Problem with Lookup XADataSource
          jaikiran

           

          When I run java program



          That means you are accessing the datasource remotely. Have a look at:

          http://wiki.jboss.org/wiki/Wiki.jsp?page=HowCanIAccessADataSourceFromAClient





          • 2. Re: Problem with Lookup XADataSource
            tamri

            Now remote Lookup works, container returns dataSource bat when I return connection
            javax.sql.DataSource dataSource = (javax.sql.DataSource)context.lookup("java:/MSSQLXADS");
            con=dataSource.getConnection("sa","sa");
            it throws Exception:
            org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]xa_open (0) returns -3); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]xa_open (0) returns -3))

            at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:109)

            enyone knows ,how to do ?