I'm trying to create Arquillian unit test using http://arquillian.org/arquillian-cube extension where you can set a breakpoint on the server side.
I've created a project which executes a simple test successfully (all details are here):
https://github.com/scetix/arquillian-cube-wildfly-quickstart
Is there any way of automatically attaching IntelliJ IDEA debugger to Wildfly running in Docker container when the test starts?
Automatically, I don't think so. In case of the Docker example, from the point of view of the IDE that is considered a remote server.
So what you need to do is first of all start Wildfly with debug enabled (http://tools.jboss.org/blog/2015-03-17-debugging-an-externally-launched-wildfly.html) and expose the debugger port correctly (https://github.com/scetix/arquillian-cube-wildfly-quickstart/blob/master/src/test/resources/Dockerfile#L12). Put these lines into you Dockerfile:
# Expose JBoss/Wildfly management port
EXPOSE 9990
# Expose JBoss/Wildfly debug port
EXPOSE 8787
You also need to set the port binding for Docker Compose (https://github.com/scetix/arquillian-cube-wildfly-quickstart/blob/master/src/test/resources/docker-compose.yml#L5). Add port 8787 for the debugger to the YAML file (first number - 58787 here - may be any number you prefer):
ports:
- 58787:8787/tcp
And finally start IntelliJ as a remote debugger, setting the IP of the Docker host (localhost in case of native Docker, Docker Machine IP in case of Docker Machine).
You can see how to do this with IntelliJ: http://blog.trifork.com/2014/07/14/how-to-remotely-debug-application-running-on-tomcat-from-within-intellij-idea/. The example is for Tomcat; specify JBoss instead.
Related
I have a docker hub and a docker node up and running.I have also a docker container which includes my application up and running with the same set up as my pc. I get the following error.
[ConnectionException] Can't connect to Webdriver at http://ip:4444/wd/hub. Please make sure that Selenium Server or PhantomJS is running.
The IP is correct since I see there the selenium grid as it should be. Which might be the problem. When I get inside the container that i have in jenkins it runs my tests also.
Have you explicitly instructed the Hub Docker Container to expose it's internal port 4444 as 4444 externally?
Instructing a container to expose ports does not enforce the same port numbers to be used. So in your case, while internally it is running on 4444, externally it could be whatever port Docker thought was the best choice when it started.
How did you start your container? If via the docker cmd line, then did you use -P or -p 4444:4444? (Note the difference in case). -P simply exposes ports but no guarantee of number, where as -p allows you to map as you wish.
There are many ways to orchestrate Docker which may allow you to control this in a different way.
For example, if you used Docker Compose that has the potential to allow your containers to communicate via 4444 even if those are not the actually exposed ports. It achieves this through some clever networking but is very simple to set up and use.
I seem to be doing something wrong in my run configuration for IntelliJ. I cannot run the server on the port 9080 because another app has to use the port 9080 and it's not up to me what port that app uses. So please don't tell me to kill the app using the port 9080. This is not a duplicate of this
With the other app running I can start up the server via command line or using an external tool in IntelliJ however I cannot start it though a run configuration. My server requires the other app to be running locally to do local testing however I cannot debug the app due to this extremely annoying issue. IntelliJ is simply picking the port 9080 out of some configuration and checking that port all on its own and deciding to not try starting the server and then somehow at some point deciding to check the port which of course wont be available. Is there a setting that I'm missing or is there another way to handle this so that way I don't run into this issue?
In local deploy there is not an option to change the port number.
From #Andrey's comments the solution turned out to be the server.xml is all that IntelliJ checks and doesn't load the bootstrap.properties right off the get go. So if you are filling in the httpPort number via bootstrap.properties, server.env, or any dynamically loaded properties, IntelliJ will use the default 9080. The solution here was then to simply hardcode the httpPort in <httpEndpoint httpPort=9081 ... /> for local testing
I use Drone as CI tool. I have drone sever and drone agent which are docker containers. I connected Drone to my GitHub repository. And it works perfectly it responds for each pull and build docker container. I can see built container in output of command:
docker ps
In this container I have node server. It listens 3001 port. I want to expose this port. I want to do something like:
ports:
- 3001:3001
in docker-compose.yml file.
Is it possible to expose ports in .drone.yml file? If it is, how to do it?
You cannot use expose on Drone, because each test should be isolated to outer environment.
Are you about to run E2E test for web server build on node server?
If so, service section is available. http://docs.drone.io/services/
Currently I can use rsub with sublime to edit remotely but the container is a second layer of ssh that is only accessible from the host machine.
Just curious, how do you use your remote host machine if you even have no ssh running on it?
Regarding to your question, I think you need to install openssh-server directly inside the container and map container's 22 port to the host's custom port. Inside your container you'll have to run some initial process that will launch all the processes you need (like openssh-server).
Consider this comprehensive example of the use of supervisord inside Docker container.
I am attempting to deploy a simple exploded war application from idea 11.1.3 to a remote (same machine) JBoss 7.1.1. The War builds fine and starts to deploy, but I keep getting the following message on the attempted deploy:
Error running JBoss 7.1.1.Final: Unable to connect to the
localhost:8080
I am using Intellij's default JBoss 7 Remote configuration, which I've used successfully in the past. I can hit localhost:8080 directly with any browser so I know its responding. Ideas?
I've encountered with the same problem and found solution. May be this problem appeared because I've just switched from Eclipse. So I think someone it can be helpful.
For correct debugging JBoss remotely we need to specify 3 ports:
1) http port ('Port' field of the 'Remote Connection Settings' section) is used to ping JBoss server (periodical checking if the
server is alive) and to produce urls addressing resources on the server - FIRST TAB
2) native management port ('Management port' field of the 'JBoss Server Settings' section) is used to connect to the JBoss management
interface, to check for the server startup to be finished and to deploy artifacts - FIRST TAB
3) remote socket port - by default on JBoss it 8787 - LAST TAB
After this all will work fine.
I was little bit confusing because if I run JBoss under sudo – remote debug worked just fine.