Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not deserialize ATN with version 3 (expected 4) with Hibernate 6 #4568

Open
praval-123 opened this issue Mar 29, 2024 · 3 comments
Open

Comments

@praval-123
Copy link

We are trying to use Apache spark in our existing application. Spark is using Antlr4 version 4.9. While Hibernate 6 is using Antlr4 version 4.10.

Antlr has made changes between 4.9 version and 4.10 version which is causing below issue.

Caused by: java.lang.UnsupportedOperationException: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).

We are using below dependencies in our application which is running with Spring Boot 3.2.3 and Java 17. Below are the maven dependencies we are using.

 <dependency>
                <groupId>org.apache.spark</groupId>
                <artifactId>spark-core_2.12</artifactId>
                <version>3.5.0</version>
            </dependency>
    
            <dependency>
                <groupId>org.apache.spark</groupId>
                <artifactId>spark-sql_2.12</artifactId>
                <version>3.5.0</version>
            </dependency>

          <dependency>
            <groupId>org.hibernate.orm</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>6.2.1.Final</version>
            <exclusions>
                <exclusion>
                    <artifactId>dom4j</artifactId>
                    <groupId>org.dom4j</groupId>
                </exclusion>
            </exclusions>
        </dependency>

@praval-123
Copy link
Author

From above issues, I understand that between antlr 4.9 and 4.10 antlr4 store the ATN serialized in different formats, version 3 and 4. the respective runtimes, coming with the runtime dependency, are incompatible. It means apache spark (latest version) is incompatible with Hibernate 6 which is used with latest Spring boot and Java 17.

Is there any workaround or Apache Spark needs to updated with antlr4 4.10 version only?

@ericvergnaud
Copy link
Contributor

Spark parser needs to be regenerated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants