I'm moving an old cocoon 2.1 installation from CentOS 7 to Amazon Linux 2, and getting a an "Address already in use" error on Amazon Linux.
To isolate the problem, I initialized two AWS EC2 instances from the latest CentOS7 and Amazon Linux images. They have the same apache-tomcat-8.5.56, installed in the same place on each server, with the same application in /opt/tomcat/munch5/webapps/cocoon.war. Both servers are configured with hsqldb on port 9002. (Changing the port hasn't helped.) /opt/tomcat/munch5/webapps/cocoon/WEB-INF/cocoon.xconf <hsqldb-server class="org.apache.cocoon.components.hsqldb.ServerImpl" logger="core.hsqldb-server" pool-max="1" pool-min="1"> <parameter name="port" value="9002"/> <parameter name="silent" value="true"/> <parameter name="trace" value="trace"/> </hsqldb-server> Do you think that something is trying to start for a second time, when it is already running? Both servers start OK, and seem to be listening on reasonable ports: # netstat -an | grep LISTEN | sort | more tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN tcp 0 0 0.0.0.0:942 0.0.0.0:* LISTEN tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN tcp6 0 0 127.0.0.1:8030 :::* LISTEN tcp6 0 0 :::111 :::* LISTEN tcp6 0 0 :::22 :::* LISTEN tcp6 0 0 :::8080 :::* LISTEN tcp6 0 0 :::8888 :::* LISTEN tcp6 0 0 :::9002 :::* LISTEN ... but when I make my first request (http://10.104.48.33:8080/cocoon/MasticatorLog), I get this error in the logs on Amazon Linux: 10.104.48.33:/opt/tomcat/munch5/logs/catalina.out (Amazon Linux) 30-Sep-2020 21:44:30.544 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 5942 ms Wed Sep 30 21:44:33 EDT 2020 Listening for connections ... - No configuration file specified, going with the default configuration - The database configuration file is not specified and there was no xindice.db.home property set, so Xindice was unable to determine a database location. Database will be created relative to the current directory. server.properties not found, using command line or default properties Opening database: /opt/apache-tomcat-8.5.56/munch5/webapps/cocoon/WEB-INF/db/cocoondb HSQLDB server 1.7.1 is running Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly Server.run/init: java.net.BindException: Address already in use (Bind failed) java.net.BindException: Address already in use (Bind failed) at java.net.PlainSocketImpl.socketBind(Native Method) at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387) at java.net.ServerSocket.bind(ServerSocket.java:390) at java.net.ServerSocket.<init>(ServerSocket.java:252) at java.net.ServerSocket.<init>(ServerSocket.java:143) at org.hsqldb.Server.run(Unknown Source) at org.hsqldb.Server.main(Unknown Source) at org.apache.cocoon.components.hsqldb.ServerImpl.run(ServerImpl.java:199) at java.lang.Thread.run(Thread.java:748) The installation on CentOS 7 works: 10.104.48.34:/opt/tomcat/munch5/logs/catalina.out (CentOS 7) - No configuration file specified, going with the default configuration - The database configuration file is not specified and there was no xindice.db.home property set, so Xindice was unable to determine a database location. Database will be created relative to the current directory. - Database points to /opt/apache-tomcat-8.5.56/munch5/db - No configuration file specified, going with the default configuration - The database configuration file is not specified and there was no xindice.db.home property set, so Xindice was unable to determine a database location. Database will be created relative to the current directory. server.properties not found, using command line or default properties Opening database: /opt/apache-tomcat-8.5.56/munch5/webapps/cocoon/WEB-INF/db/cocoondb HSQLDB server 1.7.1 is running Use SHUTDOWN to close normally. Use [Ctrl]+[C] to abort abruptly Wed Sep 30 22:02:36 EDT 2020 Listening for connections ... context: /opt/apache-tomcat-8.5.56/munch5/webapps/cocoon/ - Quartz scheduler 'Cocoon - Quartz scheduler version: 1.2.3 - Scheduler Cocoon_$_Wed_Sep_30_22:02:37_EDT_2020 started. WARN! *** JMS block is installed but jms client library not found. *** - For the jms block to work you must install and start a JMS server and place the client jar in WEB-INF/lib. - The default server, OpenJMS is configured in cocoon.xconf but is not bundled with Cocoon. 30-Sep-2020 22:02:37.475 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/opt/apache-tomcat-8.5.56/munch5/webapps/cocoon.war] has finished in [6,240] ms