Re-Export of modules do not work for the META-INF resources in EAP6

Solution Verified - Updated -

Issue

  • Re-export not working with META-INF resources in the case of multiple modules in EAP6.
  • Suppose if a spring module is configured as following:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.springframework.spring" slot="main">
  <resources>
    <resource-root path="spring-aop-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-asm-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-beans-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-context-3.0.6.RELEASE.jar">
            <filter>
                <include path="META-INF**" />
                <include path="org**" />
            </filter>
        </resource-root>
    <resource-root path="spring-context-support-3.0.6.RELEASE.jar">
            <filter>
                <include path="META-INF**" />
                <include path="org**" />
            </filter>
        </resource-root>
    <resource-root path="spring-core-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-expression-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-jdbc-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-jms-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-oxm-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-test-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-tx-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-web-3.0.6.RELEASE.jar"/>
    <resource-root path="spring-webmvc-3.0.6.RELEASE.jar"/>
  </resources>
  <dependencies>
           <module name="org.apache.commons.logging"/>
           <module name="javax.api" export="true"/>
           <module name="javax.servlet.api" export="true"/>
           <module name="com.sun.xml.bind" export="true"/>
           <module name="org.jboss.vfs"/> 
           <module name="javax.el.api" export="true"/>
  </dependencies>
</module>
  • A custom module "custom" refer to the spring module as following:
<module xmlns="urn:jboss:module:1.1" name="custom" slot="main">
    <dependencies>
        <module name="org.springframework.spring" slot="main" export="true"/>
    </dependencies>
</module>
  • If a Spring based application refers to the module "custom" as following then it is not able to access the Spring NamespaceHandler which are present inside the META-INF directory of spring module jars.
<jboss-deployment-structure>
    <deployment>
        <dependencies>
            <module name="custom" slot="main" export="true" meta-inf="export"/>
        <dependencies>
    </deployment>
</jboss-deployment-structure>
  • The exception observed as following:
ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 53) Context initialization failed: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]
Offending resource: ServletContext resource [/WEB-INF/applicationContext.xml]
    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:80) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:284) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1335) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1328) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:135) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:93) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149) [spring-beans-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:124) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:93) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130) [spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467) [spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397) [spring-context-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_21]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [rt.jar:1.7.0_21]
    at java.util.concurrent.FutureTask.run(FutureTask.java:166) [rt.jar:1.7.0_21]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_21]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_21]
    at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_21]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
  • I have technicals components which contains xsd. Technicals components are in JBoss Modules. There is dependencies between technicals components.
    Technical component A depend on technical component B which depend on technical component C. When JBoss load technical component B, it cannot see the xsd which are in technical component C

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content