java jax-ws Web 服务在 websphere 8.5 中不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15695907/
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
jax-ws web service does not work in websphere 8.5
提问by Ravi Trivedi
Been trying to get jax-ws web service working in websphere 8.5 but no success. I have tried Java bean & war packaging, stateless ejb & jar packaging but it just does not work.
一直试图让 jax-ws Web 服务在 websphere 8.5 中工作,但没有成功。我尝试过 Java bean & war 打包、无状态 ejb & jar 打包,但它不起作用。
I am trying to get it work with @webservice annotation.
我试图让它与@webservice 注释一起工作。
I am not generating any extra artifacts. I am letting websphere figure out during the deployment. During deployment there is no error. After deployment, I try to run wsdl in the browser to see if web service is installed successfully but I get nothing.
我没有生成任何额外的工件。我让 websphere 在部署过程中弄清楚。在部署期间没有错误。部署后,我尝试在浏览器中运行 wsdl 以查看 Web 服务是否安装成功,但我什么也没得到。
Not sure if I am doing something wrong during the deployment or something else. Let me know if you want more info.
不确定我在部署过程中是否做错了什么或其他什么。如果您需要更多信息,请告诉我。
Regards,
问候,
回答by bambata
Actually websphere 8.5 is Java EE 6 compliant which means that the container should scan the classpath of the web application to find @webservice annotated classes and deploy them as running web services.
实际上 websphere 8.5 是 Java EE 6 兼容的,这意味着容器应该扫描 web 应用程序的类路径以找到 @webservice 注释的类并将它们部署为正在运行的 web 服务。
However depending on the servlet specification you are using (given in the web.xml file) the scanning will not take place : it should automatically take place starting from version 2.5 of the specification.
但是,根据您使用的 servlet 规范(在 web.xml 文件中给出),不会进行扫描:它应该从规范的 2.5 版开始自动进行。
For older web applications the Websphere solution is to put a special attribute in the MANIFEST.MF of the related war : the key is UseWSFEP61ScanPolicy and the value true. see herefor more details.
对于较旧的 Web 应用程序,Websphere 解决方案是在相关War的 MANIFEST.MF 中放置一个特殊属性:关键是 UseWSFEP61ScanPolicy 和值 true。请参阅此处了解更多详情。
The servlet 3.0 specification also has a parameter controlling the scanning (it is usually used to speed up the cold start initialization of the application). Putting metadata-complete="true" in the root tag of your web.xml 3.0 deployment descriptor will prevent the scanning to happen (and false enables it)
servlet 3.0 规范还有一个参数控制扫描(通常用于加速应用程序的冷启动初始化)。将 metadata-complete="true" 放在 web.xml 3.0 部署描述符的根标记中将阻止扫描发生(假启用它)
回答by Tudor Radu
I was more or less running into the same issue you have, but on WAS 8.0.
我或多或少遇到了与您相同的问题,但是在 WAS 8.0.0 上。
Make sure that your web.xml is written for the Servlet 3.0 specification. I was using a web.xml for Servlet 2.4 and updating the version to 3.0 fixed the issue for me.
确保您的 web.xml 是为 Servlet 3.0 规范编写的。我在 Servlet 2.4 中使用了 web.xml,并将版本更新到 3.0 为我解决了这个问题。
Hope this helps...
希望这可以帮助...
回答by Parvez
Faced similar problem with WAS8.5 It was due to annotation scanning done by both WAS and application. After disabling WAS annotation scanning with "DisableIBMJAXWSEngine" application is able to start.
与WAS8.5 遇到类似问题 是由于WAS 和应用程序都进行了注释扫描。使用“DisableIBMJAXWSEngine”禁用 WAS 注释扫描后,应用程序就可以启动了。
DisableIBMJAXWSEngine: true
回答by Allenxxxx
Make sure you java runtime and project facet are 1.6if you are using WAS 8.0.
如果您使用的是 WAS 8.0,请确保您的 java 运行时和项目方面是1.6。