Der-Joscha opened a new issue, #2882:
URL: https://github.com/apache/drill/issues/2882

   Hello,
   
   I am currently working on an application with java 21 that uses the jdbc 
driver from drill to execute distributed sql queries. 
   Since the module system was introduced with Java 9, we get exceptions on 
startup that drill cannot patch various dependencies (see stacktrace below). I 
am aware that drill tries to access classes that are not exported via 
reflection, which fails for obvious reasons.
   
   What I already did:
   - See if there are versions that supprot java>8. I found docker images that 
use java 17, but I have not found a jdbc driver that supports this version
   - Add `--add-opens java.base/java.lang=ALL-UNNAMED` to the jvm at runtime, 
which resolves the issue but is rather unappealing workaround as some drill 
images seem to support java>8
   
   Our setup is the following:
   - We are using java 21 and unfortunately cannot downgrade to java 8 due to 
other dependencies.
   - We are using maven as a build system and have 
`org.apache.drill.exec:drill-jdbc:jar:1.21.0` as a dependency
   
   Is there a possibility to use the drill jdbc driver with a java version > 8, 
or are we stuck with our workaround?
   I will happily provide more information if needed.
   Thanks in advance.
   
   <details>
   
   <summary>Stacktrace</summary>
   org.apache.drill.common.util.ProtobufPatcher patchByteString
   2024-02-26T12:45:13.072736994Z WARNING: Unable to patch Protobuf.
   2024-02-26T12:45:13.072742894Z 
java.lang.reflect.InaccessibleObjectException: Unable to make protected final 
java.lang.Class 
java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
 throws java.lang.ClassFormatError accessible: module java.base does not "opens 
java.lang" to unnamed module @edc0eb6
   2024-02-26T12:45:13.072747295Z       at 
java.base/java.lang.reflect.AccessibleObject.throwInaccessibleObjectException(AccessibleObject.java:391)
   2024-02-26T12:45:13.072750695Z       at 
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:367)
   2024-02-26T12:45:13.072753895Z       at 
java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:315)
   2024-02-26T12:45:13.072756995Z       at 
java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:203)
   2024-02-26T12:45:13.072759795Z       at 
java.base/java.lang.reflect.Method.setAccessible(Method.java:197)
   2024-02-26T12:45:13.072762695Z       at 
javassist.util.proxy.SecurityActions.setAccessible(SecurityActions.java:159)
   2024-02-26T12:45:13.072765296Z       at 
javassist.util.proxy.DefineClassHelper$JavaOther.defineClass(DefineClassHelper.java:213)
   2024-02-26T12:45:13.072767696Z       at 
javassist.util.proxy.DefineClassHelper$Java11.defineClass(DefineClassHelper.java:52)
   2024-02-26T12:45:13.072770496Z       at 
javassist.util.proxy.DefineClassHelper.toClass(DefineClassHelper.java:260)
   2024-02-26T12:45:13.072774596Z       at 
javassist.ClassPool.toClass(ClassPool.java:1240)
   2024-02-26T12:45:13.072792697Z       at 
javassist.ClassPool.toClass(ClassPool.java:1098)
   2024-02-26T12:45:13.072796597Z       at 
javassist.ClassPool.toClass(ClassPool.java:1056)
   2024-02-26T12:45:13.072799497Z       at 
javassist.CtClass.toClass(CtClass.java:1298)
   2024-02-26T12:45:13.072802398Z       at 
org.apache.drill.common.util.ProtobufPatcher.patchByteString(ProtobufPatcher.java:77)
   2024-02-26T12:45:13.072805198Z       at 
org.apache.drill.common.util.ProtobufPatcher.patch(ProtobufPatcher.java:48)
   2024-02-26T12:45:13.072808098Z       at 
org.apache.drill.jdbc.Driver.<clinit>(Driver.java:46)
   2024-02-26T12:45:13.072811198Z       at 
java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
   2024-02-26T12:45:13.072813898Z       at 
java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
   2024-02-26T12:45:13.072816798Z       at 
java.base/jdk.internal.reflect.MethodHandleAccessorFactory.ensureClassInitialized(MethodHandleAccessorFactory.java:300)
   2024-02-26T12:45:13.072820999Z       at 
java.base/jdk.internal.reflect.MethodHandleAccessorFactory.newConstructorAccessor(MethodHandleAccessorFactory.java:103)
   2024-02-26T12:45:13.072823999Z       at 
java.base/jdk.internal.reflect.ReflectionFactory.newConstructorAccessor(ReflectionFactory.java:200)
   2024-02-26T12:45:13.072827499Z       at 
java.base/java.lang.reflect.Constructor.acquireConstructorAccessor(Constructor.java:549)
   2024-02-26T12:45:13.072830299Z       at 
java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
   2024-02-26T12:45:13.072832999Z       at 
java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:486)
   2024-02-26T12:45:13.072835899Z       at 
java.base/java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:789)
   2024-02-26T12:45:13.072838699Z       at 
java.base/java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:729)
   2024-02-26T12:45:13.072841400Z       at 
java.base/java.util.ServiceLoader$3.next(ServiceLoader.java:1403)
   2024-02-26T12:45:13.072844300Z       at 
java.sql/java.sql.DriverManager$2.run(DriverManager.java:619)
   2024-02-26T12:45:13.072847100Z       at 
java.sql/java.sql.DriverManager$2.run(DriverManager.java:599)
   2024-02-26T12:45:13.072850200Z       at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:319)
   2024-02-26T12:45:13.072853000Z       at 
java.sql/java.sql.DriverManager.ensureDriversInitialized(DriverManager.java:599)
   2024-02-26T12:45:13.072855900Z       at 
java.sql/java.sql.DriverManager.getConnection(DriverManager.java:671)
   2024-02-26T12:45:13.072858801Z       at 
java.sql/java.sql.DriverManager.getConnection(DriverManager.java:253)
   </details>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@drill.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to