OpenJDK 16 和 Glassfish 6.1.0 部署导致 SAXException

OpenJDK 16 and Glassfish 6.1.0 deployment causes a SAXException

我最近一直在计算机崩溃后恢复我的 Java EE 设置,我想我会尝试 Open JDK 16 和 Glassfish 6.1.0 但是在部署我的应用程序时我得到了以下是我以前从未见过的异常​​:

java.io.IOException: com.sun.enterprise.admin.remote.RemoteFailureException: Error occurred during deployment: Exception while deploying the app [myapp-0.0.1-SNAPSHOT] : org.xml.sax.SAXException: Requested schema is not found in local repository, please ensure that there are no typos in the XML namespace declaration.. Please see server.log for more details.

我不确定如何解决这个问题,或者我应该回滚到 JDK11。我之前是 运行 JDK 1.8.0 和 Glassfish 5.1.0

Eclipse Glassfisch 6.1.0 当前不支持 JDK 16。仅 JDK11.

从文档中找到 here:

Eclipse GlassFish 6.2.0 is a Jakarta EE 9.1 Compatible Implementation and the latest release of Eclipse GlassFish. It supports Jakarta MVC as a major new feature. Officially supports JDK 11. Runs on JDK 16 (but not fully tested on 16).

Eclipse GlassFish 6.1.0 is a Jakarta EE 9.1 Compatible Implementation and the previous release of Eclipse GlassFish. It's functionally identical to Eclipse GlassFish 6.0.0, but supports JDK 11.

Eclipse GlassFish 6.0.0 is a Jakarta EE 9 Compatible Implementation and and older release of Eclipse GlassFish. This release only supports JDK 8.

因此您需要使用 jdk11 编译您的应用程序或升级到 glassfish 6.2.0。但请注意:尚未使用 jdk 16 对其进行全面测试。