首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >带有JAXB和JAXWS问题的JDK 11

带有JAXB和JAXWS问题的JDK 11
EN

Stack Overflow用户
提问于 2019-05-13 05:02:22
回答 1查看 2K关注 0票数 1

我的目标是将目前与Java 8一起工作的Web应用程序迁移到Java11。由于JAXB和JAX组件已经从JDK11中删除,所以有必要使用Maven或Jar库添加适当的库。

其他遇到类似问题的人提出了各种各样的建议和建议,但我无法找到没有错误的组合。

pom.xml

代码语言:javascript
复制
<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

代码语言:javascript
复制
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;
}

运行代码会产生以下错误:

代码语言:javascript
复制
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

我怎么能找到这个未命名的模块?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-05-15 00:11:57

我能够通过添加

代码语言:javascript
复制
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。错误消息建议“打开”应该是特定模块,但显然这不是必需的。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56105992

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档