Hello.
I would like to know if MariaDB will be supported with WSO2 API Manager 3.1.0 
or newer. You wrote that it is supported 
(https://apim.docs.wso2.com/en/latest/install-and-setup/setup/setting-up-databases/changing-default-databases/changing-to-mariadb/),
 but my experience is that it isn't. The source code of APIM tells the same 
(that it isn't).
I found out this problem when I wanted to change WSO2SHARED_DB and WSO2AM_DB to 
MariaDB. The first start of APIM failed with exception that "admin" user cannot 
be persisted.
<output from wso2carbon.log>
Caused by: org.wso2.carbon.user.core.UserStoreException: Error while persisting 
user : admin
        at 
org.wso2.carbon.user.core.jdbc.UniqueIDJDBCUserStoreManager.persistUser(UniqueIDJDBCUserStoreManager.java:1234)
Caused by: org.wso2.carbon.user.core.UserStoreException: Error occurred while 
adding user properties for user : 9c4faa63-a77b-447a-bbc1-abc7cad55558
        at 
org.wso2.carbon.user.core.jdbc.UniqueIDJDBCUserStoreManager.addPropertiesWithID(UniqueIDJDBCUserStoreManager.java:2577)
Caused by: java.lang.Exception: Unsupported database: MariaDB. Database will 
not be created automatically by the WSO2 Registry. Please create the database 
using appropriate database scripts for the database.
</output from wso2carbon.log>

After some digging into the source code I found that MariaDB is not supported:
/opt/apim/repository/components/plugins/org.wso2.carbon.utils_4.6.0.jar => 
org.wso2.carbon.utils.dbcreator.DatabaseCreator.getDatabaseType(Connection 
conn):
<javaCode>
DatabaseMetaData metaData = conn.getMetaData();
String databaseProductName = metaData.getDatabaseProductName();
</javaCode>
When MariaDB 10.3.23 is used it returns the string "MariaDB". It is returned by 
DB engine (despite of JDBC connector used; I tried 
mariadb-java-client-2.6.0.jar and mysql-connector-java-5.1.44-bin.jar).
The string databaseProductName is then compared against this list: hsql, derby, 
mysql, oracle, mssql, h2, db2, postgresql, openedge, informix. There is no 
match and the exception (little strange) is thrown:
<javaCode>
String msg = "Unsupported database: " + dbUrl + ". Database will not be created 
automatically by the WSO2 Registry. Please create the database using 
appropriate database scripts for the database.";
throw new Exception(msg);
</javaCode>
It does not depend on the fact if database is created using scripts or not. 
Simply - the "MariaDB" is not in the list.
Best regards
Roman Chrenko

_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to