Does IntelliJ support remote deployment to Websphere Liberty?

Viewed 583

This is a possible duplicate of Intellij docker with live update of EAR inside websphere, but that question is 3 years old and the answer "not supported" is maybe outdated.

Via IntelliJ IDEA (2020.3 Ultimate) on Windows 10, I want to deploy an application (EAR) into a Websphere Liberty server which is running in a docker container. This worked with traditional websphere, now we are switching to WLP. Is this possible at all?

The server is up and running. I'm perfectly able to copy the ear to the (mounted) "dropins" folder and the server picks it up, expands it and deploys it without problems. I'm also able to attach the debugger in IntelliJ to the server and it will stop at breakpoints, it can even successfully update code ("hot swap classes").

What I did already:

  • I configured ports (7777,8880,9043,9443,9080) to forward 1:1 from the container to my local machine. I can successfully access at least port 9080 through a local browser.
  • I downloaded Websphere Liberty, Full Java EE 8 Profile, the same version as in the docker container, from IBM official website to my local hard drive, and expanded the zip.
  • Then I tried to follow the guide https://www.jetbrains.com/help/idea/run-debug-configuration-websphere-server.html and added a Run/Debug Configuration "Websphere Remote", I chose the expanded folder for IntelliJ for the "Application Server" configuration (I know that IntelliJ needed a local installation of Websphere for traditional version, so this may hold true for WLP as well).
  • I added the EAR-artifact for deployment in the Run Configuration. I copied the server name from the one inside docker and set the connection settings (localhost:9080).

The first try ("Test Connection") resulted in an error from IntelliJ: Error running 'WebSphere Application': JMX file not found: C:\[...]\wlp-javaee8-20.0.0.12\usr\servers\defaultServer\workarea\com.ibm.ws.jmx.local.address

  • Then I tried and copied this file from my docker container, it had the content service:jmx:rmi://127.0.0.1/stub/[... some seemingly byte64-encoded string] to the local path. This resulted in a different error: Error connecting to the Application Server: java.rmi.ConnectException: Connection refused to host: 127.0.0.1; nested exception is: java.net.ConnectException: Connection refused: connect
  • I also tried to use the content of the file com.ibm.ws.jmx.rest.address which was service:jmx:rest://localhost:9443/IBMJMXConnectorREST, (where I replaced the internal host name of the docker container by "localhost"), but that resulted in Error running 'WebSphere Application': java.net.MalformedURLException: Unsupported protocol: rest
  • If I start the local server on my machine (not in docker), connection works and deployment too. But this is not my aim.

PS: My server.xml contains <applicationMonitor updateTrigger="mbean"/>.

0 Answers
Related