Results 1 to 3 of 3

Thread: Config file applicationContext.xml into a .jar file.

  1. #1
    Join Date
    Aug 2004
    Posts
    7

    Default Config file applicationContext.xml into a .jar file.

    Hello to all. How i can to configure an ApplicationContext (may be ClassPathXmlApplicationContext?) if the configuration file (applicationContext.xml) is in a jar file within the classpath but outside the ear?

  2. #2
    Join Date
    Aug 2004
    Location
    San Mateo, CA
    Posts
    1,265

    Default

    You can use the classpath: prefix to tell Spring to load from the classpath. ClassPathXmlApplicationContext loads from the classpath anyway, but the classpath: prefix also works in WebApplicationContext implementations.

    Normally EARs should be self-contained: that's the intent of the J2EE spec. However, to meet one unusual requirement I used the classpath: mechanism to load a config file in a JAR on the Tomcat shared classpath; it works fine.
    Rod Johnson - GM, SpringSource Division, VMware
    http://www.springsource.com
    Spring From the Source

  3. #3
    Join Date
    Aug 2004
    Posts
    7

    Default

    Quote Originally Posted by Rod Johnson
    You can use the classpath: prefix to tell Spring to load from the classpath. ClassPathXmlApplicationContext loads from the classpath anyway, but the classpath: prefix also works in WebApplicationContext implementations.
    ok, i will try with this, thanks

    Quote Originally Posted by Rod Johnson
    Normally EARs should be self-contained: that's the intent of the J2EE spec. However, to meet one unusual requirement I used the classpath: mechanism to load a config file in a JAR on the Tomcat shared classpath; it works fine.
    Yes, i agree with you. In jar we have configuration files of services. We have separated jar of ear for being able to modify the configuration files and that the services are reshaped.

    Thanks for your time, and excuse me for my english.

Similar Threads

  1. Replies: 2
    Last Post: Apr 12th, 2012, 09:34 AM
  2. Replies: 19
    Last Post: Sep 10th, 2007, 12:46 PM
  3. Saving large files to a db using hibernate?
    By Dan Washusen in forum Data
    Replies: 10
    Last Post: Sep 20th, 2006, 12:18 PM
  4. Replies: 2
    Last Post: May 2nd, 2005, 05:33 AM
  5. Replies: 8
    Last Post: Mar 3rd, 2005, 06:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •