我的目标是将目前与Java 8一起工作的Web应用程序迁移到Java11。由于JAXB和JAX组件已经从JDK11中删除,所以有必要使用Maven或Jar库添加适当的库。
其他遇到类似问题的人提出了各种各样的建议和建议,但我无法找到没有错误的组合。
pom.xml
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>11.0.2</version>
</dependency>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.0</version>
</dependency>
<!-- JAXWS for Java 11 -->
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>rt</artifactId>
<version>2.3.1</version>
</dependency>modules-info.java
module org.openfx.gustfx {
requires javafx.controls;
requires javafx.fxml;
requires transitive javafx.graphics;
requires java.xml.bind;
requires java.xml.ws;
requires javax.jws;
opens com.agile.ws.schema.common.v1.jaxws to javafx.fxml;
opens org.openfx.gustfx to javafx.fxml;
exports org.openfx.gustfx;
}运行代码会产生以下错误:
Unable to make field protected java.lang.String
com.agile.ws.schema.common.v1.jaxws.AgileUserUserGroupIdentifierType.classIdentifier accessible: module org.openfx.gustfx does not "opens com.agile.ws.schema.common.v1.jaxws" to unnamed module @4860d8d7我怎么能找到这个未命名的模块?
发布于 2019-05-15 00:11:57
我能够通过添加
opens com.agile.ws.schema.common.v1.jaxws;
opens com.agile.ws.schema.project.v1.jaxws;
opens com.agile.ws.schema.search.v1.jaxws;
opens com.agile.ws.schema.collaboration.v1.jaxws;到模块-info.java。错误消息建议“打开”应该是特定模块,但显然这不是必需的。
https://stackoverflow.com/questions/56105992
复制相似问题