Spring Boot ODL-yang-parser Could not explainalize ATN with version 3(expected 4)

c6ubokkw  于 2023-11-17  发布在  Spring
关注(0)|答案(1)|浏览(205)

我把我的springboot应用程序升级到了springboot 3。
我看到Hibernate使用了antlr版本4.10.1,但是在我的代码中有另一个依赖项,叫做odl-yangtools-yang-parser,它使用的是antlr版本4.7.1
当我尝试运行我的应用程序并使用yang解析器时,我得到了以下异常

Caused by: java.lang.UnsupportedOperationException: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:56) ~[antlr4-runtime-4.10.1.jar!/:4.10.1]
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:48) ~[antlr4-runtime-4.10.1.jar!/:4.10.1]
at org.opendaylight.yangtools.antlrv4.code.gen.YangStatementLexer.<clinit>(YangStatementLexer.java:154) ~[yang-parser-impl-1.2.3.jar!/:?]
... 333 more
Caused by: java.io.InvalidClassException: org.antlr.v4.runtime.atn.ATN; Could not deserialize ATN with version 3 (expected 4).
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:56) ~[antlr4-runtime-4.10.1.jar!/:4.10.1]
at org.antlr.v4.runtime.atn.ATNDeserializer.deserialize(ATNDeserializer.java:48) ~[antlr4-runtime-4.10.1.jar!/:4.10.1]
at org.opendaylight.yangtools.antlrv4.code.gen.YangStatementLexer.<clinit>(YangStatementLexer.java:154) ~[yang-parser-impl-1.2.3.jar!/:?]
... 333 more

字符串


的数据
有没有一种方法可以同时满足这两种情况?
或者有没有办法降级休眠,它在springboot 3中使用antlr4-runtime4.7.1版本。
还请多多指教。

lf5gs5x2

lf5gs5x21#

我降级了hibernate,它在我的旧解析器实现中工作得很好。
下面是我的pom.xml更改

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-starter-logging</artifactId>
            </exclusion>
            <exclusion>
                <artifactId>hibernate-commons-annotations</artifactId>
                <groupId>org.hibernate.common</groupId>
            </exclusion>
            <exclusion>
                <artifactId>spring-data-jpa</artifactId>
                <groupId>org.springframework.data</groupId>
            </exclusion>
            <exclusion>
                <artifactId>hibernate-core</artifactId>
                <groupId>org.hibernate.orm</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
        <version>3.0.10</version>
    </dependency>
    <dependency>
        <groupId>org.hibernate.orm</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>6.0.0.Final</version>
    </dependency>

字符串

相关问题