I believe that your problem relates to not having a valid local hostname for the server socket to bind to. For instance, when I created my Linux server (RedHat 8.0), it put "localhost.localdomain" in the hosts file. In the meantime, I gave the server a different name, so that name was no longer valid, and thus the problem occured.
It appears that different versions of the JVM cause different things to happen. 1.4.1_01 is known to cause JBoss to hang, and 1.4.1_03 will cause a BindException to occur (what I saw).
Correcting the hosts file should solve the problem (it did for me).
Also, check out this thread (where I got a lot of info):
Im getting the same problem with JBoss 3.0.6 and Netbeans 3.4.1.
Iv set jboss up to run within netbeans. When ever I try and execute jboss as an externel execution within netbeans I get the following error :
12:20:20,702 INFO [MainDeployer] Starting deployment of package: file:/C:/devenv/jboss-3.0.6/server/eca/conf/jboss-service.xml
12:20:21,905 ERROR [WebService] Failed to get localhost name
Iv read about this error and have tried to change my hosts file so localhost points to the ip address of the machine, with no luck.
The weird thing is that jboss runs fine in a command window.
Im using windows XP..
Look forward to your replies,
The problem may be that the external environment that NetBeans gives you disrupts access to the underlying operating system hooks for networking - a bit strange but I guess, possible. What you might try as an experiment is writing a small program to access Host information using java.net.* methods and try running that from within NetBeans. This is not necessarily surefire proof but it gets some way to understanding what is going on. JBoss is a bit more complex with several layers of classloaders but it is a start.
Many of the strange problems I had when I started JBOSS on linux were linked to the fact that I did not have a FQDN ( Fully qualified Domain Name ) in my /etc/hosts file. Why is is an issue would be a really long post so I will leave it out. If you really want to know email me at firstname.lastname@example.org.
Add a line in the /etc/hosts file like
myServer myServer.YourDomain ###.###.###.###
where ###.###.###.### is the IP of your machine via DHCP or given static ip from your network people.
Note: If it is DHCP this may change everytime you boot the machine.
If this is going to be a full time server you should have your SysAdmin give you a static IP and have them put it in your DNS server. and change your /etc/hosts file accordingly.
I hope this fixes your problem as it did mine. I spent about two or three hours before I stumbled onto this. :)
Typo on the format of the /etc/hosts file.
The line should be in the format.
###.###.###.### myServer.myDomain myServer
Make sure you have a valid hostname to bind to. The call to getHostName() blocks while waiting for the response. So jb startup hanging while creating the Webservice because of this call.