Search code examples
javaofbiz

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


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

[email protected] [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
[email protected] [erp]#

Solution

  • 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.