Results 1 to 3 of 3

Thread: Can't seem to externalize my placeholder property files.

  1. #1
    Join Date
    Jun 2005
    Location
    Philly
    Posts
    199

    Default Can't seem to externalize my placeholder property files.

    I have the following code:

    <bean id="jdbcPropertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <!--<property name="location"><value>/WEB-INF/classes/bhff.jdbc.properties</value></property>-->
    <property name="location"><value>bhff.jdbc.properties</value></property>
    </bean>

    <!-- Local DataSource that works in any environment -->
    <!-- Note that DriverManagerDataSource does not pool; it is not intended for production -->
    <!-- See JPetStore for an example of using Commons DBCP BasicDataSource as alternative -->
    <!-- See Image Database for an example of using C3P0 ComboPooledDataSource as alternative -->
    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverM anagerDataSource">
    <property name="driverClassName"><value>${jdbc.driverClassNa me}</value></property>
    <property name="url"><value>${jdbc.url}</value></property>
    <property name="username"><value>${jdbc.username}</value></property>
    <property name="password"><value>${jdbc.password}</value></property>
    </bean>


    When I uncomment the >/WEB-INF/classes/bhff.jdbc.properties property, and put that property into my war, this works fine. But I need to be able to change these values without rebuilding and redeploying my code. And spring can't seem to find this when I put in into my server/default/conf directory for JBoss.
    Also, I am planning to move to WAS5 and have to figure out where to be able to put this file to access it in WAS as well.

  2. #2
    Join Date
    Aug 2004
    Location
    Amsterdam, Netherlands
    Posts
    450

    Default

    (The JBoss/server/default/conf directory is available from the JBoss API: ServerConfigLocator.locate() returns a ServerConfig which has a method to retrieve the server configuration directory.)

    You could develop your own ResourceEditor or extend the PropertyPlaceholderConfigurer to get to the resource or you could put the file in the filesystem and reference it directly (use file: as a prefix for the resource; this should work AFAIK).

    rgds,
    alef
    Alef Arendsen
    SpringSource
    http://www.springsource.com

  3. #3
    Join Date
    Jun 2005
    Location
    Philly
    Posts
    199

    Default

    Where should I place my properties file, outside of my ear, and where I do not have to extend any classes?

Similar Threads

  1. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  2. Unit testing with JOTM and JtaTransactionManager
    By lalle in forum Architecture
    Replies: 1
    Last Post: Oct 15th, 2005, 09:05 AM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. Replies: 4
    Last Post: Aug 17th, 2005, 04:42 AM
  5. Replies: 2
    Last Post: May 13th, 2005, 05:42 AM

Posting Permissions

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