web stats
MIRTH 3.8 openjdk11 and ms sql JDBC - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 08-24-2019, 07:06 AM
cguanes cguanes is offline
OBX.2 Kenobi
 
Join Date: Jan 2011
Posts: 57
cguanes is on a distinguished road
Angry MIRTH 3.8 openjdk11 and ms sql JDBC

I recently update our mirth server and it bring by default to run on openjdk11.
I have a few channel that connect to SQL 2014 and I was using the MS SQL JDBC (sqljdbc42.jar) custom-lib.

I did all the configuration again... adding the jar in the custom-lib and edit the dbdrivers.xml adding the SQL jar driver.

But I cannot make my channel to find the driver JDBC for MS SQL, getting this error:
ERROR MESSAGE: Error evaluating transformer
java.lang.NoClassDefFoundError: java/sql/Driver

However when I switch back to java8_64, the channel work fine and connect to the SQL.

What do I need to do to make it works?

PS: using the net.sourceforge.jtds.jdbc.Driver doesn't work with these SQL servers, it has some security level problem and the sql server reject the connection. I have to switch to MS SQL JDBC two years ago.
Reply With Quote
  #2  
Old 08-25-2019, 10:31 PM
agermano agermano is offline
Mirth Guru
 
Join Date: Apr 2017
Location: Indiana, USA
Posts: 964
agermano is on a distinguished road
Default

Can't tell from your post if you already did this or not, but in the user guide it has instructions for what to do if you are running on java version 9 or higher. It involves adding a few lines to your vmoptions file.
Reply With Quote
  #3  
Old 08-26-2019, 12:55 PM
cguanes cguanes is offline
OBX.2 Kenobi
 
Join Date: Jan 2011
Posts: 57
cguanes is on a distinguished road
Default

Quote:
Originally Posted by agermano View Post
Can't tell from your post if you already did this or not, but in the user guide it has instructions for what to do if you are running on java version 9 or higher. It involves adding a few lines to your vmoptions file.
I think that you are referring to this "In order to run Mirth Connect in Java 9 or greater, copy the options from /docs/mcservice-java9+.vmoptions and append them to either mcserver.vmoptions or mcservice.vmoptions, depending on your deployment. Then restart Mirth Connect" and I believe that is the case for Mirth installed on Windows or Linux machine but not for a Mirth Appliance.

I took a look in all the folders in my VMware appliance and there is not "mcserver.vmoptions" or "mcserver.vmoptions" that I could edit.

Thanks

Last edited by cguanes; 08-26-2019 at 01:05 PM.
Reply With Quote
  #4  
Old 09-10-2019, 03:21 PM
peterl peterl is offline
Mirth Employee
 
Join Date: Mar 2013
Posts: 3
peterl is on a distinguished road
Default

You're correct that you should not have to make the vmoptions changes manually on an Appliance.

Regarding the JDBC issue, in 3.8, the dbdrivers.xml file is no longer used. Instead the information about JDBC drivers is stored in the database and you can modify it through the Administrator. See https://www.mirthcorp.com/community/...erimprovements.

It's worth checking that the JDBC driver is configured correctly in the Administrator UI.
Reply With Quote
  #5  
Old 10-10-2019, 02:19 AM
aitougan aitougan is offline
Mirth Newb
 
Join Date: Apr 2013
Posts: 7
aitougan is on a distinguished road
Default

I am running Mirth Connect 3.8.0 on Ubuntu 18.4 with OpenJDK 11 and I am having that exact issue on three separate servers. The mcserver.vmoptions/mcservice.vmoptions modification has been performed to no avail. SOME channels are consistently throwing the exception "java.lang.NoClassDefFoundError: java/sql/Driver" while others seem to work just fine (until they stop working). It is all pretty random and so far, I wasn't able to find a workaround.
Reply With Quote
  #6  
Old 10-14-2019, 09:39 AM
aitougan aitougan is offline
Mirth Newb
 
Join Date: Apr 2013
Posts: 7
aitougan is on a distinguished road
Default

Resolved my issue by removing dependency on one particularly big and hairy legacy JAR compiled under Java 8. Somehow the third-party java binary was causing a conflict with JTDS. I guess, the JAR needed to be recompiled for JDK 11, but since I didn't really need it, removing the reference fixed the JDBC issue.
Reply With Quote
  #7  
Old 10-16-2019, 07:46 AM
rriker rriker is offline
What's HL7?
 
Join Date: Oct 2019
Location: Duke University - Durham, NC USA
Posts: 2
rriker is on a distinguished road
Default

Hey aitougan,

I am running into the same issue on openjdk-11 and 13 with the open9jvm running on RHEL (java.lang.NoClassDefFoundError: java/sql/Driver). My oddity was I had a test instance on 3.7 that not only did not have this issue, but I didn't even change the vmoptions per the documentation and it worked.

Which jar did you kill your reference on, and where did you kill it?
Reply With Quote
  #8  
Old 10-16-2019, 02:13 PM
rriker rriker is offline
What's HL7?
 
Join Date: Oct 2019
Location: Duke University - Durham, NC USA
Posts: 2
rriker is on a distinguished road
Default

Resolved my issue by one of two ways (not sure which...or both)
1. removed ojdbc6.jar from custom-libs (I was having some connection issues with 7 and was testing backwards compatibility). This matches aitougan's solution by removing an ancient jar
2. added the read-only database url in the mirth.properties file. It wasn't different from the regular connection url (it's a dedicated MSSS instance) but the stack trace was leading me to it (I had no custom drivers installed, either) and I had the read-only max-connections set.

Unfortunately, I did both at the same time, overrode the java home to look for openJDK13 (w/openj9 vm), and added the java9+ lines to the mcservice.vmoptions

Code:
java.lang.NoClassDefFoundError: java.sql.Driver
at java.base/java.lang.ClassLoader.defineClassImpl(Native Method)
...yadda adda...
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1067)
at com.mirth.connect.connectors.jdbc.CustomDriver.<init>(CustomDriver.java:40)
at com.mirth.connect.server.userutil.DatabaseConnectionFactory.initializeDriverAndGetInfo(DatabaseConnectionFactory.java:145)
at com.mirth.connect.server.userutil.DatabaseConnectionFactory.getCustomDriverInfo(DatabaseConnectionFactory.java:167)
at com.mirth.connect.server.userutil.DatabaseConnectionFactory.createDatabaseConnection(DatabaseConnectionFactory.java:54)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 05:48 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation