java.net.BindException: Address already in use (Bind failed)

Tags: #<Tag:0x00007f61705174e8> #<Tag:0x00007f6170517358>

Hi,

i updated to OpenHAB 2.5.5 and now it seems to work but the persistence not. I’ve got this errors in log:

2020-06-01 14:30:43.030 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model ‘mysql.persist’
2020-06-01 14:30:47.201 [ERROR] [thome.model.lsp.internal.ModelServer] - Error starting the Language Server
java.net.BindException: Die Adresse wird bereits verwendet (Bind failed)

I don’t understand. Could anyone help me please?

Best regards
Chris

This normally means that the port is already in use by (another) software.
Logon to the openhab server and execute

sudo lsof -i :5007

or

sudo netstat -tulpe | grep 5007

Was fange ich damit an?
sudo lsof -i :5007

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
java 1828 root 53u IPv6 36663 0t0 TCP *:5007 (LISTEN)

sudo netstat -tulpe | grep 5007 :
tcp6 0 0 [::]:5007 [::]:* LISTEN root 36663 1828/java

I was thinking of that port 5007 is used by another program - but the output of the commands show that port 5007 is used by java - which is most probably openhab itself.
You can check that by checking what’s behind the curent related PID ( 1828 in this case ).
So unfortunately this does not really help.

Is it possible that openHAB runs twice? I got a different output of the same Dashboard in HABPanel on Smartphone as on Laptop.

What is the difference in the output that you get ?
You can check if there are two instances running by running the command

ps -ef | grep openhab

this should return one row containing /usr/bin/java.
As openhab uses specific ports that the software starts in listen mode it cannot be possible that there is more than one instance listening on the same port.

I get two rows but only one with the content you described. Did you have any other idea?

Thank you.

Do you mind to share a screencopy of the dashboard output on smartphone and laptop ?
There might be other reasons for the difference. Is it just the layout ? Nowadays so called responsive web design is being used to control the layout depending on the size of the display.
See wikipedia ( https://en.wikipedia.org/wiki/Responsive_web_design, https://de.wikipedia.org/wiki/Responsive_Webdesign ).
As I do not use HABPanel I haven’t checked yet if that is the case.

I make a big mistake and load a local copy of HABPanel on this devices. Now i’ve changed the port of language server to 50007 but it takes no effect.

what does this mean ? It’s still listening on the original port or is it listening on the new port number but you still get the same error message ?

Sorry. I try to describe better next time. It is listening on the new port number but i still get the same error messages.

what do you mean by:

You can choose wich HABPanel is loaded on every device. In the smartphoneapp a local copy was loaded instead of the layout wich located on the server. That was the reason why changes on dashboard takes no effect.

I couldn’t reply good news. It doesn’t work. I hope anyone could help. This Problem is the reason why my persistence doesn’t run too.