Pergunta

I am trying to make Spring 4.0.2 run as JBoss 7 module. When I deploy my war file the following error occur

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

<?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

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

<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 ? If I put Spring library inside WEB-INF/lib everything run fine.

Thanks.

Foi útil?

Solução

Like JBoss 5.1 EAP, it seems that JBoss 7 is using VFS2. The class org.jboss.vfs.VFS belongs TO VFS3. Spring Framework 4.x do not support any more 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

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top