3 Replies Latest reply on Jan 8, 2013 6:18 PM by M Muthukumaran

    Spring file from a jar is not avilable to other WAR

    M Muthukumaran Newbie



      I have the following deployment

           - CacheScheduler.jar - This has some classes & a spring file "spring/cache-spring-config.xml"

           - TestPortlet.war - This has a spring file "chart_cf.xml" and imports the "spring/cache-spring-config.xml" file from the CacheScheduler.jar using

                <import resource="classpath:spring/cache-spring-config.xml"/>


      I have defined the dependency for CacheScheduler.jar in the "jboss-deployment-structure.xml" of TestPortlet.war like

                <module name="deployment.CacheScheduler.jar"></module>


      But when I try to deploy the TestPortlet.war I get the following exception


      WEB-INF/classes/chart_cf.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOExc

      eption parsing XML document from class path resource [spring/cache-spring-config.xml]; nested exception is java.io.FileN

      otFoundException: class path resource [spring/cache-spring-config.xml] cannot be opened because it does not exist



      It looks like dependency for the deployment.CacheScheduler.jar only get the classes but not any property or XML file from the jar to the WAR. Is there anything I am missing.


      NOTE: Please do not point me to this https://community.jboss.org/wiki/HowToPutAnExternalFileInTheClasspath, I already ready it and I don't want to take that approach as it will take away the dynamic deployment of CacheScheduler.jar from me.