How can I export a .tld file from a jboss-module?
michele.mazzei Feb 20, 2013 5:36 AMHi to all,
I'm trying to port a spring-mvc based war to jboss AS7.
I've done the following steps:
1. I created a spring module as below:
<module xmlns="urn:jboss:module:1.1" name="org.springframework">
<resources>
....
<resource-root path="spring-context-support-3.2.0.RELEASE.jar"/>
....
<resource-root path="spring-webmvc-3.2.0.RELEASE.jar"/>
....
</resources>
<dependencies>
<module name="org.jboss.vfs" export="true"/>
<module name="javax.servlet.api" export="true"/>
<module name="javax.servlet.jsp.api" export="true"/>
<module name="javax.servlet.jstl.api" export="true"/>
<module name="javax.api" export="true"/>
<module name="org.apache.log4j" export="true"/>
<module name="org.antlr" export="true"/>
<module name="org.dom4j" export="true"/>
<module name="org.hibernate" export="true"/>
<module name="javax.persistence.api" export="true"/>
<module name="org.javassist" export="true"/>
<module name="org.jboss.logging" export="true"/>
<module name="javax.transaction.api" export="true"/>
</dependencies>
</module>
2. I deployed my springmvc based application in a WAR using the following deployment structure:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<dependencies>
<module name="com.h2database.h2" />
<module name="org.codehaus.jackson.jackson-core-asl" />
<module name="org.codehaus.jackson.jackson-mapper-asl" />
<module name="org.slf4j" />
<module name="org.springframework">
<imports>
<include path="META-INF**" />
<include path="org**" />
</imports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>
The problem is that it does not work because the jsp pages cannot read the tld (tag libraries) include in spring-mvc.jar and located under META-INF directory.
I declared to include all files under META-INF directory:
<imports>
<include path="META-INF**" />
<include path="org**" />
</imports>
But the error is :
org.apache.jasper.JasperException: The absolute uri: http://www.springframework.org/tags/form cannot be resolved in either web.xml or the jar files deployed with this application
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:239)
org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:152)
...
11:24:51,486 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/springmvc].[jboss-as-kitchensink]] (http--127.0.0.1-8080-2) Servlet.service() for servlet jboss-as-kitchensink threw exception: org.apache.jasper.JasperException: The absolute uri: http://www.springframework.org/tags/form cannot be resolved in either web.xml or the jar files deployed with this application
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) [jbossweb-7.0.13.Final.jar:]
Where am I wrong?
How can I instruct Jboss-Modules to export *.tld files?
The files missing are:
META-INF/spring-form.tld
META-INF/spring.tld
Of course, I can bypass the problem removing spring-webmvc.jar from the module and putting it inside the war, but I would like to try to solve this problem
making my application completed modularized.
Thanks
Michele