【问题标题】:Spring 3.x Application not working after updating from Java 7 to JAVA 8从 Java 7 更新到 JAVA 8 后 Spring 3.x 应用程序无法正常工作
【发布时间】:2015-03-20 13:58:16
【问题描述】:

我有一个应用程序在使用 Java1.7 时运行良好。我们最近升级到 JAVA 1.8,之后应用程序无法运行。以下是我在启动它时遇到的异常

Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class
: file [/gui/XXXXX$1.class];
 nested exception is java.lang.ArrayIndexOutOfBoundsException: 13864
 at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:237)

我们使用 Spring 3.x 和 Java 8。它们都兼容吗?如果不是我必须升级到哪个版本?我们不能使用 JAVA 8,因为其他应用程序都是基于它构建的,或者有没有办法在 JAVA 7 中单独编译这个源?我们正在使用 Maven 来构建应用程序。这是 SEV1 优先级,因此非常感谢任何帮助。提前谢谢你

【问题讨论】:

    标签: java spring maven


    【解决方案1】:

    Spring 4.0 版是 Spring Framework 的最新主要版本,也是第一个完全支持 Java 8 功能的版本。

    另请参阅 this stackoverflow 项目讨论相同的问题。

    【讨论】:

    • 那么你的意思是spring 4是必需的,而3.x不兼容java 8?
    • 是的,您需要升级。
    • Uograde to spring 4.x 帮助...谢谢
    猜你喜欢
    • 1970-01-01
    • 2015-06-26
    • 1970-01-01
    • 2013-07-07
    • 1970-01-01
    • 2020-06-16
    • 1970-01-01
    • 1970-01-01
    • 2022-11-11
    相关资源
    最近更新 更多