如何在 Java 11 上使用 WebServices?包 javax.jws 不存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/54516361/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 01:04:42  来源:igfitidea点击:

How to use WebServices on Java 11? package javax.jws does not exist

javajava-11

提问by Moises Coelho

I imigrate my aplication to AdoptOpenJDK11, I have found some problems, like "package javax.jws does not exist", I already configure build path with jar "jsr181-api.jar", it's a webApplication, how I fix it ? Have something new about webservices on AdoptOpenJDK 11?

我将我的应用程序迁移到 AdoptOpenJDK11,我发现了一些问题,比如“包 javax.jws 不存在”,我已经用 jar“jsr181-api.jar”配置了构建路径,它是一个 webApplication,我如何解决它?对 AdaptOpenJDK 11 上的 Web 服务有什么新的了解吗?

@WebService
@SOAPBinding(style = Style.RPC) // this tags doenst work

output:
error: package javax.jws does not exist
error: package javax.jws.soap does not exist

Someone know how I fix it?

有人知道我怎么修吗?

回答by Ben R.

Per Replacements for deprecated JPMS modules with Java EE APIs

更换为使用Java EE的API弃用JPMS模块

Use the reference implementation of JAX-WS instead.

请改用 JAX-WS 的参考实现。

<dependency>
  <groupId>com.sun.xml.ws</groupId>
  <artifactId>jaxws-ri</artifactId>
  <version>2.3.0</version>
  <type>pom</type>
</dependency>