You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Saripaka, Chandrasekhar" <CS...@Templeton.com> on 2008/06/05 08:54:39 UTC

Problem with Loading Properties Files..

 

Hi,

 

    The current task is Integration of Axis with Spring.For this ,Spring
Init as the Initialization Class with Axis Service is used, I am able to
load the Spring related beans but I am unable to load the properties
files and the 

Some db related xml Queries in the Context. Can You Please suggest me
the way to do this. What is the exact location of placing this
properties files.

 

The code from Spring Init Startup method Goes Like this..

 

public void startUp(ConfigurationContext ignore, AxisService service) {

        try {

            System.out.println("Starting spring init");

            ClassLoader classLoader = service.getClassLoader();

            ClassPathXmlApplicationContext appCtx = new
ClassPathXmlApplicationContext(new String[] {

 
"applicationContext.xml,beans.xml,beans-validation.xml"

                    }, false);

            

            //For Setting the Bean Factory to the DroseCentralFactory
through a Custom Processsor

            

            CustomBeanFactoryPostProcessor postprocessor = new
CustomBeanFactoryPostProcessor();

            appCtx.addBeanFactoryPostProcessor(postprocessor);

            appCtx.setClassLoader(classLoader);

            

            

            

            //Configuration No2 For Properties Loading

            

            PropertyPlaceholderConfigurer configurer = new
PropertyPlaceholderConfigurer();

            //AbstractApplicationContext context = new
ClassPathXmlApplicationContext("applicationContext.xml");

 

            //Configuration No 1 For Properties Loading

            

            Properties props = new Properties();

            props.load(classLoader.getResourceAsStream(

                    "ApplicationResources.properties"));

            props.load(classLoader.getResourceAsStream(

                    "query-file-names-conf.properties"));

            props.load(classLoader.getResourceAsStream(

                    "factory-conf.properties"));

            

 

            configurer.setProperties(properties);

            appCtx.addBeanFactoryPostProcessor(configurer);

            

                  //Property.configure( props);

            appCtx.refresh();

            System.out.println("spring loaded");

        } catch (Exception ex) {

            ex.printStackTrace();

        }

    }

 

I got the exception as , the file ApplicationResources.properties does
not exist..it is coming..I placed the files in the same path of the
applicationContext.xml..Even I tried loading the properties files with
the DefaultResourceLoader..but still the same problem persists..Please
respond me soon for this Query.

 

Solution in Anticipation..

Thanks & Regards,

Chandra Sekhar S.V.R | Programmer Anlayst| Franklin Templeton
International Services (India) Pvt Ltd Franklin Templeton Park, Plot No.
18-23,Financial District,Nanakramguda,Hyderabad - 500019 | Tel: +91 40
66972779 | Fax: +91 40 66971010|Mobile: +91 98662 21243 |VOIP:
(Extn:32779) | www.franklintempleton.com

 

Notice:  All email and instant messages (including attachments) sent to
or from Franklin Templeton Investments (FTI) personnel may be retained,
monitored and/or reviewed by FTI and its agents, or authorized
law enforcement personnel, without further notice or consent.