Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when JBoss starts: address already in use

I have a problem when I want to start my JBoss server. I'm working on Netbeans and I added my server with Server > Add Server > JBoss Application Server.

I configured my server with the port 8181 because the port 8080 is already in use. But when I start it, it fails because it's trying to connect to the port 8080:

10:10:48,071 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.web.connector.http: org.jboss.msc.service.StartException in service jboss.web.connector.http: JBAS018007:

Error starting web connector at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:271) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79] at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]

Caused by: LifecycleException: L'initialisation du gestionnaire de protocole a échoué: java.net.BindException: Address already in use: JVM_Bind /127.0.0.1:8080 at org.apache.catalina.connector.Connector.init(Connector.java:985) at org.jboss.as.web.WebConnectorService.start(WebConnectorService.java:267) ... 5 more

I'm using JDK 1.7. My environnment variables are well configured: JAVA_HOME = path/to/jdk1.7. And in Netbeans, in the properties of the server, my Java Platform is JDK 1.7.

Here is the beginning of the log to check the values:

Calling "C:\Server\jboss-as-7.1.0.Final\bin\standalone.conf.bat" "JAVA_OPTS already set in environment; overriding default settings

with values: -Xms128m -Xmx512m -XX:MaxPermSize=256m"

JBoss Bootstrap Environment

JBOSS_HOME: C:\Server\jboss-as-7.1.0.Final

JAVA: C:\Program Files\Java\jdk1.7.0_79\bin\java

JAVA_OPTS: -XX:+TieredCompilation -Dprogram.name=standalone.bat -Xms128m -Xmx512m -XX:MaxPermSize=256m

Thanks in advance for your help !

like image 409
Erlaunis Avatar asked Jan 26 '16 09:01

Erlaunis


2 Answers

Check your standalone.xml in directory $JBOSS_HOME$/standalone/configuration and check the element

<socket-binding name="http" port="XXXX"/>

Does XXXX equal 8181 or 8080? I'm betting it's 8080. Change it to 8181 and restart JBoss.

like image 180
TT. Avatar answered Oct 05 '22 20:10

TT.


If you are not sure which process is blocking your port (if you deploy your application to an unknown server this happens from time to time) you really want to have a look at the netstat.exe tool (part of windows):

cmd -> "netstat -o"

This will show you each port in use with the Pid (Process ID) using it. With this ID you can see in the taskmanager which Process is blocking your port.

Netstat also has some other handy options.

like image 31
Rainer Avatar answered Oct 05 '22 19:10

Rainer