Error when JBoss starts: address already in use
Asked Answered
P

5

5

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 !

Playhouse answered 26/1, 2016 at 9:25 Comment(1)
"I configured my server with the port 8181" => how?Isometric
P
6

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.

Pyrophyllite answered 26/1, 2016 at 9:33 Comment(4)
Thanks, I did. But I still have an error : Address already in use: bind. Do you think there is an other variable to change ?Playhouse
And when I check with netstat, there is no port 8181 in use :/Playhouse
Well, when I go to localhost:8181, I don't have any error. But in the log, I still have those exception. And when I do a netstat, the port 8181 is used. So I assume that it's working.Playhouse
It happens that JVM still has a running instance. Have you tried to kill all running JVM instances before starting JBoss? You may have started the JBoss instance before (in another console).Ranson
G
5

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.

Global answered 26/1, 2016 at 9:44 Comment(2)
Thanks but I know that the port is already used by my Tomcat. And when I try to start with an other port (like @Pyrophyllite said), the port 8181 (that I choose) isn't in the list of "netstat".Playhouse
@TT thanks for editing... this all lower case is always a pain for germans ;-)Global
T
0

Check your standalone.xml: And check two ports:
<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}"> & <socket-binding name="http" port="9090"/>

Offset should be 0 if you have set your http port on 9090.

Trusting answered 27/2, 2018 at 18:53 Comment(0)
I
0

for me I have changed in intellij File -> Settings -> Debugger ( Built-in Server) port to something else (other than 8080) as shown in the

Screenshot

Idyllist answered 5/2, 2020 at 7:35 Comment(0)
W
0

Run this in command prompt to check if there is a task running:

netstat -ano | findstr {your_port}

If there is, you will be able to see task id, and then run the following ro remove the task running:

taskkill /F /pid {task_id}

If you see nothing as output, that means that there is nothing running, and it should work.

Hope this helps.

Waxwing answered 16/10, 2023 at 3:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.