2016-06-27 233 views
0

沒有與描述一個簡單的EAR項目無法部署企業項目JBossAS

(screenshot from eclipse)

<?xml version="1.0" encoding="UTF-8"?> 
<application ... version="6"> 
    <display-name>EAR</display-name> 
    <module> 
    <web> 
     <web-uri>View.war</web-uri> 
     <context-root>view</context-root> 
    </web> 
    </module> 
    <module> 
    <ejb>Module.jar</ejb> 
    </module> 
</application> 

部署後Jboss7.1我得到的錯誤

WARN [org.jboss.modules] Failed to define class intf.module.FacadeLocal in Module "deployment.EAR.ear.Module.jar:main" from Service Module Loader: java.lang.UnsupportedClassVersionError : intf/module/FacadeLocal : Unsupported major.minor version 52.0 ...

WARN [org.jboss.modules] Failed to define class intf.module.Facade in Module "deployment.EAR.ear.Module.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link intf/module/Facade (Module "deployment.EAR.ear.Module.jar:main" from Service Module Loader)

Caused by: java.lang.NoClassDefFoundError: intf/module/FacadeLocal at java.lang.ClassLoader.defineClass1(Native Method)[rt.jar:1.7.0_79]

Caused by: java.lang.ClassNotFoundException: intf.module.FacadeLocal from [Module "deployment.EAR.ear.Module.jar :main" from Service Module Loader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC00001: Failed to start service jboss.deployment.subunit."EAR.ear"."Module.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."EAR.ear"."Module.jar".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "Module.jar" of deployment "EAR.ear"

Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: Could not load EJB class intf.module.Facade

Caused by: java.lang.ClassNotFoundException: intf.module.Facade from [Module "deployment.EAR.ear.Module.jar:main" from Service Module Loader] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

有任何錯誤在Eclipse中,但出了問題。你能在這裏指出問題嗎?

+1

您的JBossAS實例正在運行比您用來構建應用程序的Java更早的Java版本。 –

回答

0

在你的Eclipse,去Windows->Preferences->Server->Runtime Environment

編輯條目JBoss 7.1 Runtime

指定JRE作爲[jre7] - 你正在使用你的Java項目中的一個來構建它。

單擊完成並確定。

重新啓動服務器。