Results 1 to 6 of 6

Thread: Properties file outside .EAR file

  1. #1
    Join Date
    Oct 2006
    Posts
    25

    Default Properties file outside .EAR file

    Hi,

    This question was actually answered in an other thread but i got an error when trying to implement it. Below are the details.

    I am basically trying to get the ${jboss.server.dir} but got error saying that the jboss.server.dir could not be resolved.

    My idea is to access the properties file outside war file but for testing purpose i am trying to read the jboss server directory to check if the path is fetched. i wrote a simple pojo class and passed the jboss.server.dir param in the constrcutor arg and just printing it to see if it works. i also set the systemPropertiesMode=2 to always ready the properties from the system properties. but i am getting error.

    am i doing anything incorrect?

    thank you
    -darshan

    <beans>

    <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer">
    <property name="location" value="/WEB-INF/classes/test_application.properties"/>
    <property name="systemPropertiesMode" value="2"/>
    </bean>

    <!-- Ctest Configuration -->
    <bean id="ctest" class="com.util.TestUtil">
    <constructor-arg index="0">
    <value>${jboss.server.dir}</value>
    </constructor-arg>
    </bean>
    </beans>

  2. #2
    Join Date
    Oct 2006
    Posts
    25

    Default

    Here is the thread i was referring to.. i follwed what Chris Lee had suggested but dint work..
    http://forum.springframework.org/sho...roperties+file

  3. #3
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    Have you actually tried to System.out the property from your test class, just to see if the property is actually there at all?

  4. #4
    Join Date
    Oct 2006
    Posts
    25

    Default

    Hi Karl..

    great pointer...i did a system.out.println for jboss.server.dir and i got null as output.. So how should i go about this now.. when should the jboss.server.dir be set.

    Thanks
    Darshan

  5. #5
    Join Date
    Sep 2006
    Location
    UK
    Posts
    8,425

    Default

    I'm sorry, thats as far as my JBoss knowledge stretches . Atleast you know the property just isn't set, Spring config is fine. I guess my next stab would be jboss forums, manuals, etc....

  6. #6
    Join Date
    Oct 2006
    Posts
    25

    Default

    Thanks Karl.. Actually the key was wrong. I got the complete list of jboss keys from this link

    http://wiki.jboss.org/wiki/Wiki.jsp?...BossProperties

    Appreciate your help..

    Bye
    Darshan

Posting Permissions

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