Skip to content

Unable to parse SQL due to reflective access issue with Java modules (java.lang.reflect) #8

@lefeng872

Description

@lefeng872

Hi, I'm trying to run the parser on the example.sql file using the following command:

java -jar --enable-preview target/qed-parser-1.0-SNAPSHOT-jar-with-dependencies.jar example.sql

However, I encounter the following output and error:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
In file:
        example.sql
java.lang.Exception: In statement:
        declare scalar function fund(varchar) returns float
Unable to make java.lang.reflect.Method(java.lang.Class,java.lang.String,java.lang.Class[],java.lang.Class,java.lang.Class[],int,int,java.lang.String,byte[],byte[],byte[]) accessible: module java.base does not "opens java.lang.reflect" to unnamed module @228575c0

It seems like this issue is related to Java's module system preventing reflective access to internal APIs. I'm using:
Java version: openjdk 19.0.2

System: (e.g., Ubuntu 20.04, x86_64)

Thanks in advance for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions