2

在全新安装 CruiseControl 时,每次启动 CruiseControl 时,都会抛出以下两个异常:

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)

在这些之前和之后,似乎(显然)没有任何问题。结果,我无法查看 CruiseControl 的 Web 仪表板。关于这里出了什么问题的任何想法?


完整的堆栈跟踪:

[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
4

3 回答 3

1

在 CC 启动时,您是否有任何 Java 程序仍在运行?

该线程所示:

我注意到当我重新启动 Cruisecontrol 时,我需要终止所有剩余的 Java 程序,否则会发生端口类错误。解决方案是:

  • 停止巡航控制
  • 杀死所有剩余的 cvs 和 java 程序。
  • 等待 30 秒。
  • 启动巡航控制。

OP bguiz在评论中添加了他自己的食谱:

  • 停止巡航控制
  • 杀死所有剩余的 cvs 和 java 程序。
  • 重启电脑,
  • sc 删除 CruiseControl,
  • 包装器-i wrapper.conf。
  • 启动巡航控制
于 2010-02-25T07:07:11.740 回答
0

看起来您只是在您的机器上运行了另一个应用程序服务器,它使用与巡航控制服务器相同的端口。您是否在新服务器上部署 Cruise Control?它是什么服务器?

尝试停止机器上的所有服务器并尝试再次启动巡航控制。

于 2010-02-25T07:04:31.637 回答
0

如果您使用 Windows 服务包装器来启动 CruiseControl,则 RMI 端口默认设置为 1099。您可以通过编辑 CruiseControl 安装目录中的 wrapper.conf 文件来更改此端口。您可能希望在命令提示符下运行“netstat”以列出系统当前正在使用的所有端口。然后选择一个不与任何其他服务器或进程冲突的服务器。杀死所有其他进程并不总是一种选择。

于 2011-04-28T12:53:18.723 回答