webMethods Integration server

Product/components used and version/fix level:

webMethods Integration Server: 10.15.0.0
MSSQL Server: 16.0.1
Java: 8
Microsoft JDBC Driver: mssql-jdbc-12.8.0.jre8

Detailed explanation of the problem:

I tried to create a new connection to MSSQL server, for “DataSource Class” i entered “com.microsoft.sqlserver.jdbc.SQLServerDriver”, when click on “Test connection” i got the below error

Error messages / full error message screenshot / log file:

Error encountered

[ART.118.5011] Adapter Runtime (Connection): Unable to create new connection connection:sqlServerConn. [ADA.1.204] Cannot connect to the database with DataSource class “com.microsoft.sqlserver.jdbc.SQLServerDriver”. class com.microsoft.sqlserver.jdbc.SQLServerDriver cannot be cast to class javax.sql.DataSource (com.microsoft.sqlserver.jdbc.SQLServerDriver is in unnamed module of loader com.wm.app.b2b.server.PackageClassLoader @12792b88; javax.sql.DataSource is in module java.sql of loader ‘platform’)

Question related to a free trial, or to a production (customer) instance?

Free trial

Hi Mazen,

the mentioned class does not implement the DataSource interface and therefore cannot be used with the JDBC Adapter. There should be a corresponding DataSource implementation in the driver jar.
Change your connection config to this DataSource class and test again.
After that you should be able to use your connection.

Regards,
Holger

1 Like

You can find the most up to date JDBC drivers from microsoft website below.

1 Like

Hi Engin,

you are right, but this does not seem to be issue here as the driver version 12.8 ist the latest and recommended one. Even the java version is out of scope here as the jre8 jar is the correct one for Java 8.

More likely it relates to wrong usage of the Driver class instead of the DataSource class, what I have already mentioned in my previous post.

Regards,
Holger

According to this information, it should be java 11 not java 8. To me it looks like it is a JDBC driver issue.

Even with Java 11, the jre8 jar should be working while using the jre11 jar might be the better option.

But as already mentioned, this only applies when choosing the correct class for the right Adapter technology:

  • Driver class for WmDB package
  • DataSource class for WmJDBCAdapter package.

Regards,
Holger

2 Likes

As @Holger_von_Thomsen wrote, this is indeed about the wrong Java class.

The error message indicates this very clearly:

class com.microsoft.sqlserver.jdbc.SQLServerDriver cannot be cast to class javax.sql.DataSource

1 Like

Hi Holger,
Thanks for your reply,
I changed the “DataSource Class” to “com.microsoft.sqlserver.jdbc.SQLServerDataSource”, and the connection worked successfully

2 Likes

The issue was in the “DataSource Class” the java 8 is working fine