Running Docker Wildfly/JBoss Application Server in Debug mode via Eclipse

I have recently built the whole Development Environment of Java Enterprise Edition (J2EE) project on multiple Docker containers. It has saved the hassle of setting up a dev env for new developers. All it takes to setup the environment is to clone our github repositories and run the Docker images.

I will explain the setup in a future post.

Build Wildfly Docker Image with Debugging Enabled

So basically in order to run the Wildfly in debug mode, we need to add --debug flag to the Wildfly startup script.

Also we need to expose port 8787 in our image as it's the default port for Wildfly JVM debug mode.

1. Create or change your Wildfly Dockerfile as follows:
$ cat Dockerfile
FROM jboss/wildfly:10.0.0.Final
EXPOSE 8787 
CMD ["/opt/jboss/wildfly/bin/", "-b", "", "-bmanagement", "", "--debug"]
2. Build and tag the image:
$ docker build -t wildfly-debug .
3. Run the image either via  docker run:
$ docker run -it -p 8080:8080 -p 8787:8787 --name wfdebug wildfly-debug 
or via docker-compose:
$ cat docker-compose.yml
version: '2'
    image: wildfly-debug
      - "8080:8080"
      - "8787:8787"
$ docker-compose up wfdebug

Eclipse Settings:

In the Eclipse, go to following path:

Window -> Perspective -> Open Perspective -> Debug

Now click on the arrow key next to the Debug button and choose "Debug Configurations"

On the left sidebar, choose "Remote Java Application", right click and New. 

- Give it a Name
- In the Connect tab, left the Project blank
- Choose the Connection Type as "Standard (Socket Attach)"
- Connection Properties: Host: "localhost", Port: "8787"
- In the Source tab, click Add, choose Java Project, and choose the project(s) you want to debug

Apply the changes, and click on Debug!

Boom! It should now connect to the remote Wildfly server running on docker in Debug mode.

I have faced below error several times whenever I don't properly follow the mentioned steps:
"Failed to connect to remote VM. Connection refused."


  1. Do not waste time winning money right now we have slot games Win an online casino.

  2. Sorry,
    it's possible to set debug mode from docker-compose?
    How can to copy into Wildfly?

    Thank for all

  3. I simply wanted to write down a quick word to say thanks to you for those wonderful tips and hints you are showing on this site.
    DevOps Online Training

    DevOps Training in Pune

  4. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Devops Training in Electronic City

  5. Writing with style and getting good compliments on the article is quite hard, to be honest.But you've done it so calmly and with so cool feeling and you've nailed the job. This article is possessed with style and I am giving good compliment. Best! Latest & Updated Version

  6. I am overwhelmed by your post with such a nice topic. Usually I visit your blogs and get updated through the information you include but today’s blog would be the most appreciable. Well done! Tubidy Mobile Music MP3 Downloader Download

  7. ERP software testing is definitely a essential element of integrating and employing it for business development and related functions. Here's a detailed guide for any same. Online Docker Training

  8. I can’t say nothing but refute it until I have done the whole process in order to get the results and analyze them.

  9. Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work. via4d slot

  10. Your work here on this blog has been top notch from day 1. You've been continously providing amazing articles for us all to read and I just hope that you keep it going on in the future as well. Cheers!

  11. This blog is the general information for the feature. You got a good work for these blog.We have a developing our creative content of this mind.
    Thank you for this blog. This for very interesting and useful. DevOps Training | Certification in Chennai | DevOps Training | Certification in anna nagar | DevOps Training | Certification in omr | DevOps Training | Certification in porur | DevOps Training | Certification in tambaram | DevOps Training | Certification in velachery

  12. I truly value this superb post that you have accommodated us. I guarantee this would be helpful for a large portion of the general population.

  13. Wow, this is fascinating reading. I am glad I found this and got to read it. Great job on this content. I liked it a lot. Thanks for the great and unique info. website

  14. Hello! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche.
    Your blog provided us useful information to work on. You have done an outstanding job.
    Java training in Chennai

    Java training in Bangalore

    Java training in Hyderabad

    Java Training in Coimbatore

    Java Online Training

  15. Really helpful down to the ground, happy to read such a useful post. I got a lot of information through it and I will surely keep it in my mind. Keep sharing. If you are looking for some useful data and information regarding docker image and dockerfile then visit Coding Dolphin.


Post a Comment

Popular posts from this blog

Linux and AIX user non expiry and force password change at first login

Rebuild your new Yum repository after changing the packages