The best place to *find* answers to programming/development questions, imo, however it's the *worst* place to *ask* questions (if your first question/comment doesn't get any up-rating/response, then u can't ask anymore questions--ridiculously unrealistic), but again, a great reference for *finding* answers.

My Music (Nickleus)

20131211

[SOLVED] starting sahi dashboard gives "java.net.BindException: Address already in use"

i tried starting the sahi dashboard to run a script:
cd ~/workspaceEclipse/tcTrunk/testing/sahi/userdata/bin
./start_dashboard.sh ~/workspaceEclipse/tcTrunk/testing

but got the following error message:
java.net.BindException: Address already in use
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.AbstractPlainSocketImpl.bind(Unknown Source)
    at java.net.ServerSocket.bind(Unknown Source)
    at net.sf.sahi.Proxy.startProxy(Proxy.java:162)
    at net.sf.sahi.Proxy.access$000(Proxy.java:57)
    at net.sf.sahi.Proxy$1.run(Proxy.java:126)
    at java.lang.Thread.run(Unknown Source)


SOLUTION

i stopped my local jboss 7 server that was running in debug mode, and then i was able to open the sahi dashboard.

THE REASON

normally when you start sahi it tells you that it uses port 9999.

looking at the jboss console startup output, i could see that the reason sahi wasn't starting up was because port 9999 was already in use:

[org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on 127.0.0.1:9999
...
[com.myapp.utils.ContextFactorySingleton] (ServerService Thread Pool -- 70) ContextFactorySingleton initialized with the following values:
localserver = true
initialContextFactory = org.jnp.interfaces.NamingContextFactory
providerUrl = jnp://localhost:9999



UPDATE 20140310

so, in order to test on your local jboss 7 version in debug mode, using sahi, you need to change the conflicting port, 9999, here:

jboss-eap-6.1/standalone/configuration/takecargoconfiguration.xml (or standalone.xml, if you're using the default configuration file):

<socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
    <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:8888}"/>
    ...
</socket-binding-group>



Here, i've changed 9999 to 8888.


No comments:

Post a Comment