I would love to serve Spring Web MVC as a module in Wildfly but somehow the servlet (WebApplicationInitializer
) doesn't seem to be starting.
module.xml
modules/org/springframework/4.0.0.RELEASE/module.xml
<module xmlns="urn:jboss:module:1.3" name="org.springframework" slot="4.0.0.RELEASE">
<resources>
<resource-root path="aopalliance-1.0.jar"/>
<resource-root path="spring-aop-4.0.0.RELEASE.jar"/>
<resource-root path="spring-beans-4.0.0.RELEASE.jar"/>
<resource-root path="spring-context-4.0.0.RELEASE.jar"/>
<resource-root path="spring-context-support-4.0.0.RELEASE.jar"/>
<resource-root path="spring-core-4.0.0.RELEASE.jar"/>
<resource-root path="spring-expression-4.0.0.RELEASE.jar"/>
<resource-root path="spring-jdbc-4.0.0.RELEASE.jar"/>
<resource-root path="spring-orm-4.0.0.RELEASE.jar"/>
<resource-root path="spring-tx-4.0.0.RELEASE.jar"/>
<resource-root path="spring-web-4.0.0.RELEASE.jar"/>
<resource-root path="spring-webmvc-4.0.0.RELEASE.jar"/>
<resource-root path="spring-mobile-device-1.1.1.RELEASE.jar"/>
</resources>
</module>
Then I went back to my Maven project and scoped all dependencies with scope provided
. When deploying the project in Wildfly everything seems to be ok.
20:47:27,166 DEBUG [org.jboss.as.server.deployment] (MSC service thread 1-13) Adding dependency ModuleDependency [identifier=org.springframework:4.0.0.RELEASE, moduleLoader=Service Module Loader, export=true, optional=false, importServices=false] to module deployment.myapp.war:main
20:47:27,257 INFO [org.wildfly.extension.undertow] (MSC service thread 1-5) JBAS017534: Registered web context: /myapp
20:47:27,269 INFO [org.jboss.as.server] (XNIO-1 task-7) JBAS018559: Deployed "myapp.war" (runtime-name : "myapp.war")
Applications deployed with the Spring libraries bundled run fine. What could be the problem?