mulemule-studioanypoint-studiosqljdbcmule-esb

Mulesoft sqljdbc project will not run if native library location is set


I just began learning Mulesoft and want to put together a simple demo that uses sqljdbc to hit a SQL Server database with windows authentication.

Articles I referenced:

Connecting to MS SQL Server with MuleSoft

Using Database Connector with Microsoft SQL Server

Software details:

Mule Server 3.8.4 EE

Anypoint studio 6.2.4

Problem:

If I add the location of sqljdbc_auth.dll as native library location for sqljdbc42.jar, the project will not run.

Symptoms:

If anyone has any suggestions I would greatly appreciate it. If I can clarify anything or help by adding more details please let me know.


Solution

  • I had same issue, logged ticket with Mulesoft and got a workaround.

    First, you need to remove the reference to the sqljdbc_auth.dll. So remove that from the "Native library location" of the sqljjdbc42.jar.

    Next, you need to add a reference to the auth DLL to the "Run configuration" for your project. To do that, do the following:

    1. Right-click your project, choose "Run As/Run Configurations..."
    2. On the "Arguments" tab, add the following parameter to the "VM arguments:"

    -Djava.library.path="[path to your sqljsdb_auth.dll file]" (use quotes around the path if the path contains spaces)

    1. "Apply" the change and close out of the dialog and give it a go, see if that works for you.

    This worked for me, my project builds and deploys, I can debug and otherwise run it with SQL Server integrated authentication. I don't know what the implications of adding this to the Run Configuration are, but it seems to be working OK for me. If you already have things in your build path argument then you'll have to figure out how to add multiple items, I don't know how to do that though.