0

I have maven module project with 4 modules core, web, config and war. I have all the spring configuration file inside config module /resources/spring/*.xml.

When I am added the project in eclipse jboss-eap 6.1 server it is working fine(with un archived format) and after maven build the xml file is moved to conf.jar file, but when I build it and deploy it in jboss-eap it is throwing

IOException parsing XML document from class path resource [spring/applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/applicationContext.xml] cannot be opened because it does not exist

Below is my web.xml file.

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    id="WebApp_ID" version="2.5">
    <display-name>Archetype Created Web Application</display-name>
    <description></description>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:/spring/applicationContext.xml,
                 classpath:/spring/spring-companyFinance-security.xml</param-value>
    </context-param>
    <context-param>
       <param-name>defaultHtmlEscape</param-name>
       <param-value>true</param-value>
    </context-param>
    <listener>
        <listener-class>
            org.springframework.web.context.ContextLoaderListener
        </listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
    </listener>
    <listener>
        <listener-class>
            org.springframework.security.web.session.HttpSessionEventPublisher
        </listener-class>
    </listener>
    <servlet>
        <servlet-name>dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:/spring/spring-companyFinance-mvc-context.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>dispatcher</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy
                </filter-class>
    </filter>

    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <welcome-file-list>
        <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
</web-app>

Could you tell me where I am wrong?

2
  • check this post here, seems related stackoverflow.com/questions/15818047/…
    – MWiesner
    Commented Aug 12, 2016 at 13:22
  • spring configuration files are not in WEB-INF folder it is in confg.jar(METAINF/spring/ in module conf I have all xml files and once the build is done it will create conf.jar and xml files will move to META-INF/spring/) Commented Aug 12, 2016 at 13:42

0

Browse other questions tagged or ask your own question.