Search code examples
eclipsejax-wswebsphere-liberty

WebSphere Liberty JAX-WS Web Service Generation in Eclipse


I have

  • WebSphere Liberty 17.0.0.1 "BASE_ILAN" x86_64 on Windows Server 2012 R2
  • Eclipse Neon.3 on Windows 10 x86_64 (separate server on the same LAN)
  • Oracle Java JDK 1.8.0_121 running Liberty
  • IBM JDK 8 (from the Eclipse bundle) running Eclipse (need it for the Windows remote server start/stop support)

In the bin directory, productInfo featureInfo returns many things, but among them:

  • jaxws-2.2 [1.0.0]
  • javaee-7.0 [7.0.0] (since this is a convenience feature that brings in tons of other stuff, you can probably infer how many other dozens of things I have also)

In my server.xml, under <featureManager>, I have a <feature>...</feature> for:

  • javaee-7.0
  • localConnector-1.0
  • jsf-2.2
  • restConnector-2.0
  • jaxws-2.2
  • jaxrs-2.0

In Eclipse, I right-click on my WAR project, go to New -> Other..., and pick Web Services -> Web Service. Click Next.

Now I have a dialog with the following fields:

  • Web service type: "Bottom up Java bean Web Service"
  • Service implementation: some.package.SomeWebService (from my code; it contains proper @WebService annotations, etc.)
  • Slider set to "Start service" for the service, and "No client" on the bottom
  • Configuration:
    • Server runtime: WebSphere Application Server Liberty
    • Web service runtime: IBM WebSphere JAX-WS
    • Service project: <my WAR project>
    • Service EAR project: <my EAR project>
  • "Publish the Web service" checkbox is unchecked
  • "Monitor the Web service" checkbox is unchecked
  • "Overwrite files without warning" checkbox is checked

When I click Next, I get the following warning:

The project is targeted against a server without IBM WebSphere JAX-WS support. Continuing code generation will result in compilation errors.

If I click OK, I get routed to another dialog, "WebSphere JAX-WS Bottom Up Web Service Configuration", with various options. Regardless of what I select here, when clicking Next or Finish, I get the following error:

Tools for the targeted server must be installed in order to generate Web services code.

How can I overcome this problem and use JAX-WS with Liberty? I have the full EE profile so it should work, right?

I have already tried refreshing the cache under Servers -> Runtime Environments -> Edit -> Advanced. I even deleted and recreated my server, as well as wiped the Liberty directory and unpacked it again from scratch, embedding jaxws and Java EE full profile support from the very beginning.


Solution

  • Try setting a target runtime. Right-click the WAR project, then select Properties, then Targeted Runtimes. Select the checkbox next to the Runtime Environment you created and can see in the Runtime Explorer view.