7

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.

I am trying to get it work with @webservice annotation.

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.

Not sure if I am doing something wrong during the deployment or something else. Let me know if you want more info.

Regards,

Ravi Trivedi
  • 2,340
  • 2
  • 14
  • 20
  • Check this link http://java-vignettes.blogspot.ru/2011/10/websphere-jax-ws.html – Konstantin V. Salikhov Mar 29 '13 at 11:31
  • Konstantin, still no success buddy. – Ravi Trivedi Mar 29 '13 at 22:51
  • @RaviTrivedi, "I get nothing" means HTTP 404 or an Exception or just a browser connectivity error? – kolossus Mar 30 '13 at 06:56
  • @kolossus, yes, correct. it has 404 file not found error. Because websphere does not generate any artifacts during deployment. I confirmed it by checking the directory where program gets deployed and it does not have required artifacts(wsdl, etc etc). So obviously Service Provider(in the websphere GUI where jax-ws gets listed) is also empty. This has become highly intriguing :) – Ravi Trivedi Mar 30 '13 at 23:30
  • @RaviTrivedi Had similar problem, but with WAS 7. Have you checked Websphere's log? It pointed me where the error was (very obscure btw, but I managed to figure it out). – Miljen Mikic Apr 30 '13 at 15:07
  • @MiljenMikic, I did check logs, looked alright to me. What did you have in your logs ? – Ravi Trivedi Apr 30 '13 at 22:58
  • @RaviTrivedi Something like 'wsdl couldn't be generated'. The solution was packing wsdl together with war file and pointing Web service to use locally stored wsdl (annotation `@Webservice(wsdlLocation="META-INF/file.wsdl"`). It's quite interesting that the error wasn't logged in SystemErr log file, but in SystemOut. – Miljen Mikic May 01 '13 at 19:18
  • @MiljenMikic, let me check and get back to you. – Ravi Trivedi May 02 '13 at 04:44

4 Answers4

3

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.

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.

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 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). 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)

Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
bambata
  • 313
  • 1
  • 5
1

I was more or less running into the same issue you have, but on WAS 8.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.

Hope this helps...

Tudor Radu
  • 23
  • 2
  • Shouldn't 2.5 work ? I think 2.5 and above should work. Because 2.4 and below don't support annotation injection. But I will try with 3.0 – Ravi Trivedi May 22 '13 at 04:04
1

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.

DisableIBMJAXWSEngine: true
Parvez
  • 631
  • 1
  • 6
  • 19
0

Make sure you java runtime and project facet are 1.6 if you are using WAS 8.0.