简体   繁体   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

I am trying to make Spring 4.0.2 run as JBoss 7 module. 我正在尝试使Spring 4.0.2作为JBoss 7模块运行。 When I deploy my war file the following error occur 当我部署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

My webappname-servlet.xml 我的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>

My spring.handlers inside META-INF, without this file I have "Offensive resource..." error 我在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

Inside the module.xml file, i use the following jars 在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"/>

Is the error because of my settings or it's a JBoss/Spring bug ? 错误是由于我的设置还是JBoss / Spring错误? If I put Spring library inside WEB-INF/lib everything run fine. 如果我将Spring库放在WEB-INF / lib中,则一切运行正常。

Thanks. 谢谢。

Like JBoss 5.1 EAP, it seems that JBoss 7 is using VFS2. 像JBoss 5.1 EAP一样,似乎JBoss 7正在使用VFS2。 The class org.jboss.vfs.VFS belongs TO VFS3. org.jboss.vfs.VFS类属于VFS3。 Spring Framework 4.x do not support any more VFS2. Spring Framework 4.x不再支持VFS2。 You will found a backport for VFS2 for Spring Framework 4.0 on my GitHub projet https://github.com/arey/spring4-vfs2-support Hope this help you, Regards 您将在我的GitHub Projet https://github.com/arey/spring4-vfs2-support上找到针对Spring Framework 4.0的VFS2的反向移植,希望对您有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用JBoss的VFS时抛出“无上下文工厂”异常 - “No context factory” exception thrown when using JBoss' VFS JBOSS MalformedURLException:未知协议:使用RMI的vfs - JBOSS MalformedURLException: unknown protocol: vfs using RMI Wildfly Security Manager:org.jboss.vfs.VirtualFilePermission的权限失败 - Wildfly Security Manager : Permission failed for org.jboss.vfs.VirtualFilePermission 如何添加Flyway依赖关系并构建本机映像Quarkus java.lang.ClassNotFoundException:org.jboss.vfs.VirtualFileFilter - How add Flyway dependency and build native image Quarkus java.lang.ClassNotFoundException: org.jboss.vfs.VirtualFileFilter 使用java nio Paths时未安装JBoss wildfly 8.x Provider“vfs” - JBoss wildfly 8.x Provider “vfs” not installed when using java nio Paths 安装到Parse时出错:name = vfs:// ... JBoss AS 6错误 - Error installing to Parse: name=vfs://… JBoss AS 6 error JBoss 7.1 Standalone / tmp / vfs稳步增长 - JBoss 7.1 standalone/tmp/vfs steadily growing 由于类 org.jboss.vfs.spi.JavaZipFileSystem 的许多实例导致内存泄漏 - Memory leak due to many instances of class org.jboss.vfs.spi.JavaZipFileSystem Memory 泄漏,因为 org.jboss.vfs.spi.JavaZipFileSystem 的实例数量更多 - Memory leak due to more number of instances of org.jboss.vfs.spi.JavaZipFileSystem 如何在JBOSS AS7中关闭或禁用vfs文件加载 - How to turn off or disable vfs file loading in JBOSS AS7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM