0
votes

I'm running an app inside a docker container and the host in server.xml of the JBoss-4.2 server is "localhost".
This command

curl -v localhost:8090/ 

establishes a connection but return "HTTP/1.1 400 No Host matches server name localhost" and

cat /etc/hosts 

gives

127.0.0.1 localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
172.17.0.2 5f6b9e76d025
127.0.0.1 endpoint.used.bytheapp

Any suggestions ?

1
It looks like you showed the /etc/hosts of your container. Though, the curl command, provided you performed it from your host, will be looking from localhost within the host's /etc/hosts. Does localhost exist in it?Marvin
@Marvin the curl was launched from inside the containerloser8
Then where does the 8090 come from? 8080 is the default port of JBOSS. Can you provide your Dockerfile and/or jboss conf as well? This would be easier to understand. Also, does the "curl 127.0.0.1:8090" work on your host?Marvin

1 Answers

0
votes

The case here was about connecting to the server runnning inside a docker container whith that server being a JBoss-4.2.2.GA.
This is somehow considered a remote connection.For the case of JBoss-4.2.0.GA and later, the problem is solved by running the server with -b 0.0.0.0.

Reference about the option that must be added : https://developer.jboss.org/wiki/JBoss42FAQ