2015-06-14 114 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。 我的應用程序現在工作正常。