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.
So basically in order to run the Wildfly in debug mode, we need to add --debug flag to the Wildfly standalone.sh 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:
Eclipse Settings:
I will explain the setup in a future post.
Build Wildfly Docker Image with Debugging Enabled
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/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "--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'
services:
wfdebug:
image: wildfly-debug
ports:
- "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."
Great Article
ReplyDeleteJava Project Ideas for Final Year Students
FInal Year Project Centers in Chennai
JavaScript Training in Chennai
JavaScript Training in Chennai
DeleteGreat Article
Final Year Projects for CSE in Python
FInal Year Project Centers in Chennai
JavaScript Training in Chennai
JavaScript Training in Chennai
Do not waste time winning money right now we have slot games Win an online casino.
ReplyDeleteSorry,
ReplyDeleteit's possible to set debug mode from docker-compose?
How can to copy standalone.sh into Wildfly?
Thank for all
Beniamino
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.
ReplyDeleteDevOps Online Training
DevOps Training in Pune
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.
ReplyDeleteDevops Training in Electronic City
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
ReplyDeleteI 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
ReplyDeleteERP 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
ReplyDeleteI can’t say nothing but refute it until I have done the whole process in order to get the results and analyze them.
ReplyDeletePositive 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
ReplyDeleteYour 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! https://serverbrowse.com/
ReplyDeleteThis 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.
ReplyDeleteThank 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
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. https://serverbrowse.com/
ReplyDeleteWow, 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
ReplyDeleteHello! 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.
ReplyDeleteYour 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
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.
ReplyDelete