May 282012

Having the following issue when try to test/connect a MSSQL XA datasource in WLS:

Connection test failed.
BEA[SQLServer JDBC Driver]SQLServerCould not find the function xp_jdbc_open2 in the library sqljdbc.dll. Reason: 127(The specified procedure could not be found.).
weblogic.jdbc.base.BaseExceptions.createException(Unknown Source)
weblogic.jdbc.base.BaseExceptions.getException(Unknown Source)
weblogic.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
weblogic.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
weblogic.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
weblogic.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
weblogic.jdbc.sqlserver.SQLServerImplStatement.getNextResultType(Unknown Source)
weblogic.jdbc.base.BaseStatement.commonTransitionToState(Unknown Source)
weblogic.jdbc.base.BaseStatement.postImplExecute(Unknown Source)
weblogic.jdbc.base.BasePreparedStatement.postImplExecute(Unknown Source)
weblogic.jdbc.base.BaseStatement.commonExecute(Unknown Source)
weblogic.jdbc.base.BaseStatement.executeUpdateInternal(Unknown Source)
weblogic.jdbc.base.BasePreparedStatement.executeUpdate(Unknown Source)
weblogic.jdbcx.sqlserver.SQLServerImplXAResource.executeXaRpc(Unknown Source)
weblogic.jdbcx.sqlserver.SQLServerImplXAResource.executeXaRpc(Unknown Source) Source)
weblogic.jdbcx.base.BaseXAConnection.<init>(Unknown Source)
weblogic.jdbcx.base.BaseXADataSource.getXAConnection(Unknown Source)


SQL Server : Microsoft SQL Server 2008 Enterprise Edition (64-bit)
Weblogic OS version : Red Hat Enterprise Linux Server release 5.6\
Weblogic Version: 10.3.x

Please try the following:

The weblogic-branded driver for SQLServer requires three things in order to do XA:
1. The extended stored procedures provided with the driver must have been installed in the DBMS.
2. The DBMS’s DTC service must be running, and allow XA transactions.
3. The driver comes with several DLLs. The correct DLL must be chosen, copied to the DBMS’s BINN directory for it’s use and renamed sqljdbc.dll.

Example Drivers:


|sqljdbc.dll| (for x32 platforms)


|x64sqljdbc.dll| (for x64 platforms)

To use JDBC distributed transactions through JTA, your system administrator should use the following procedure to install Microsoft SQL Server JDBC XA procedures. This procedure must be repeated for each MS SQL Server installation that will be involved in a distributed transaction.

To install stored procedures for JTA:

Copy the appropriate sqljdbc.dll and instjdbc.sql files from the WL_HOME\server\lib directory to the SQL_Server_Root/bin directory of the MS SQL Server database server, where WL_HOME is the directory in which WebLogic server is installed, typically c:\Oracle\Middleware\wlserver_10.x.
If you are installing stored procedures on a database server with multiple Microsoft SQL Server instances, each running SQL Server instance must be able to locate the sqljdbc.dll file. Therefore the sqljdbc.dll file needs to be anywhere on the global PATH or on the application-specific path. For the application-specific path, place the sqljdbc.dll file into the <drive>:\Program Files\Microsoft SQL Server\MSSQL$<Instance 1 Name>\Binn directory for each instance.

From the database server, use the ISQL utility to run the instjdbc.sql script. As a precaution, have your system administrator back up the master database before running instjdbc.sql. At a command prompt, use the following syntax to run instjdbc.sql:

ISQL -Usa -Psa_password -Sserver_name -ilocation\instjdbc.sql


sa_password is the password of the system administrator.

server_name is the name of the server on which SQL Server resides.

location is the full path to instjdbc.sql. (You copied this script to the SQL_Server_Root/bin directory .)

The instjdbc.sql script generates many messages. In general, these messages can be ignored; however, the system administrator should scan the output for any messages that may indicate an execution error. The last message should indicate that instjdbc.sql ran successfully. The script fails when there is insufficient space available in the master database to store the JDBC XA procedures or to log changes to existing procedures.


© Incase of any copyright infringements please check copyrights page for faster resolutions.

Leave a Reply

Show Buttons
Hide Buttons