Please be aware that there is newer version of documentation available for Webswing. Documentation 24.2
JMS Address already in use
Expected Behavior
Webswing starts
Actual Behavior
Webswing does not start and following (or similar) exception (editors cut) is thrown:
07:50:23,479 ERROR [main] (WebswingServlet.java:48) Initialization of Webswing failed.
org.webswing.server.model.exception.WsInitException: Failed to start JMS service.
at org.webswing.server.services.jms.JmsServiceImpl.start(JmsServiceImpl.java:32)
Caused by: 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)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind0(Native Method)
Solution
Run netstat to double check that the port is really in use:
C:\webswing-2.6.6>netstat -a
Active Connections
Proto Local Address Foreign Address State
TCP 0.0.0.0:135 DESKTOP-TABE181:0 LISTENING
TCP 0.0.0.0:445 DESKTOP-TABE181:0 LISTENING
TCP 0.0.0.0:2179 DESKTOP-TABE181:0 LISTENING
TCP 127.0.0.1:34455 DESKTOP-TABE181:0 LISTENING
TCP 127.0.0.1:49720 DESKTOP-TABE181:0 LISTENING
If the Webswing was working before then there is a Webswing process still bound to that address. Find it and shut it down. In case the port needs to be available for a different application or you want to run 2 Webswing processes on the same OS, use following system property to override the default port.
-Dwebswing.jmsUrl=nio://127.0.0.1:34456 while starting your second server.
Explanation
Webswing uses JMS internally to send/receive events to/from the Application Sessions.