Maven RESTEasy jboss .war部署失败

时间:2014-02-07 23:24:33

标签: java rest maven jboss netbeans-7

我自学了RESTEasy,用Maven构建并部署在jBoss中,然后将其与Jenkins集成。

目前,我已经创建了一个非常简单的RESTEasy Web服务,并使用maven构建它。我有一个.war文件和爆炸战争(这是我认为的战争的“解压缩”文件夹),1.0 snapshot folder内有WEB-INFMETA-INF个文件夹在我的netbeans项目目标文件夹中。

我已经在我的mac中安装了jboss 7.x.x并成功启动并验证它正在我的localhost:8080上运行。我将.war文件复制到jboss7.x.x / standalone / deployments文件夹。

- 通过以下方式运行服务器:sh jboss-7.x.x.Final/bin/standalone.sh
- 有点错误。
- 停止jboss,将爆炸的war文件夹复制到standalone / deployments文件夹中,然后再次运行服务器 - 仍然得到错误。
- 我错过了什么? - 错误日志:

00:12:18,315 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Error listenerStart
00:12:18,316 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-2) Context [/HelloRESTEasy] startup failed due to previous errors
00:12:18,348 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.web.deployment.default-host./HelloRESTEasy: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./HelloRESTEasy: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]

00:12:18,566 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "HelloRESTEasy-1.0-SNAPSHOT.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./HelloRESTEasy" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./HelloRESTEasy: JBAS018040: Failed to start context"}}
00:12:18,589 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment HelloRESTEasy-1.0-SNAPSHOT.war in 21ms
00:12:18,591 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.web.deployment.default-host./HelloRESTEasy: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./HelloRESTEasy: JBAS018040: Failed to start context

00:12:18,593 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./HelloRESTEasy" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./HelloRESTEasy: JBAS018040: Failed to start context"}}}}
^C00:16:14,240 INFO  [org.jboss.as.osgi] (MSC service thread 1-4) JBAS011942: Stopping OSGi Framework

当我访问http://localhost:8080/HelloRESTEasy-1.0-SNAPSHOT/Hello/justin时,我得到了404

1 个答案:

答案 0 :(得分:0)

该日志未完成且您选择了最不重要的部分,但我的经验表明您的WAR内部有重新安装* .jar库。对于jboss 7你的pom.xml在resteasy依赖,你必须放“<scope>provided</scope>”,所以当你编译和打包时,将跳过lib。