2013-08-28 123 views
1

我想在编译后将我的war文件部署到JBoss 7.1.1。但是它在输出中会出现以下错误(将maven debug输出设置为-X,-e不会创建更详细的输出)。为什么jboss-as:deploy失败?

我用它来调用它

我Maven的命令是:clean install -Pintegration jboss-as:deploy

[INFO] --- jboss-as-maven-plugin:7.1.1.Final:deploy (default-cli) @ webapp --- 
Aug 28, 2013 11:58:26 AM org.xnio.Xnio <clinit> 
INFO: XNIO Version 3.0.3.GA 
Aug 28, 2013 11:58:26 AM org.xnio.nio.NioXnio <clinit> 
INFO: XNIO NIO Implementation Version 3.0.3.GA 
Aug 28, 2013 11:58:26 AM org.jboss.remoting3.EndpointImpl <clinit> 
INFO: JBoss Remoting version 3.2.3.GA 
mojoFailed org.jboss.as.plugins:jboss-as-maven-plugin:7.1.1.Final(default-cli) 
projectFailed com.foo:webapp:0.0.1-SNAPSHOT 
[HUDSON] Archiving C:\Users\Administrator\.hudson\jobs\CCMS\workspace\pom.xml to C:\Users\Administrator\.hudson\jobs\CCMS\modules\com.foo$webapp\builds\2013-08-28_11-57-43\archive\com.foo\webapp\0.0.1-SNAPSHOT\pom.xml 
[HUDSON] Archiving C:\Users\Administrator\.hudson\jobs\CCMS\workspace\target\webapp.war to C:\Users\Administrator\.hudson\jobs\CCMS\modules\com.foo$webapp\builds\2013-08-28_11-57-43\archive\com.foo\webapp\0.0.1-SNAPSHOT\webapp.war 
sessionEnded 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 57.908s 
[INFO] Finished at: Wed Aug 28 11:58:49 CEST 2013 
[INFO] Final Memory: 21M/250M 
[INFO] ------------------------------------------------------------------------ 
maven builder waiting 
mavenExecutionResult exceptions not empty 
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.1.1.Final:deploy (default-cli) on project webapp: Deployment failed and was rolled back. 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217) 
    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:84) 
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183) 
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161) 
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320) 
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156) 
    at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:79) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:601) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchStandard(Launcher.java:329) 
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:239) 
    at org.jvnet.hudson.maven3.agent.Maven3Main.launch(Maven3Main.java:146) 
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:124) 
    at hudson.maven.Maven3Builder.call(Maven3Builder.java:71) 
    at hudson.remoting.UserRequest.perform(UserRequest.java:107) 
    at hudson.remoting.UserRequest.perform(UserRequest.java:41) 
    at hudson.remoting.Request$2.run(Request.java:276) 
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) 
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) 
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) 
    at java.lang.Thread.run(Thread.java:722) 
Caused by: org.apache.maven.plugin.MojoExecutionException: Deployment failed and was rolled back. 
    at org.jboss.as.plugin.deployment.standalone.StandaloneDeployment.execute(StandaloneDeployment.java:147) 
    at org.jboss.as.plugin.deployment.AbstractDeployment.execute(AbstractDeployment.java:138) 
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101) 
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209) 
    ... 27 more 

在此之前,我加mgmtuser与批处理文件到JBoss的管理境界。 档案pom.xml的配置是:

<profile> 
      <!-- The profile to build in the integration environment --> 
      <id>integration</id> 
      <build> 
       <plugins> 
        <!-- Use this plugin to cleanly deploy the application --> 
        <plugin> 
         <groupId>org.jboss.as.plugins</groupId> 
         <artifactId>jboss-as-maven-plugin</artifactId> 
         <version>7.1.1.Final</version> 
         <configuration> 
          <hostname>localhost</hostname> 
          <username>mgmtuser</username> 
          <password>pwd</password> 
          <force>true</force> 
         </configuration> 
        </plugin> 
       </plugins> 
      </build>     
     </profile> 

我怎么能检索有关错误的详细信息?

回答

2

我抬头看了一下server.log,发现了Can't find a persistence unit named foo in deployment

虽然它在Eclipse的本地开发中工作,但它在集成上失败了。原因:persistence.xml未包含在类路径中。在战争文件是:/WEB-INF/classes/META-INF/persistence.xml

任何地方都会导致错误。

+0

我认为插件的更新版本会给出更好的错误消息。 –

+0

显然他们这样做。但是,如果隐藏了详细信息,则server.log/domain.log无疑是需要查看的地方。总而言之,这是一个正确的异常处理。 – feder