views:

391

answers:

2

On a fresh installation of CruiseControl, every single time I start CruiseControl, I get the following two exceptions thrown:

ontrollerAgent- Exception starting httpAdaptor
java.net.BindException: Address already in use: JVM_Bind
        at java.net.PlainSocketImpl.socketBind(Native Method)

ontrollerAgent- Exception starting connectorServer
java.io.IOException: Cannot bind to URL [jrmp]: javax.naming.NameAlreadyBoundException: jrmp [Root exception is java.rmi.AlreadyBoundException: jrmp]
        at javax.management.remote.rmi.RMIConnectorServer.newIOException(Unknown Source)

Before and after these nothing seems to (obviously) go wrong. And as a result, I cannot view the web dashboard of CruiseControl. Any ideas on what is going wrong here?


Full stack traces:

[cc]Feb-25 16:33:49 ontrollerAgent- Starting HttpAdaptor with CC-Stylesheets
[cc]Feb-25 16:33:49 ontrollerAgent- starting httpAdaptor
[cc]Feb-25 16:33:49 ontrollerAgent- Exception starting httpAdaptor
java.net.BindException: Address already in use: JVM_Bind
        at java.net.PlainSocketImpl.socketBind(Native Method)
        at java.net.PlainSocketImpl.bind(Unknown Source)
        at java.net.ServerSocket.bind(Unknown Source)
        at java.net.ServerSocket.<init>(Unknown Source)
        at mx4j.tools.adaptor.PlainAdaptorServerSocketFactory.createServerSocket (PlainAdaptorServerSocketFactory.java:24)
        at mx4j.tools.adaptor.http.HttpAdaptor.createServerSocket(HttpAdaptor.java:672)
        at mx4j.tools.adaptor.http.HttpAdaptor.start(HttpAdaptor.java:478)
        at net.sourceforge.cruisecontrol.jmx.CruiseControlControllerAgent.start(CruiseControlControllerAgent.java:172)
        [truncated]

[cc]Feb-25 16:33:49 ontrollerAgent- starting rmiRegistry
[cc]Feb-25 16:33:49 ontrollerAgent- Port 1099 is already in use, so no new rmiRe
gistry is started
[cc]Feb-25 16:33:49 ontrollerAgent- starting connectorServer
[cc]Feb-25 16:33:50 ontrollerAgent- Exception starting connectorServer
java.io.IOException: Cannot bind to URL [jrmp]: javax.naming.NameAlreadyBoundException: jrmp [Root exception is java.rmi.AlreadyBoundException: jrmp]
        at javax.management.remote.rmi.RMIConnectorServer.newIOException(Unknown Source)
        at javax.management.remote.rmi.RMIConnectorServer.start(Unknown Source)
        at net.sourceforge.cruisecontrol.jmx.CruiseControlControllerAgent.start(CruiseControlControllerAgent.java:190)
        at net.sourceforge.cruisecontrol.Main.startJmxAgent(Main.java:137)
        at net.sourceforge.cruisecontrol.Main.start(Main.java:115)
        at net.sourceforge.cruisecontrol.launch.Launcher.run(Launcher.java:259)
        at net.sourceforge.cruisecontrol.launch.Launcher.main(Launcher.java:117)

Caused by: javax.naming.NameAlreadyBoundException: jrmp [Root exception is java.
rmi.AlreadyBoundException: jrmp]
        at com.sun.jndi.rmi.registry.RegistryContext.bind(Unknown Source)
        at com.sun.jndi.rmi.registry.RegistryContext.bind(Unknown Source)
        at javax.naming.InitialContext.bind(Unknown Source)
        at javax.management.remote.rmi.RMIConnectorServer.bind(Unknown Source)
        ... 6 more
Caused by: java.rmi.AlreadyBoundException: jrmp
        at sun.rmi.registry.RegistryImpl.bind(Unknown Source)
        at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
        at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
        at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
        at sun.rmi.transport.Transport$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        [truncated]
2010-02-25 16:33:50.710::INFO:  Logging to STDERR via org.mortbay.log.StdErrLog
2010-02-25 16:33:50.850::INFO:  jetty-6.1.11
2010-02-25 16:33:51.161:/dashboard:INFO:  Initializing Spring root WebApplicationContext
A: 

It looks like you just have another application server running on your machine that uses the same ports as your cruise control server. Do you deploy Cruise Control on a new server? What server is it?

Try to stop all the servers on your machine and try to launch cruise control again.

Awano
@Awano, thanks for the answer! I know that what it looks like from the error message, but this was a fresh install of Win XP, and I am 100% positive no other software was utilising any of the ports, so it had to be something else.
bguiz
+1  A: 

Do you have any Java program still running at the time of CC starting?

As illustrated in this thread:

I've noticed when I restart cruisecontrol I need to kill any remaining java programs or a port class error will occur. The solution is to:

  • Stop cruisecontrol
  • Kill any remaining cvs and java programs.
  • Wait 30 seconds.
  • Start cruisecontrol.

The OP bguiz adds in the comments his own recipe:

  • Stop CruiseControl
  • Kill any remaining cvs and java programs.
  • Restart computer,
  • sc delete CruiseControl,
  • wrapper -i wrapper.conf.
  • Start CruiseControl
VonC
Thanks @VonC! Not quite the answer, but was on the right track --> basically replace `Wait 30 seconds.` with: [Restart computer, `sc delete CruiseControl`, `wrapper -i wrapper.conf`] and that worked for me.
bguiz
@bguiz: thank you for the feedback. I have included it in the answer.
VonC