在wildfly 10上通过jenkins部署应用程序时不一致地收到FORCE_DEPLOY错误

时间:2016-05-14 19:56:28

标签: maven jenkins deployment amazon-ec2 wildfly

当我尝试在jenkins上为我的应用程序运行maven“clean compile install wildfly:deploy”时,它有时可以正常运行并返回成功,但有时会因以下错误而失败。应用程序代码没有改变,但构建的行为不断变化。我确实试图在Amazon Linux ec2实例上手动重启wildfly服务器,看看它有时会有所帮助。在测试应用程序并在本地Windows工作站上部署时,同样的mvn在本地工作正常。

注意:我的Jenkins和Wildfly应用服务器位于同一个Amazon Linux EC2实例上。所以在构建脚本上,我把它称为localhost。

[ERROR] Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.1.0.Alpha7:deploy (default-cli) on project MedDRA-DataProcessing: Error executing FORCE_DEPLOY: java.util.concurrent.CancellationException: Operation was cancelled -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.wildfly.plugins:wildfly-maven-plugin:1.1.0.Alpha7:deploy (default-cli) on project MedDRA-DataProcessing: Error executing FORCE_DEPLOY
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    Caused by: org.wildfly.plugin.common.DeploymentExecutionException: Error executing FORCE_DEPLOY
        at org.wildfly.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:161)
        at org.wildfly.plugin.deployment.AbstractDeployment.executeDeployment(AbstractDeployment.java:147)
        at org.wildfly.plugin.deployment.AbstractDeployment.doExecute(AbstractDeployment.java:179)
        at org.wildfly.plugin.deployment.AbstractAppDeployment.doExecute(AbstractAppDeployment.java:70)
        at org.wildfly.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:137)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 20 more
    Caused by: java.io.IOException: java.util.concurrent.CancellationException: Operation was cancelled
        at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:149)
        at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:80)
        at org.wildfly.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:153)
        ... 26 more
    Caused by: java.util.concurrent.CancellationException: Operation was cancelled
        at org.jboss.threads.AsyncFutureTask.operationCancelled(AsyncFutureTask.java:70)
        at org.jboss.threads.AsyncFutureTask.get(AsyncFutureTask.java:267)
        at org.jboss.as.controller.client.impl.AbstractDelegatingAsyncFuture.get(AbstractDelegatingAsyncFuture.java:57)
        at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:147)
        ... 28 more
    [ERROR] 
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
    Build step 'Invoke top-level Maven targets' marked build as failure
    Finished: FAILURE

pom.xml有:

<build>
    <finalName>${project.artifactId}</finalName>

    <plugins>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.6</version>
            <configuration>
                <warSourceDirectory>src/main/webapp</warSourceDirectory>
                <failOnMissingWebXml>false</failOnMissingWebXml>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.3</version>
            <configuration>
                <source>${jdk.version}</source>
                <target>${jdk.version}</target>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.9</version>
            <configuration>
                <downloadSources>true</downloadSources>
                <downloadJavadocs>false</downloadJavadocs>
                <wtpversion>2.0</wtpversion>
            </configuration>
        </plugin>

        <!-- Deployment on AS from console -->
        <plugin>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>${version.maven.wildfly}</version>
            <configuration>
                <hostname>localhost</hostname>
                <port>9990</port>
                <username>user1</username>
                <password>password1</password>
            </configuration>
        </plugin>
    </plugins>
</build>

1 个答案:

答案 0 :(得分:0)

您是否曾尝试使用其他插件版本,然后使用alpha作为插件?我推荐最终版本,因为它经常发生在alphabuilds中可能存在不一致