Results 1 to 3 of 3

Thread: Classpath* in context:property-placeholder doesnt pick system classpath

  1. #1
    Join Date
    Nov 2008
    Location
    London,UK
    Posts
    299

    Default Classpath* in context:property-placeholder doesnt pick system classpath

    I have modified system properties in dmk.sh to include extra file path as classpath

    Code:
         -classpath $CLASSPATH:/home/testfolder/ \
    I have a property file in testfolder - test.properties

    My bundle has the following in its spring xml


    Code:
       <context:property-placeholder  location="classpath*:test.properties" />
      
      <bean id="test" class="com.pg.external.Test">
         <property name="testProp" value="${testprop}"></property>
      </bean>

    Now my test.properties is not found.

    So it it expected to find the property fiel in classpath ?

    when i change it to

    <contextroperty-placeholder location="file:/home/testfolder/test.properties" />


    it works fine . Am i doing anything wrong here ?

  2. #2
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    It seems that "classpath" is mapped to the bundle class path rather than the application class loader classpath.
    Glyn Normington
    SpringSource

  3. #3
    Join Date
    Nov 2008
    Location
    London,UK
    Posts
    299

    Default

    Yes you are right.

    Configuration changes are required in java 6 profile config and an explicit import in bundle manifest for the bundle to see this property file.

Posting Permissions

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