The mysqlx protocol in Lucee

I’m trying to see if I can implement the mysqlx protocol (used with MySQL 8 for their “nosql” document store) in Lucee. The protocol is supported by the Connector/J 8.x driver so Lucee should have everything it needs to connect. I was trying to convert the example “Java Code” on this page:

import com.mysql.cj.xdevapi.*;
Session mySession = new SessionFactory().getSession("mysqlx://localhost:33060/test?user=user&password=password");

to CFML and I’m getting an error on the second line of code, so I have:

var SessionFactory = createObject( "java" , "com.mysql.cj.xdevapi.SessionFactory" );
var mySession = SessionFactory.getSession('mysqlx://root@mysql:33060/testdb');

However, the second line of code above generates this error:

lucee.runtime.exp.NativeException: com/google/protobuf/Message 
at com.mysql.cj.MysqlxSession.<init>( 
at com.mysql.cj.xdevapi.SessionImpl.<init>( 
at com.mysql.cj.xdevapi.SessionFactory.getSession( 
at com.mysql.cj.xdevapi.SessionFactory.getSession( 
at jdk.internal.reflect.GeneratedMethodAccessor74.invoke(Unknown Source) 
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
at java.base/java.lang.reflect.Method.invoke(Unknown Source) 
at lucee.runtime.reflection.pairs.MethodInstance.invoke( 
at lucee.runtime.reflection.Reflector.callMethod( 
at lucee.runtime.util.VariableUtilImpl.callFunctionWithoutNamedValues( 
at lucee.runtime.PageContextImpl.getFunction( 

This isn’t a particularly helpful error message/stack.

I’ve confirmed the container can connect to the MySQL container via the mysqlx protocol using mysql-shell so it isn’t a network connection issue. Also, the root user on my MySQL container doesn’t have a password, hence their not being one above and the password is optional according to the MySQL Connector/J docs here:

Anyone got any ideas?


OS: CommandBox Docker container (Linux)
Java Version: 11.0.11
Lucee Version: