Jenkins 构建作业给出错误 - java.net.BindException:地址已在使用中:JVM_Bind
我正在尝试在本地工作区中构建简单的 Jenkins 构建作业。我已经构建了简单的 mvc gradle 应用程序。 Jenkins 构建作业已使用所需的 Gradel 任务进行设置,但 jmx 出现以下错误
Running as SYSTEM
Building in workspace C:\Users\harshal\.jenkins\workspace\MVCApp
The recommended git tool is: NONE
No credentials specified
> git.exe rev-parse --resolve-git-dir C:\Users\harshal\.jenkins\workspace\MVCApp\.git # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url https://github.com/harshalpatil2012/HelloWorld-MVC-App.git # timeout=10
Fetching upstream changes from https://github.com/harshalpatil2012/HelloWorld-MVC-App.git
> git.exe --version # timeout=10
> git --version # 'git version 2.9.0.windows.1'
> git.exe fetch --tags --progress -- https://github.com/harshalpatil2012/HelloWorld-MVC-App.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
Checking out Revision a7cf612bd16cc92d5e56137284de5318ce9beec2 (refs/remotes/origin/master)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f a7cf612bd16cc92d5e56137284de5318ce9beec2 # timeout=10
Commit message: "spring gradle demo app"
> git.exe rev-list --no-walk a7cf612bd16cc92d5e56137284de5318ce9beec2 # timeout=10
[MVCApp] $ C:\Windows\system32\cmd.exe -xe C:\Softwares\apache-tomcat-8.5.75\temp\jenkins5788250459304119055.sh
Microsoft Windows [Version 10.0.18363.1556]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\harshal\.jenkins\workspace\MVCApp>[Gradle] - Launching build.
[MVCApp] $ cmd.exe /C "C:\Users\harshal\.jenkins\workspace\MVCApp\gradlew.bat clean build && exit %%ERRORLEVEL%%"
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 1099; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
我已禁用 jmx,如下所示,但仍不确定为什么我在构建执行中遇到相同的错误。 CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
我已经使用 intellj 在本地 tomcat 8.5 中部署了 JENKINS war
I am trying to build simple Jenkins build job in my local workspace. I have built simple mvc gradle application. Jenkins build job has been setup with required gradel task but getting below error for jmx
Running as SYSTEM
Building in workspace C:\Users\harshal\.jenkins\workspace\MVCApp
The recommended git tool is: NONE
No credentials specified
> git.exe rev-parse --resolve-git-dir C:\Users\harshal\.jenkins\workspace\MVCApp\.git # timeout=10
Fetching changes from the remote Git repository
> git.exe config remote.origin.url https://github.com/harshalpatil2012/HelloWorld-MVC-App.git # timeout=10
Fetching upstream changes from https://github.com/harshalpatil2012/HelloWorld-MVC-App.git
> git.exe --version # timeout=10
> git --version # 'git version 2.9.0.windows.1'
> git.exe fetch --tags --progress -- https://github.com/harshalpatil2012/HelloWorld-MVC-App.git +refs/heads/*:refs/remotes/origin/* # timeout=10
> git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
Checking out Revision a7cf612bd16cc92d5e56137284de5318ce9beec2 (refs/remotes/origin/master)
> git.exe config core.sparsecheckout # timeout=10
> git.exe checkout -f a7cf612bd16cc92d5e56137284de5318ce9beec2 # timeout=10
Commit message: "spring gradle demo app"
> git.exe rev-list --no-walk a7cf612bd16cc92d5e56137284de5318ce9beec2 # timeout=10
[MVCApp] $ C:\Windows\system32\cmd.exe -xe C:\Softwares\apache-tomcat-8.5.75\temp\jenkins5788250459304119055.sh
Microsoft Windows [Version 10.0.18363.1556]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\harshal\.jenkins\workspace\MVCApp>[Gradle] - Launching build.
[MVCApp] $ cmd.exe /C "C:\Users\harshal\.jenkins\workspace\MVCApp\gradlew.bat clean build && exit %%ERRORLEVEL%%"
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 1099; nested exception is:
java.net.BindException: Address already in use: JVM_Bind
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Finished: FAILURE
I have disabled jmx as below but still not sure why I am gettign same error in build execution.
CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"
I have deployed JENKINS war in my local tomcat 8.5 using intellj
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
该错误告诉您有一些服务或进程正在使用端口 1099。您需要找到哪个进程正在使用该端口,然后终止/结束它(或更改 gradle 正在使用的端口)并重新运行您的作业。我不是 Windows 用户,但应该遵循相同的原则:使用 NetStat.exe,您可以查看计算机中使用的端口及其进程。另外这个答案也可以帮助你。
The error is telling you that there is some service or process using port 1099. You need to find what process is using that port, then kill/end it (or change the port gradle is using) and rerun your job. I'm not a Windows user but the same principle should follow: Using NetStat.exe you can see the used ports in your machine with their processes. Also this answer can also help you.
此问题是由于 Intelj 在启动期间尝试连接到 JMX 造成的。我切换到 eclipse,并且 Jenins 设置通过我的 eclipse tomcat 服务器部署正常工作。
This issue was due to the Intellj trying to connect to JMX during startup. I switched to eclipse and Jenins setup was working correctly via my eclipse tomcat server deployment.