简体   繁体   English

jax-ws Web服务在Websphere 8.5中不起作用

[英]jax-ws web service does not work in websphere 8.5

Been trying to get jax-ws web service working in websphere 8.5 but no success. 一直试图让jax-ws Web服务在Websphere 8.5中工作,但没有成功。 I have tried Java bean & war packaging, stateless ejb & jar packaging but it just does not work. 我已经尝试过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. 我让Websphere在部署过程中弄清楚。 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. 部署后,我尝试在浏览器中运行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, 问候,

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. 对于较旧的Web应用程序,Websphere解决方案是在相关战争的MANIFEST.MF中添加一个特殊属性:关键是UseWSFEP61ScanPolicy,其值为true。 see here for more details. 有关更多详细信息,请参见此处

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). Servlet 3.0规范还具有一个控制扫描的参数(通常用于加速应用程序的冷启动初始化)。 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) 将metadata-complete =“ true”放在web.xml 3.0部署描述符的根标记中将阻止进行扫描(而false则启用扫描)

I was more or less running into the same issue you have, but on WAS 8.0. 在WAS 8.0上,我或多或少遇到了您遇到的同一问题。

Make sure that your web.xml is written for the Servlet 3.0 specification. 确保为Servlet 3.0规范编写了web.xml。 I was using a web.xml for Servlet 2.4 and updating the version to 3.0 fixed the issue for me. 我使用的是Servlet 2.4的web.xml,并将版本更新为3.0可以解决此问题。

Hope this helps... 希望这可以帮助...

Faced similar problem with WAS8.5 It was due to annotation scanning done by both WAS and application. WAS8.5面临类似的问题,这是由于WAS和应用程序都完成了注释扫描。 After disabling WAS annotation scanning with "DisableIBMJAXWSEngine" application is able to start. 禁用WAS注释后,即可启动“ DisableIBMJAXWSEngine”应用程序扫描。

DisableIBMJAXWSEngine: true

如果使用WAS 8.0,请确保Java运行时和项目方面为1.6

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM