1 Reply Latest reply on Mar 8, 2012 5:25 PM by grossetieg

    Declare global class path resource

    grossetieg

      Hi,

       

      I use the excellent FAQ about JBossWS http://community.jboss.org/wiki/JBossWS-AS7FAQ to configure Spring with JBossWS-CXF. In my jbossws-cxf.xml I declare the following property-placeholder :

      <context:property-placeholder location="my.properties" />
      

       

      I want my.properties to be global for my.ear (standalone mode). So I put my.properties in the standalone/configuration folder but I get the following error :

      Caused by: org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [wafservice.properties] cannot be opened because it does not exist
      

       

      I also tried to put my.properties in standalone/my.ear/ but I get the same exception. How can I add a "global dependency" for my.ear deployment unit (and subunit) on a property file ?

       

       

      Thanks,

      Guillaume Grossetie

       

      I run jboss-7.0.0.CR1 with ./standalone.sh --server-config standalone-preview.xml

        • 1. Re: Declare global class path resource
          grossetieg

          I found my answer here : https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7

          Change ResourceBundle location
          
          In previous versions of AS, the JBOSS_HOME/server/<servername>/conf/ was available in the classpath. Hence the properties files in that location were available in the classpath of the application. 
          
          In AS7, to get those properties available in the classpath, package them within your application. For example, if you are deploying a .war then package those properties in WAR WEB-INF/classes/ folder. If you want those properties accessible to all components in a .ear, then package them at the root of some .jar and place that jar in EAR lib/ folder.
          

           

          my.properties is now package into a .jar and place in EAR/lib folder.

           

           

          Guillaume.