1

Hello im installing a fresh Jboss 5.1 in a Centos 5.5 machine. I dont have Apache installed. So when I try to start jboss using the comand ./run.sh I get the following error

15:13:57,414 INFO  [JMXKernel] Legacy JMX core initialized
15:14:03,856 ERROR [ServerInfo] Error looking up local address
java.net.UnknownHostException: dhcppc1: dhcppc1
    at java.net.InetAddress.getLocalHost(InetAddress.java:1354)
    at org.jboss.system.server.ServerInfo.getHostAddress(ServerInfo.java:364)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   ....

After that i can run Jboss only from 127.0.0.1:8080 but using localhost:8080 doesnt work. I think its a centos configuration problem but im a total newbye managing ports and maybe firewalls, so what do you think could be the problem?

Jeeba
  • 13
  • 1
  • 4

2 Answers2

2

You can check your /etc/hosts file, there you should find such lines:

127.0.0.1       localhost localhost.localdomain
::1             localhost6 localhost6.localdomain6

These lines are used to resolv your localhost name.

Lukasz Stelmach
  • 314
  • 2
  • 8
  • I have the first line like 127.0.0.1 localhost, what does the second line mean? I will try this answer anyway – Jeeba Feb 16 '11 at 15:04
  • The second line is useful when you use IPv6 – Lukasz Stelmach Feb 16 '11 at 15:41
  • ok so i tried your answer and I still have the same problem. Maybe its something to do whit this java.net.UnknownHostException: dhcppc1: dhcppc1 – Jeeba Feb 17 '11 at 16:01
  • 1
    You can try to add IP address of `dhcppc1` server to `/etc/hosts' file. It should allow you resolve that name and you will be know if the problems is with name resolution. Mayby you can post informatio how you start JBoss (mayby you put some more options in `run.sh` script)? Did you change anything in the JBoss config files? – Lukasz Stelmach Feb 19 '11 at 00:54
  • Yes that was the answer. I add dhcppc1 as an Alias in the /etc/hosts file and it worked again. Thanks – Jeeba Mar 04 '11 at 20:52
0

I think that your JBoss is configure to listen on localhost interface only. This is a very good this from security point of view and you should expose the JBoss server from apache web server using a tomcat connector.

If you want to listen to all addresses you have to change the listaning address by editing server.xml file and changing address=127.0.0.1 to address=0.0.0.0

Mircea Vutcovici
  • 16,706
  • 4
  • 52
  • 80
  • Hi, thanks for the answer, The machine that is running this Jboss servers as an public ip, when I run it so everyone else (connected to internet I mean) can see it, I use the ./runn.sh -b 0.0.0.0 command, does this is the same as changing the server.xml? – Jeeba Feb 16 '11 at 15:03
  • It is ok. The option `-b 0.0.0.0` will tell to JBoss to bind on all interfaces. Check the firewall: `iptables -L -n`. You have to open port TCP/8080 – Mircea Vutcovici Feb 16 '11 at 19:23