2015-06-14 72 views
1

我已经将我早期在java 1.7中的web应用程序升级到java 1.8。但是,当我尝试在jboss 7, 中部署它的战争时,我得到以下异常。如何在java 1.8中编译war在jboss 7中编译

 
[jbossweb-7.0.13.Final.jar:] 
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:] 
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final] 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) 
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) 
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17] 
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17] 

18:49:41,659 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/nlp_Server]] (MSC service thread 1-8) Skipped installing application listeners due to previous error(s) 
18:49:41,659 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-8) Error listenerStart 
18:49:41,659 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-8) Context [/nlp_Server] startup failed due to previous errors 
18:49:41,675 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.web.deployment.default-host./nlp_Server: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./nlp_Server: 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_17] 
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17] 
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17] 

18:49:41,675 INFO [org.jboss.as] (MSC service thread 1-4) JBAS015951: Admin console listening on http://127.0.0.1:9990 
18:49:41,675 ERROR [org.jboss.as] (MSC service thread 1-4) JBAS015875: JBoss AS 7.1.1.Final "Brontes" started (with errors) in 4540ms - Started 213 of 294 services (2 services failed or missing dependencies, 78 services are passive or on-demand) 
18:49:41,909 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "nlp_Server.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.web.deployment.default-host./nlp_Server" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./nlp_Server: JBAS018040: Failed to start context"}} 
18:49:41,924 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015871: Deploy of deployment "MemberManagement.war" was rolled back with no failure message 
18:49:41,971 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment MemberManagement.war in 48ms 
18:49:42,018 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment nlp_Server.war in 128ms 
18:49:42,018 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report 
JBAS014777: Services which failed to start:  service jboss.web.deployment.default-host./nlp_Server: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./nlp_Server: JBAS018040: Failed to start context 

18:49:42,018 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS014654: Composite operation was rolled back 
18:49:42,018 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./nlp_Server" => "org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./nlp_Server: JBAS018040: Failed to start context"}}}} 
18:49:44,732 INFO [org.jboss.as.osgi] (MSC service thread 1-8) JBAS011942: Stopping OSGi Framework 

同样的战争在tomcat中成功部署。

+1

请格式化您的问题,这是一个痛苦的眼睛,因为堆栈跟踪只是一个词的分类。你可以重新命名它:你并没有试图部署,但你正在寻找信息如何解决某个异常 – Marged

+0

什么是你的jboss中的nlp_Server,你可以发布你的standalone.configuration文件吗? –

回答

2

JBoss的似乎从你的日志在JDK 7

运行:

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17] 

但你编译使用JDK 8,你的源,以便JDK7不能从JDK 8

运行编译代码

请在编译源代码时添加源代码和目标代码。

例如javac -source 1.7 -target 1.7

+0

谢谢,这是有道理的。我会试试这个 –

+0

如果真的有帮助,请接受这个答案 – diufanman

+0

@ diufanman:你的解决方案很有帮助,但是我找到了我的答案。我已在下面发布它。感谢您的帮助 –

0

我找到了答案。 jboss 7不支持jdk 1.8。我已经下载了支持jdk 1.8的jboss-eap-6.4.0。 我的应用程序现在工作正常。