Error when starting Apache OFBiz: "java.net.BindException: Address already in use"

StackOverflow https://stackoverflow.com/questions/21502819

  •  05-10-2022
  •  | 
  •  

Question

I get the following error when running the "ant start" command on my LAMP server. It worked just fine when using the default derby database BUT I did have to change the HTTP and HTTPS ports (they were in use) in the following files: framework/base/config/ofbiz-containers.xml framework/webapps/config/urlproperties

So now that I'm trying to use PostgreSQL I'm getting the following error when trying to start Ofbiz. My best guess is that I also have to change the port for the PostgreSQL JDBC connector too? Where can I do that, or what am I missing?

//START TERMINAL OUTPUT

root@server.domain.com [erp]# ./ant start
Buildfile: /home/username/public_html/erp/build.xml

start:
     [java] Start.java using configuration file org/ofbiz/base/start/start.properties
     [java] Set OFBIZ_HOME to - /home/username/public_html/erp
     [java] Exception in thread "main" org.ofbiz.base.start.StartupException: Couldn't create server socket(/127.0.0.1:10523)
     [java]     at org.ofbiz.base.start.Start$AdminPortThread.<init>(Start.java:405)
     [java]     at org.ofbiz.base.start.Start.createListenerThread(Start.java:163)
     [java]     at org.ofbiz.base.start.Start.init(Start.java:222)
     [java]     at org.ofbiz.base.start.Start.main(Start.java:131)
     [java] Caused by: java.net.BindException: Address already in use
     [java]     at java.net.PlainSocketImpl.socketBind(Native Method)
     [java]     at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
     [java]     at java.net.ServerSocket.bind(ServerSocket.java:376)
     [java]     at java.net.ServerSocket.<init>(ServerSocket.java:237)
     [java]     at org.ofbiz.base.start.Start$AdminPortThread.<init>(Start.java:403)
     [java]     ... 3 more
     [java] Java Result: 1

BUILD SUCCESSFUL
Total time: 2 seconds
root@server.domain.com [erp]#
Was it helpful?

Solution 2

Followed the instructions under "URL and Port Settings" using the official Apache OFBiz Technical Production Setup Guide ended up changing every single file I could find that referenced these ports and got it working that way.

OTHER TIPS

The files you have changed are only for the embedded tomcat instance and the error is telling you that the new port you chose is used by another process.

If you want to change the database port number you can do it in this file: framework/entity/config/entityengine.xml

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top