I am using the MSSQL database for WSO2 API manager 3.2.0 and want to use analytics. When I changed the database to MSSQL, this error appeared. How can I solve this problem?
-
Have you started the Dashboard? What errors do you see in the logs? – ycr Sep 28 '22 at 16:47
-
Cannot connect to JDBC URL jdbc:sqlserver:. Failed due to Failed to get driver instance – nahid afzali Sep 29 '22 at 04:36
-
Have you added the JDBC driver? Please check https://apim.docs.wso2.com/en/3.2.0/learn/analytics/configuring-apim-analytics/#step-5-include-third-party-libraries-and-database-drivers – sanoJ Sep 29 '22 at 04:41
-
Yes, I have. But the dashboard appears with an error that I showed in the picture. – nahid afzali Sep 29 '22 at 04:41
-
Yes, I added the JDBC driver in wso2 but not in analytics – nahid afzali Sep 29 '22 at 04:42
-
1You need to add it to wso2am-analytics as well – sanoJ Sep 29 '22 at 04:48
-
I added, but the error appeared again – nahid afzali Sep 29 '22 at 06:40
-
Do you still get the `Failed to get driver instance` error in logs? or only the UI error? – sanoJ Sep 29 '22 at 08:10
1 Answers
You need to add the MSSQL JDBC driver to the <API-M_ANALYTICS_HOME>/lib
directory to use MSSQL as the external database for Analytics. I have tried with mssql-jdbc
version 8.2.2.jre8
. Since mssql-jdbc
depends on OSGi Service JDBC you will need to add that jar as well to the <API-M_ANALYTICS_HOME>/lib
directory. You may use the following links to download the jars,
OSGi Service JDBC - https://mvnrepository.com/artifact/org.osgi/org.osgi.service.jdbc/1.0.1
Microsoft JDBC Driver For SQL Server - https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc/8.2.2.jre8
If you still face issues after adding the above jars, please add the complete stack trace related to the error. You can find the logs in the carbon.log
file located at <API-M_ANALYTICS_HOME>/wso2/worker/logs
.

- 2,935
- 2
- 8
- 18
-
Sanoj, I think you can copy the non-osgi driver to `
/jars` then you shouldn't need the OSGI dependencies. Or you can simply copy the OSGIed driver from APIM dropins directory(APIM_HOME/repository/components/dropins) and copy it to the ` – ycr Sep 29 '22 at 13:57/lib` directory. Please correct me if I'm wrong :) -
Yes, we can follow that approach as well @ycr. Thanks for pointing that out. – sanoJ Sep 30 '22 at 03:32
-
@sanoJ this error now appears: "Error getting SSO auth URL","bundle.js:110 POST https://localhost:9643/login/analytics-dashboard 500 (Internal Server Error)". how do I solve it? – nahid afzali Oct 03 '22 at 07:06
-
@ycr this error now appears: "Error getting SSO auth URL","bundle.js:110 POST localhost:9643/login/analytics-dashboard 500 (Internal Server Error)". how do I solve it? – nahid afzali Oct 03 '22 at 07:06