Problem with mysql connection string after upgrade to 2022.1

Hi,

I just upgraded a customer installation from 2021.1 to 2022.1. Because of problems with the upgrade, I was forced to fully uninstall and reinstall the OL-Connect server.

I have a datamapper, which gets additional data from a mysql database. The relevant part of the script is:

var connectionString = "jdbc:mysql://host:3306/databaseName";
var conn = db.connect(connectionString, user, pass);

This worked for years without a glitch and still works, when I test it directly through the designer.
When I run it through the workflow, I get the following error:

W3001 : Error while executing plugin: HTTP/1.1 500 Internal Server Error - An unspecified error occurred which was caused by LoggedApplicationException: There was an error running the data mapping process caused by ApplicationException: Error executing DM configuration: Wrapped java.sql.SQLException: No suitable driver found for jdbc:mysql://host:3306/databaseName (scriptname#scriptrow) (DM1000031) (SRV000012) (SRV000001)

Any pointers would be helpful!

thanks and best regards
-ivan

The same problem with the javascript db.connect exists also in the 2022.2…
It affects not only the server but also the designer.
I’ll open a support case for this…
greets
-i.

I have tested it here with the following code and it works as expected:

var connectionString = "jdbc:mysql://localhost:3306/objectiflune";
var con = db.connect(connectionString, MyUserName, MyPassword);
statement = con.createStatement();
values = statement.executeQuery("select ID from datarecord");
if (values.next()) {
	logger.warn(values.getString("ID"));
}
values.close();
statement.close();
con.close();

The installer may have run into some kind of issue installing the JDBC driver. It’s strange that it didn’t notify you of it. Once Support has found what the issue is, please report it here for the benefit of other community members.

Hi Phil,
Thanks for taking the time to check it…
The issue is strange. I found a way to work around it, but only until I restart the designer or the server. After that the issue is there again.
It is for sure something with the classpath loader, because I don’t have any problem using a database data source for the datamapper.
Only the scripting is affected and only for non-jdbc datasources…
I’ll report here, when there is something to be reported :slight_smile:

Hi Phil,
The issue is now officially recognized as a bug in the current (2022.x) versions. There is no viable workaround to this, so I‘m currently stuck to 2021.2 for this project.
In short:
It is not possible to use JavaScript to connect to a database in the datamapper, if you don‘t have a database as a primary datasource, because the database driver classes don‘t get loaded.

Best regards

I really do not understand what the issue is, or I must not be testing the proper thing. The attached data mapping configuration processes a XML file (so it doesn’t use a database connection by default).

But one of the fields it extracts with JavaScript is a value from the OL Connect Database itself (it just grabs the ID of the first data record stored in the DB and stores it in the SomeValue field).

Sample DB Connection.OL-datamapper (4.4 KB)

You can try it yourself, it should work once you set the proper username/password in the script for the SomeValue field.

Can you let me know if that’s what you’re trying to achieve?

Sorry Phil,

I already downgraded all systems to 2021.2. There are no issues.
You should try your datamapper on a system with SQL Server as connect database and version bigger than 2021.2, if you have access to such. Restart the designer and load your datamapper. This should reproduce the error.
Or take a look at ticket #1159380

best regards

Oh… so it would be a SQL Server specific issue, then. I admit I didn’t test that as I don’t have a SQL Server instance handy. I will follow up with our Support team.