Announcement Announcement Module
Collapse
No announcement yet.
Problem loading a bean due to a missing xml file in the context Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem loading a bean due to a missing xml file in the context

    Hello,

    I need your help to understand why I am not able to load a spring bean because of the following error:

    Caused by: java.io.FileNotFoundException: ServletContext resource [/${config.myfile.location:config:config/myfileConfig.xml}] cannot be resolved to URL because it does not exist


    I don't understand why this happens because I've placed the myfileConfig.xml file into the classpath (within a source folder) and cannot be seen anyway. Note that this is a web application running on tomcat.

    What I guess is that there should be some property placeholder somewhere, but I am not sure and I don't understand the ":" between location and config. I would also say that the myfileConfig.xml file is expected to be located into a directory called "config".

    Can somebody put me on the right path to solve this problem please?

  • #2
    for web application, provide path from WEB-INF folder, i.e /WEB-INF/config/myfileConfig.xml, where file would be in config folder of WEB-INF.

    Hope it will help.

    Comment


    • #3
      Hi,

      thanks for replying.
      I've tried to put my config files into the /WEB-INF/config folder but it doesn't work. I tink there should be some property placeholder within my config file but I don't know exactly what to do.

      As far as I can see the *.xml files within the /WEB-INF/ directory are going to be seen from the container and the MVC Dispatcher Servlet is loaded.

      I've added the /WEB-INF/config directory and one subdirectory to the Web Deployment assembly in the project properties, but it seems nothing is changed. Note that I am using the workspace metadata as Tomcat directory installation (using the plugin) and not the Tomcat installation directory.
      Last edited by fbcyborg; Jan 19th, 2013, 06:58 AM.

      Comment

      Working...
      X