SSLexception error in Catalina.out

Hey, I upgraded to Lucee 5.3.3.60-RC last night on my test server to verify it works with OpenJDK 12.0.1 - (It does, yes!)

However, every hour I am getting the following error and this is on a cloud instance that has 0 traffic unless I am working on it. So I assumed this was a new issue. However, looking at my production Catalina.out log, it’s there as well for version 5.3.2.77

Tue Jul 09 03:13:41 EDT 2019 WARN: Caught while disconnecting...

EXCEPTION STACK TRACE:



** BEGIN NESTED EXCEPTION ** 

javax.net.ssl.SSLException
MESSAGE: closing inbound before receiving peer's close_notify

STACKTRACE:

javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:133)
	at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:307)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:263)
	at java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:254)
	at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:650)
	at java.base/sun.security.ssl.SSLSocketImpl.shutdownInput(SSLSocketImpl.java:629)
	at com.mysql.cj.protocol.a.NativeProtocol.quit(NativeProtocol.java:1319)
	at com.mysql.cj.NativeSession.quit(NativeSession.java:182)
	at com.mysql.cj.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:1750)
	at com.mysql.cj.jdbc.ConnectionImpl.close(ConnectionImpl.java:720)
	at lucee.runtime.db.DatasourceConnectionImpl.close(DatasourceConnectionImpl.java:309)
	at lucee.runtime.db.DCStack.clear(DCStack.java:159)
	at lucee.runtime.db.DCStack.clear(DCStack.java:139)
	at lucee.runtime.db.DatasourceConnectionPool.clear(DatasourceConnectionPool.java:175)
	at lucee.runtime.engine.Controler.control(Controler.java:325)
	at lucee.runtime.engine.Controler.control(Controler.java:236)
	at lucee.runtime.engine.Controler.access$000(Controler.java:60)
	at lucee.runtime.engine.Controler$ControlerThread.run(Controler.java:113)


** END NESTED EXCEPTION **

https://luceeserver.atlassian.net/browse/LDEV-2355

quite a few of the db extensions need updating, i.e mysql and sql server

Dang, Zac beat me to it :slight_smile: That’s a bug in the JDBC driver, which has since been patched in the driver, but Lucee has not yet made that new driver available. You can either disable SSL in your datasource connection or go make some noise on that ticket. Or both :slight_smile:

So, “in the old days” you could get the driver and manually update the file. Is that still possible?

Let me rephrase that - can I swap out

/lucee-server/bundles/com.mysql.cj-8.0.15.jar

with

mysql-connector-java-8.0.16.jar

from MySQL?

Yeah, you could grab the jar, or an OSGI bundle if they have it and then specify the classname or bundle name manually. I think adding an “other” dsn via the web admin only allows class name so it you go the bundle route, you’d probably need to specify the connection in your Application.cfc.

You should be able to grab the mysql-connector-java-8.0.16.jar from Maven and throw it into a quick OSGI bundle and voila!

To make it real easy, you could probably just copy out the .lex from the installed MySQL .15 bundle, open it, replace it with the .16 jar and update the MANIFEST to the new version and then drop it back into Lucee.

There’s not much to those bundles! I’ve made several for older databases we still need to connect to…

That’s kind of what I did.

I downloaded the 8.0.16 jar from MySQL and changed the name to com.mysql.cj-8.0.16, removed the 8.0.15 jar, opened the LEX and changed the versions. Also had to change the versions in the Lucee-server.xml file.

Working on test system with, no errors about SSL.

Of course, doing this for multiple contexts is a bit of a pain, but it avoids a huge log file.

Only thing now is that the Lucee Extension Application information (in Lucee admin) - it shows 8.0.16 but states that it requires 8.0.15.

I left the jar name alone as mysql-connector-java-8.0.16.jar and updated the MANIFEST.

You shouldn’t have to change anything in Lucee-server.xml? If you then just deploy the .lex it should update everything on its own:

No more log files with errors! You can download my version here to try:

mysql-connector-java-8.0.16.lex (2.1 MB)

Sweet! That did the trick!

Is there an easy to follow guide for creating these?

There are dozens of guides if you Google around on creating OSGI packages. But OSGI’ifying a single jar is pretty simple… it’s basically just extra meta-data in the package.

It can get a bit more complex when you are packaging several jars and they have dependencies upon other jars outside of those you wish to package…

Turning it into a Lucee extension is more involved, but not difficult. There are some basic examples in the Lucee docs somewhere…

So… Happy new year!! I am now trying to create a 8.0.18 OSGI bundle. I followed the guide here - https://lucee.daemonite.io/t/how-do-i-convert-an-existing-jar-file-into-an-osgi-bundle/374

I started with your 8.0.16 lex file, unzipped that, dropped in a new 8.0.18 driver, changed the manifest and then

  1. zipped it up, renamed extension to .lex - no go, Lucee did not recognize the manifest

  2. Then I tried the method at the link above and again, Lucee does not recognize the manifest.

I am pretty sure the manifest is correct. Generated a new UUID and all. Is there some special file format that I am missing?

Feel like I have wasted 2 hours on this. Here is my attempt.

com.mysql.cj-8.0.18.lex (2.1 MB) com.mysql.cj-8.0.18.lex

I am not positive, but just a quick look at the file you attached and your file structure appears to be an extra level deeper than mine.

i.e. my root contains 3 folders: “content”, “jars” and “META-INF” whereas your root contains “__MACOSX” and “com.mysql.cj-8.0.18” (with the relevant files being one deeper inside com.mysql.cj-8.0.18)

Try mimicking the folder structure I used and see if that makes a difference?

Excellent! Thank you! I took the easy way out and zipped the file from the Finder and then changed the extension to .lex.

This time, I zipped from the command line and made sure I zipped the correct folder.

Odd thing I created a valid UUID so that I would not use the same one you had in yours. But Lucee did not like that UUID. So, I reverted back to your UUID. Any idea why?

So. For anyone who wants to do this for later versions (i.e.: me, 6 months from now):

Download the file I have here 8.0.18, (or Leftbower’s) 8.0.16 version and do the following:

  • Unzip the file (it’s .lex, but it can be unzipped, or you just change the extension to .zip and then unzip)
  • Go to: the folder /com.mysql.cj-8.0.18/META-INF and open MANIFEST.MF (obviously with a text editor or IDE)
  • Change the version to the next version (.16, .18, etc) in both places
  • Drop the new JDBC driver from MySQL/Oracle into the /com.mysql.cj-8.0.18/jars folder
  • Zip it up from the terminal (command line), and change the extension to .lex
  • If you’re using MacOS you will want to do something like zip -r com.mysql.cj-8.0.16.zip * -x "*.DS_Store" to avoid the irritating DS_store files

Then change the extension from .zip to .lex and add it in the Lucee admin and voila - latest version of MySQl driver.

com.mysql.cj-8.0.16.lex (2.1 MB)

The UUID is extension-based, not different for each version of the same extension.