We are trying to use Apache spark in our existing application. Spark is using Antlr4 version 4.9.
While Hibernate 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>
Thanks in advance.