Kaninchen
Kaninchen

Reputation: 477

How to debug web service with Eclipse Websphere liberty

First thing's first: I'm trying to develop an web service that is integrated with third party JCE(using Security.addProvider to use that jar which is packed into my WAR), but somehow when I deploy the WAR on my Websphere 8(with Java 1.8), it keep telling me that it cannot find the specified algorithm(AES) that I need unless I drag the JCE into Websphere's JRE and change its java security configurations.

Since I have no idea about the root cause, so I installed light-weighted websphere using the Eclipse's plugin install manager. Then I start the light-weighted server, select my web project and set it to debug on this server. But the Next screen I saw is "Context Root Not Found", even I changed the URL to the servlet.

I'm not familiar with WAS and it's liberty plugin, but isn't it suppose to run my project on it? like the Tomcat? Can anyone tell me how to run my WAR in it, so I can debug it? please?

Upvotes: 1

Views: 2550

Answers (1)

Andy Guibert
Andy Guibert

Reputation: 42926

First off, it looks like there is a misunderstanding on what Liberty is. When you say "light-weighted server" I'm assuming you mean Liberty, which is accurate -- Liberty is indeed a light-weight server.

However, WebSphere traditional and Liberty are two different products/servers. Liberty is not a plugin for WebSphere traditional.

A Java EE application running on WAS should behave very similarly to an application running on Liberty, because they are both Java EE compliant application servers. Since debugging and developing an application on Liberty will be easier/faster than on WAS, I would recommend using Liberty.

To debug your application on Liberty using the Eclipse WDT plugin:

  1. Open eclipse with the WebSphere Developer Tools (WDT) plugin installed (you can get WDT here).
  2. Follow this article to create a server using WDT. You can skip the parts about creating a sample application since you already have one.
  3. Open the "Servers" view (using Window->Show View->Other...->Servers) and find your server:enter image description here
  4. Right click the server and do Add and remove... then add your application to the server
  5. Set a breakpoint in your application code in Eclipse
  6. Start the server in debug mode (by pressing the bug icon shown in step 3)
  7. In the Eclipse menu, select Debug->Debug As->Debug on Server: enter image description here

Upvotes: 1

Related Questions