2017-04-27 107 views
0

我試圖在wildfly 8.x服務器上部署ear應用程序。Wildfly 8.x ClassNotFoundException:org.jboss.virtual.VFS

問題是,當我要開始我的服務器,日誌控制檯打印了我以下錯誤:

14:00:09,825 ERROR [org.springframework.core.io.VfsUtils] (MSC service thread 1-7) JBoss VFS packages (for both JBoss AS 5 and 6) were not found - JBoss VFS support disabled 
    14:00:09,835 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-7) Context initialization failed: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/beans/gardian_beans.xml]; nested exception is java.lang.ExceptionInInitializerError 
      at 
    Caused by: java.lang.ExceptionInInitializerError 
      at org.springframework.core.io.support.PathMatchingResourcePatternResolver$VfsResourceMatchingDelegate.findMatchingResources(PathMatchingResourcePatternResolver.java:652) [spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] 
      ... 24 more 
    Caused by: java.lang.IllegalStateException: Cannot detect JBoss VFS packages 
      at org.springframework.core.io.VfsUtils.<clinit>(VfsUtils.java:109) [spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] 
      ... 39 more 
    Caused by: java.lang.ClassNotFoundException: org.jboss.virtual.VFS from [Module "org.springframework.spring:main" from local module loader @67117f44 (finder: local module finder @5d3411d (roots: /abb/assetsuite/wildfly-8.2.1.Final.as/modules,/abb/assetsuite/wildfly-8.2.1.Final.as/modules/system/layers/base))] 
      at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final] 
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final] 
      at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final] 
      at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final] 
      at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final] 
      at org.springframework.core.io.VfsUtils.<clinit>(VfsUtils.java:99) [spring-core-3.2.9.RELEASE.jar:3.2.9.RELEASE] 
      ... 39 more 

我的JBoss不承認org.jboss.virtual.VFS類。

這是我module.xml我模塊org.springframework.spring.main

<module xmlns="urn:jboss:module:1.0" name="org.springframework.spring"> 

    <resources> 
     <resource-root path="aopalliance-1.0.0.jar"/> 
     <!--<resource-root path="groovy-all-2.3.4.jar"/>--> 
     <resource-root path="spring-aop-3.2.9.RELEASE.jar"/> 
     <resource-root path="spring-beans-3.2.9.RELEASE.jar"/> 
     <resource-root path="spring-context-3.2.9.RELEASE.jar"/> 
     <resource-root path="spring-core-3.2.9.RELEASE.jar"/> 
     <resource-root path="spring-expression-3.2.9.RELEASE.jar"/> 
     <resource-root path="spring-jdbc-3.2.9.RELEASE.jar"/> 
     <resource-root path="spring-jms-3.2.9.RELEASE.jar"/> 
     <resource-root path="spring-tx-3.2.9.RELEASE.jar"/> 
     <resource-root path="spring-web-3.2.9.RELEASE.jar"/> 
    </resources> 

    <dependencies> 
     <module name="javax.api"/> 
     <module name="javax.servlet.api"/> 
     <module name="javax.jms.api"/> 
     <module name="javax.annotation.api"/> 
     <module name="org.apache.commons.logging"/> 
    </dependencies> 
</module> 

當然,我在同一個文件夾中引用的所有jar我module.xml ..

+0

看起來你需要依賴於org.jboss.vfs。 –

+0

我將您的解決方案移至社區wiki答案。 –

回答

0

它看起來像你需要的依賴關係組織.jboss.vfs在裏面。

您可以通過

如果您的應用程序的WEB-INF \ lib文件夾下的春瓶解決這個問題然後添加以下依賴於你的「JBoss的部署,structure.xml」文件 或者如果你是使用spring作爲一個單獨的模塊,那麼你必須在你的spring模塊中添加這個作爲你的module.xml的依賴項。

<module name="org.jboss.vfs"></module> 
0

解決方案由OP。

加入解決,在我的module.xml<dependencies>

<module name="org.jboss.vfs"/> 

不要忘記檢查,如果你有org.jboss.vfs folder庫裏面。