JBoss AS6.0.0.Final Spring MVC doesnt work
mmalhotra Mar 16, 2011 12:58 PMHi,
I am trying to run a basic example of Spring MVC (https://anonsvn.jboss.org/repos/jbossas/projects/spring-int/branches/1_0/documentation/samples/web-scanning/src/) for Component scanning using JBoss AS 6.0.0.0.Final and run into this error:
12:33:56,429 INFO [xnio] XNIO Version 2.1.0.CR2
12:33:56,445 INFO [nio] XNIO NIO Implementation Version 2.1.0.CR2
12:33:56,570 INFO [remoting] JBoss Remoting version 3.1.0.Beta2
12:33:56,648 INFO [TomcatDeployment] deploy, ctxPath=/
12:33:56,679 INFO [TomcatDeployment] deploy, ctxPath=/TestMVCJBoss
12:33:56,726 INFO [[/TestMVCJBoss]] Initializing Spring root WebApplicationContext
12:33:56,726 INFO [ContextLoader] Root WebApplicationContext: initialization started
12:33:56,742 INFO [VFSXmlWebApplicationContext] Refreshing Root WebApplicationContext: startup date [Wed Mar 16 12:33:56 EDT 2011]; root of context hierarchy
12:33:56,742 ERROR [ContextLoader] Context initialization failed: java.lang.NoClassDefFoundError: org/jboss/virtual/VirtualFileVisitor
at org.jboss.spring.vfs.VFSServletContextResourcePatternResolver.findPathMatchingResources(VFSServletContextResourcePatternResolver.java:51) [:1.1.0.GA]
at org.springframework.core.io.support.PathMatchingResourcePatternResolver.getResources(PathMatchingResourcePatternResolver.java:269) [:3.0.1.RELEASE-A]
at org.springframework.context.support.AbstractApplicationContext.getResources(AbstractApplicationContext.java:1196) [:3.0.1.RELEASE-A]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:177) [:3.0.1.RELEASE-A]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) [:3.0.1.RELEASE-A]
If I put the VFS jar (jboss-vfs-2.1.2.GA.jar) in the server's classpath it starts throwing:
12:53:07,855 INFO [[/TestMVCJBoss]] Initializing Spring root WebApplicationContext
12:53:07,855 INFO [ContextLoader] Root WebApplicationContext: initialization started
12:53:07,871 INFO [VFSXmlWebApplicationContext] Refreshing Root WebApplicationContext: startup date [Wed Mar 16 12:53:07 EDT 2011]; root of context hierarchy
12:53:07,886 INFO [VFSCacheFactory] Using VFSCache [NoopVFSCache]
12:53:07,902 ERROR [ContextLoader] Context initialization failed: org.springframework.beans.factory.BeanDefinitionStoreException: Could not resolve bean definition resource pattern [classpath*:spring-contexts/*.xml]; nested exception is java.io.IOException: No context factory for vfs:/C:/jboss-6.0.0.Final/server/default/deploy/TestMVCJBoss.war/WEB-INF/classes/spring-contexts/
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:190) [:3.0.1.RELEASE-A]
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) [:3.0.1.RELEASE-A]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) [:3.0.1.RELEASE-A]
at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) [:3.0.1.RELEASE-A]
at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) [:3.0.1.RELEASE-A]
at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:465) [:3.0.1.RELEASE-A]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:395) [:3.0.1.RELEASE-A]
I have the following Spring and Snowdrop Jars in the server classpath:
snowdrop-vfs-1.1.0.GA.jar
org.springframework.aop-3.0.1.RELEASE-A.jar
org.springframework.asm-3.0.1.RELEASE-A.jar
org.springframework.beans-3.0.1.RELEASE-A.jar
org.springframework.context-3.0.1.RELEASE-A.jar
org.springframework.context.support-3.0.1.RELEASE-A.jar
org.springframework.core-3.0.1.RELEASE-A.jar
org.springframework.expression-3.0.1.RELEASE-A.jar
org.springframework.web-3.0.1.RELEASE-A.jar
org.springframework.web.servlet-3.0.1.RELEASE-A.jar