簡體   English   中英

ClassNotFoundException:使用Spring 4.0.2作為Jboss 7模塊時的org.jboss.vfs.VFS

[英]ClassNotFoundException: org.jboss.vfs.VFS when using Spring 4.0.2 as Jboss 7 module

我正在嘗試使Spring 4.0.2作為JBoss 7模塊運行。 當我部署War文件時,發生以下錯誤

Caused by: java.lang.IllegalStateException: Could not detect JBoss VFS infrastructure
    at org.springframework.core.io.VfsUtils.<clinit>(VfsUtils.java:92) [spring-core-4.0.2.RELEASE.jar:4.0.2.RELEASE]
    ... 45 more
Caused by: java.lang.ClassNotFoundException: org.jboss.vfs.VFS from [Module "********:main" from local module loader @5ab785fe (finder: local module finder @46be1539 (roots: C:\jboss-as-7.2.0.Final\modules,C:\jboss-as-7.2.0.Final\modules\system\layers\base))]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.2.0.CR1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.2.0.CR1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.2.0.CR1]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.2.0.CR1]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.2.0.CR1]
    at org.springframework.core.io.VfsUtils.<clinit>(VfsUtils.java:69) [spring-core-4.0.2.RELEASE.jar:4.0.2.RELEASE]
    ... 45 more

我的webappname-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:p="http://www.springframework.org/schema/p"
   xmlns:context="http://www.springframework.org/schema/context"
   xsi:schemaLocation="
    http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-4.0.xsd">
<context:component-scan base-package="webappname"/>
</beans>

我在META-INF中的spring.handlers,沒有此文件,我遇到了“進攻性資源...”錯誤

http\://www.springframework.org/schema/c=org.springframework.beans.factory.xml.SimpleConstructorNamespaceHandler
http\://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler
http\://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler
http\://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler
http\://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler
http\://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler
http\://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler
http\://www.springframework.org/schema/cache=org.springframework.cache.config.CacheNamespaceHandler

在module.xml文件中,我使用以下jar

<resource-root path="spring-core-4.0.2.RELEASE.jar"/>
<resource-root path="spring-beans-4.0.2.RELEASE.jar"/>
<resource-root path="spring-context-4.0.2.RELEASE.jar"/>
<resource-root path="spring-web-4.0.2.RELEASE.jar"/>
<resource-root path="spring-webmvc-4.0.2.RELEASE.jar"/>

錯誤是由於我的設置還是JBoss / Spring錯誤? 如果我將Spring庫放在WEB-INF / lib中,則一切運行正常。

謝謝。

像JBoss 5.1 EAP一樣,似乎JBoss 7正在使用VFS2。 org.jboss.vfs.VFS類屬於VFS3。 Spring Framework 4.x不再支持VFS2。 您將在我的GitHub Projet https://github.com/arey/spring4-vfs2-support上找到針對Spring Framework 4.0的VFS2的反向移植,希望對您有幫助

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM