Announcement Announcement Module
No announcement yet.
managing directories for properties- and data.xml-files Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • managing directories for properties- and data.xml-files

    hi there,

    i'm using spring for some weeks. i'm shure that other people had the same question as me before, but i can't find anything in the documentation or the forum:

    i'm building a new tomcat-application. some settings used in the data.xml-file should be put in a properties-file for easy configuration.

    my directory structure is:

    this works in tomcat but there are two problems:
    1 having the properties in the home directory of the application isn't nice and i don't get tomcat to accept any other directory.
    2 if i wan't to unit-test bam-data.xml i get an error because the properties-file isn't found.

    if someone can help me just for the second point s/he would really help me. but what i really would like to have is the following directory structure working in tomcat and with unit-testing:

    thanks a lot, andreas

  • #2
    partial solution

    what i found out, is that this works:
    instead of using an ApplicationContext in Testing/main() this does the job:

    XmlBeanFactory factory = new XmlBeanFactory( new FileSystemResource(confSubDir+"bam-indexer-data.xml"));
    PropertyPlaceholderConfigurer cfg = new PropertyPlaceholderConfigurer();
    cfg.setLocation( new FileSystemResource(confSubDir+" operties"));

    Does anybody know a solution with ApplicationContext?

    Thanx, Andreas