WebApp will not load - Failed to bind to server socket: nio://127.0.0.1:34455 due to: java.net.BindException: Address already in use

book

Article ID: 142588

calendar_today

Updated On:

Products

CA Spectrum

Issue/Introduction

The One-Click WebApp does not load.  It stays at the "Loading icon". Attempting to
  stop/restart the webtomcat does not correct this.

The following errors were seen in the $SPECROOT/webtomcat/bin/webswing.log

------------------------------------------
2020-01-06 08:50:46,021 ERROR [main] (JmsServiceImpl.java:31) Failed to start JMS service.
java.io.IOException: Failed to bind to server socket: nio://127.0.0.1:34455 due to: java.net.BindException: Address already in use
 at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:34)
 at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:144)
 at org.apache.activemq.transport.tcp.TcpTransportFactory.doBind(TcpTransportFactory.java:62)
 at org.apache.activemq.transport.TransportFactorySupport.bind(TransportFactorySupport.java:40)
 at org.apache.activemq.broker.BrokerService.createTransportConnector(BrokerService.java:2520)
 at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:339)
 at org.apache.activemq.broker.BrokerService.addConnector(BrokerService.java:329)
 at org.webswing.server.services.jms.JmsServiceImpl.startService(JmsServiceImpl.java:71)
 at org.webswing.server.services.jms.JmsServiceImpl.start(JmsServiceImpl.java:29)
 at org.webswing.server.services.startup.StartupServiceImpl.start(StartupServiceImpl.java:34)
 at org.webswing.server.WebswingServlet.init(WebswingServlet.java:53)
~
~
Caused by: java.net.BindException: Address already in use
 at sun.nio.ch.Net.bind0(Native Method)
 at sun.nio.ch.Net.bind(Net.java:433)
 at sun.nio.ch.Net.bind(Net.java:425)
 at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
 at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
 at org.apache.activemq.transport.nio.NIOTransportFactory$2.createServerSocket(NIOTransportFactory.java:83)
 at org.apache.activemq.transport.tcp.TcpTransportServer.bind(TcpTransportServer.java:141)

 

Cause

For reasons unknown, there were multiple webtomcat processes running on the system. This also causes
   issues with the JMS port WebSwing uses as the default port 34455 is in use.

 

[[email protected] ~]# ps -ef | grep 20038

caadmin   4706 20038  0 04:32 ?        00:01:39 /ca/spectrum/Java/jre/bin/java -Xbootclasspath/a:/ca/spectrum/webtomcat/bin/../webswing/tmp/release/WEB-INF_swing-boot_webswing-api-2.6-SNAPSHOT.jar:/ca/spectrum/webtomcat/bin/../webswing/tmp/release/WEB-INF_swing-boot_webswing-app-toolkit-java8-2.~~~~~

caadmin   5149 20038  0 04:36 ?        00:01:37 /ca/spectrum/Java/jre/bin/java -Xbootclasspath/a:/ca/spectrum/webtomcat/bin/../webswing/tmp/release/WEB-INF_swing-boot_webswing-api-2.6-SNAPSHOT.jar:/ca/spectrum/webtomcat/bin/../webswing/tmp/release/WEB-INF_swing-boot_webswing-app-toolkit-java8-2.~~~~~

caadmin  11343 20038  0 05:42 ?        00:01:28 /ca/spectrum/Java/jre/bin/java -Xbootclasspath/a:/ca/spectrum/webtomcat/bin/../webswing/tmp/release/WEB-INF_swing-boot_webswing-api-2.6-SNAPSHOT.jar:/ca/spectrum/webtomcat/bin/../webswing/tmp/release/WEB-INF_swing-boot_webswing-app-toolkit-java8-~~~~~~

caadmin  20038 20022  0  2019 ?        16:04:00 /ca/spectrum/Java/bin/java -Djava.util.logging.config.file=/ca/spectrum/webtomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webr~~~~~~~

caadmin  26911 20038  1 03:12 ?        00:08:40 /ca/spectrum/Java/jre/bin/java -Xbootclasspath/a:/ca/spectrum/webtomcat/bin/../webswing/tmp/release/WEB-INF_swing-boot_webswing-api-2.6-SNAPSHOT.jar:/ca/spectrum/webtomcat/bin/../webswing/tmp/release/WEB-INF_swing-boot_webswing-app-toolkit-java8-~~~~~~

caadmin  29002 20038  0 08:46 ?        00:00:52 /ca/spectrum/Java/jre/bin/java -Xbootclasspath/a:/ca/spectrum/webtomcat/bin/../webswing/tmp/release/WEB-INF_swing-boot_webswing-api-2.6-SNAPSHOT.jar:/ca/spectrum/webtomcat/bin/../webswing/tmp/release/WEB-INF_swing-boot_webswing-app-toolkit-java8-~~~~~

 

 

Environment

Spectrum 10.3.2
RedHat 7.x

Resolution

 

  • Kill all the java processes associated with the JMS port 34455
        netstat -anp | grep 34455
        kill -9 <java pid(s)>
       
  • restart webtomcat as the spectrum owner
      cd $SPECROOT/webtomcat.bin
      ./startWebTomcat.sh

Additional Information

 

Webswing uses JMS internally to send/receive events to/from the Application Sessions. The following 
  parameter can be added to the webtomcat to change the JMS port used by Web Swing

-Dwebswing.jmsUrl=nio://127.0.0.1:34456

Reference: https://www.webswing.org/docs/20.1/faq/jvm_port.html

 

Attachments