1 Reply Latest reply on Aug 13, 2010 9:03 PM by Freeman(Yue) Fang

    Call property which is defined in another bundle from Java DSL

    bagavathysivaraman Newbie

      Hi,

       

      I have created bundle for property file (sample.properties).In pom.xml, I export the package.

      I can able to successfully call that property file from another bundle.For that I used spring DSL. Below are the code to import that property file in camel-context.xml.

       

           

       

      I can able to read the property file which defined in sample.properties.

       

      IN ONE case am using Java DSL.There am facing the issue.I tried to call it as follows

       

      InputStream propStream = BundleContext.class.getResourceAsStream("com/my/sample/test/sample.properties");

      Properties props = new Properties();

                   try {

                       props.load(propStream);

                       propStream.close();

                   } catch (IOException e) {

                       e.printStackTrace();

                   }

                   SAMPLE_URL_1 = props.getProperty("sample.url");

                    

       

      InputStream propStream = *PropertyPlaceholderConfigurer.class.getResourceAsStream("com/my/sample/test/sample.properties");

          try {

                       props.load(propStream);

                       propStream.close();

                   } catch (IOException e) {

                       e.printStackTrace();

                   }

                   SAMPLE_URL_1 = props.getProperty("sample.url");

       

      But both are failed.

       

      Could any one help me to call property file in budle from java dsl.

       

       

      Regards,

      Saji