Jenkins 使用 Deploy to Container 插件部署到 JBoss EAP7
Jenkins deploy to JBoss EAP7 with Deploy to Container plugin
我已经在单独的服务器上配置了 Jenkins 来构建 Maven 项目,现在我希望 Jenkins 在位于不同服务器上的 JBoss EAP(7.3.0) 上为我部署该项目通过 Deploy to Container jenkins (1.16) 插件,但是当我尝试部署时出现以下错误:
15:58:33 [DeployPublisher][INFO] Attempting to deploy 1 war file(s)
15:58:34 ERROR: Build step failed with exception
15:58:34 org.codehaus.cargo.container.ContainerException: Failed to create deployer with implementation class org.codehaus.cargo.container.jboss.JBoss7xRemoteDeployer for the parameters (container [id = [jboss7x]], deployer type [remote]).
15:58:34 at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:154)
15:58:34 at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFactory.java:89)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:131)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:150)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:69)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
15:58:34 at hudson.FilePath.act(FilePath.java:1164)
15:58:34 at hudson.FilePath.act(FilePath.java:1147)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
15:58:34 at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
15:58:34 at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
15:58:34 at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
15:58:34 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
15:58:34 at hudson.tasks.BuildStepMonitor.perform(BuildStepMonitor.java:45)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
15:58:34 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
15:58:34 at hudson.model.Run.execute(Run.java:1932)
15:58:34 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
15:58:34 at hudson.model.ResourceController.execute(ResourceController.java:97)
15:58:34 at hudson.model.Executor.run(Executor.java:429)
15:58:34 Caused by: java.lang.reflect.InvocationTargetException
15:58:34 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
15:58:34 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
15:58:34 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
15:58:34 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:229)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:40)
15:58:34 at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:148)
15:58:34 ... 22 more
15:58:34 Caused by: org.codehaus.cargo.util.CargoException: Cannot locate the JBoss connector classes! Make sure the required JBoss JARs (or Maven dependencies) are in CARGO's classpath.
15:58:34 More information on: https://codehaus-cargo.github.io/cargo/JBoss+Remote+Deployer.html
15:58:34 at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:146)
15:58:34 at org.codehaus.cargo.container.jboss.JBoss7xRemoteDeployer.<init>(JBoss7xRemoteDeployer.java:39)
15:58:34 ... 29 more
15:58:34 Caused by: java.lang.ClassNotFoundException: org.jboss.as.controller.client.ModelControllerClient
15:58:34 at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1387)
15:58:34 at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1342)
15:58:34 at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1089)
15:58:34 at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
15:58:34 at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:141)
15:58:34 ... 30 more
15:58:34 java.lang.reflect.InvocationTargetException
15:58:34 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
15:58:34 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
15:58:34 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
15:58:34 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:229)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:40)
15:58:34 at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:148)
15:58:34 at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFactory.java:89)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:131)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:150)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:69)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
15:58:34 at hudson.FilePath.act(FilePath.java:1164)
15:58:34 at hudson.FilePath.act(FilePath.java:1147)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
15:58:34 at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
15:58:34 at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
15:58:34 at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
15:58:34 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
15:58:34 at hudson.tasks.BuildStepMonitor.perform(BuildStepMonitor.java:45)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
15:58:34 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
15:58:34 at hudson.model.Run.execute(Run.java:1932)
15:58:34 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
15:58:34 at hudson.model.ResourceController.execute(ResourceController.java:97)
15:58:34 at hudson.model.Executor.run(Executor.java:429)
15:58:34 Caused by: org.codehaus.cargo.util.CargoException: Cannot locate the JBoss connector classes! Make sure the required JBoss JARs (or Maven dependencies) are in CARGO's classpath.
15:58:34 More information on: https://codehaus-cargo.github.io/cargo/JBoss+Remote+Deployer.html
15:58:34 at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:146)
15:58:34 at org.codehaus.cargo.container.jboss.JBoss7xRemoteDeployer.<init>(JBoss7xRemoteDeployer.java:39)
15:58:34 ... 29 more
15:58:34 Caused by: java.lang.ClassNotFoundException: org.jboss.as.controller.client.ModelControllerClient
15:58:34 at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1387)
15:58:34 at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1342)
15:58:34 at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1089)
15:58:34 at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
15:58:34 at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:141)
15:58:34 ... 30 more
15:58:34 Build step 'Deploy war/ear to a container' marked build as failure
15:58:34 Finished: FAILURE
我已尝试将 cargo-maven3-plugin 安装到我的本地 Maven 存储库中 (https://mvnrepository.com/artifact/org.codehaus.cargo/cargo-maven3-plugin/1.9.2) as suggested by the error message if you read the link it provides: https://codehaus-cargo.github.io/cargo/JBoss+Remote+Deployer.html
但是我仍然收到错误消息,有人知道问题出在哪里吗?
我找到了解决问题的方法。
复制位于 JBoss 实例中的所有 JAR 文件(例如 JBossEAP7.3.1/Modules/*.jar)。我强烈建议使用搜索功能找到它们。
将 jars 放入“Deploy to Container”(在文件夹结构中命名为 Deploy)本地 jar 存储库(可以在您为 jenkins 实例安装插件的地方找到,这意味着您的 .jenkins 文件在哪里位于)
重启 Jenkins
部署到容器将不再遇到发布的错误。
不幸的是,我后来遇到了一个新的错误(与此无关),这迫使我出于我的目的放弃了这个插件。
我已经在单独的服务器上配置了 Jenkins 来构建 Maven 项目,现在我希望 Jenkins 在位于不同服务器上的 JBoss EAP(7.3.0) 上为我部署该项目通过 Deploy to Container jenkins (1.16) 插件,但是当我尝试部署时出现以下错误:
15:58:33 [DeployPublisher][INFO] Attempting to deploy 1 war file(s)
15:58:34 ERROR: Build step failed with exception
15:58:34 org.codehaus.cargo.container.ContainerException: Failed to create deployer with implementation class org.codehaus.cargo.container.jboss.JBoss7xRemoteDeployer for the parameters (container [id = [jboss7x]], deployer type [remote]).
15:58:34 at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:154)
15:58:34 at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFactory.java:89)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:131)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:150)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:69)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
15:58:34 at hudson.FilePath.act(FilePath.java:1164)
15:58:34 at hudson.FilePath.act(FilePath.java:1147)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
15:58:34 at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
15:58:34 at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
15:58:34 at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
15:58:34 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
15:58:34 at hudson.tasks.BuildStepMonitor.perform(BuildStepMonitor.java:45)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
15:58:34 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
15:58:34 at hudson.model.Run.execute(Run.java:1932)
15:58:34 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
15:58:34 at hudson.model.ResourceController.execute(ResourceController.java:97)
15:58:34 at hudson.model.Executor.run(Executor.java:429)
15:58:34 Caused by: java.lang.reflect.InvocationTargetException
15:58:34 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
15:58:34 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
15:58:34 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
15:58:34 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:229)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:40)
15:58:34 at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:148)
15:58:34 ... 22 more
15:58:34 Caused by: org.codehaus.cargo.util.CargoException: Cannot locate the JBoss connector classes! Make sure the required JBoss JARs (or Maven dependencies) are in CARGO's classpath.
15:58:34 More information on: https://codehaus-cargo.github.io/cargo/JBoss+Remote+Deployer.html
15:58:34 at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:146)
15:58:34 at org.codehaus.cargo.container.jboss.JBoss7xRemoteDeployer.<init>(JBoss7xRemoteDeployer.java:39)
15:58:34 ... 29 more
15:58:34 Caused by: java.lang.ClassNotFoundException: org.jboss.as.controller.client.ModelControllerClient
15:58:34 at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1387)
15:58:34 at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1342)
15:58:34 at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1089)
15:58:34 at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
15:58:34 at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:141)
15:58:34 ... 30 more
15:58:34 java.lang.reflect.InvocationTargetException
15:58:34 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
15:58:34 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
15:58:34 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
15:58:34 at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:229)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createInstance(DefaultDeployerFactory.java:40)
15:58:34 at org.codehaus.cargo.generic.spi.AbstractGenericHintFactory.createImplementation(AbstractGenericHintFactory.java:148)
15:58:34 at org.codehaus.cargo.generic.spi.AbstractIntrospectionGenericHintFactory.createImplementation(AbstractIntrospectionGenericHintFactory.java:89)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:131)
15:58:34 at org.codehaus.cargo.generic.deployer.DefaultDeployerFactory.createDeployer(DefaultDeployerFactory.java:150)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter.deploy(CargoContainerAdapter.java:69)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:167)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter$DeployCallable.invoke(CargoContainerAdapter.java:136)
15:58:34 at hudson.FilePath.act(FilePath.java:1164)
15:58:34 at hudson.FilePath.act(FilePath.java:1147)
15:58:34 at hudson.plugins.deploy.CargoContainerAdapter.redeployFile(CargoContainerAdapter.java:133)
15:58:34 at hudson.plugins.deploy.PasswordProtectedAdapterCargo.redeployFile(PasswordProtectedAdapterCargo.java:95)
15:58:34 at hudson.plugins.deploy.DeployPublisher.perform(DeployPublisher.java:113)
15:58:34 at jenkins.tasks.SimpleBuildStep.perform(SimpleBuildStep.java:123)
15:58:34 at hudson.tasks.BuildStepCompatibilityLayer.perform(BuildStepCompatibilityLayer.java:80)
15:58:34 at hudson.tasks.BuildStepMonitor.perform(BuildStepMonitor.java:45)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:803)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:752)
15:58:34 at hudson.maven.MavenModuleSetBuild$MavenModuleSetBuildExecution.post2(MavenModuleSetBuild.java:1072)
15:58:34 at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:697)
15:58:34 at hudson.model.Run.execute(Run.java:1932)
15:58:34 at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:543)
15:58:34 at hudson.model.ResourceController.execute(ResourceController.java:97)
15:58:34 at hudson.model.Executor.run(Executor.java:429)
15:58:34 Caused by: org.codehaus.cargo.util.CargoException: Cannot locate the JBoss connector classes! Make sure the required JBoss JARs (or Maven dependencies) are in CARGO's classpath.
15:58:34 More information on: https://codehaus-cargo.github.io/cargo/JBoss+Remote+Deployer.html
15:58:34 at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:146)
15:58:34 at org.codehaus.cargo.container.jboss.JBoss7xRemoteDeployer.<init>(JBoss7xRemoteDeployer.java:39)
15:58:34 ... 29 more
15:58:34 Caused by: java.lang.ClassNotFoundException: org.jboss.as.controller.client.ModelControllerClient
15:58:34 at jenkins.util.AntClassLoader.findClassInComponents(AntClassLoader.java:1387)
15:58:34 at jenkins.util.AntClassLoader.findClass(AntClassLoader.java:1342)
15:58:34 at jenkins.util.AntClassLoader.loadClass(AntClassLoader.java:1089)
15:58:34 at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
15:58:34 at org.codehaus.cargo.container.jboss.JBoss5xRemoteDeployer.<init>(JBoss5xRemoteDeployer.java:141)
15:58:34 ... 30 more
15:58:34 Build step 'Deploy war/ear to a container' marked build as failure
15:58:34 Finished: FAILURE
我已尝试将 cargo-maven3-plugin 安装到我的本地 Maven 存储库中 (https://mvnrepository.com/artifact/org.codehaus.cargo/cargo-maven3-plugin/1.9.2) as suggested by the error message if you read the link it provides: https://codehaus-cargo.github.io/cargo/JBoss+Remote+Deployer.html
但是我仍然收到错误消息,有人知道问题出在哪里吗?
我找到了解决问题的方法。
复制位于 JBoss 实例中的所有 JAR 文件(例如 JBossEAP7.3.1/Modules/*.jar)。我强烈建议使用搜索功能找到它们。
将 jars 放入“Deploy to Container”(在文件夹结构中命名为 Deploy)本地 jar 存储库(可以在您为 jenkins 实例安装插件的地方找到,这意味着您的 .jenkins 文件在哪里位于)
重启 Jenkins
部署到容器将不再遇到发布的错误。
不幸的是,我后来遇到了一个新的错误(与此无关),这迫使我出于我的目的放弃了这个插件。