2 Replies Latest reply on Apr 17, 2014 7:39 AM by rahul vashishth

    OSGi Admin Service Configuration - not deploying in Fuse IDE

    rahul vashishth Novice

      Hi,

      I am trying to implement the OSGi admin service configuration as explained in the below link..

      Issue with mine is that i am able to deploy on redhat-fuse-standalone-server but when i run my camel context in

      fuse ide, it is not able to start there saying namespace not found exception

       

      Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/osgi-compendium]

      Offending resource: class path resource [META-INF/spring/UserProfileSpringContext.xml]

       

      https://access.redhat.com/site/documentation/en-US/JBoss_Fuse/6.0/html/Getting_Started/files/Develop-Configure.html

      I have modified the osgi admin config accordingly..

      Below my configuration ---

       

      My Bean configuration file

       

      <beans xmlns="http://www.springframework.org/schema/beans"

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://camel.apache.org/schema/cxf"

        xmlns:osgi="http://www.springframework.org/schema/osgi"

        xmlns:osgix="http://www.springframework.org/schema/osgi-compendium"

        xmlns:ctx="http://www.springframework.org/schema/context"

        xsi:schemaLocation="

               http://www.springframework.org/schema/beans

               http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

               http://camel.apache.org/schema/cxf

               http://camel.apache.org/schema/cxf/camel-cxf.xsd

               http://www.springframework.org/schema/osgi

               http://www.springframework.org/schema/osgi/spring-osgi.xsd

               http://www.springframework.org/schema/osgi-compendium

               http://www.springframework.org/schema/osgi-compendium/spring-osgi-compendium.xsd

               http://www.springframework.org/schema/context

               http://www.springframework.org/schema/context/spring-context.xsd">

       

       

          <!-- Configuration Admin entry -->

          <osgix:cm-properties id="cmProps"

              persistent-id="com.my.fabric.lb">

            <prop key="portNumber">10226</prop>

          </osgix:cm-properties>

         

          <!-- placeholder configurer -->

          <ctx:property-placeholder properties-ref="cmProps" />

         

        <cxf:rsServer id="userProfileService"

        address="http://{{esb.license.service.host}}:${portNumber}/userProfile"

        serviceClass="com.my.esb.service.licence.GetLicenceThresholdServiceImpl"

        loggingFeatureEnabled="true">

        <cxf:providers>

                  <bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>

              </cxf:providers>

        </cxf:rsServer>

      </beans>

       

      in POM file i have added the following dependency

      <dependency>

                  <groupId>org.fusesource.fabric</groupId>

                  <artifactId>fabric-cxf</artifactId>

                  <version>7.0.1.fuse-084</version>

              </dependency>

       

      My camel file has imported the bean configuration file.

      Now when i deploy this into a standalone redhat-jboss-fuse-server it is working fine.

      But after this i am not able to run it into my fuse ide. Is there any jar i am missing.

      Please help me on this.

        • 1. Re: OSGi Admin Service Configuration - not deploying in Fuse IDE
          Claus Ibsen Master

          You cannot run everything from within Fuse IDE.

           

          As you are using spring xml that are using OSGi compendium, eg you have it in the xml declaration etc, then the spring xml files is now depent on OSGi. And this cannot run outside the real OSGi container. And therefore you cannot run it in Fuse IDE.

           

          If the Spring XML file has no OSGi dependencies, then its just a regular spring xml file, and you can run it from Fuse IDE.

           

          If you use OSGi blueprint, then you can run it from Fuse IDE as well, as we use a little simulated OSGi environment called pojosr (though its not a full fledge OSGi container, so some advanced osgi stuff is not possible) and that supports osgi compendium and using osgi placeholders, which you can run from Fuse IDE as well.

          • 2. Re: OSGi Admin Service Configuration - not deploying in Fuse IDE
            rahul vashishth Novice

            Thanks, I understand,

            I am having one more issue regarding the use of "OSGi Config Admin Services". As per the docs i have created a cfg file in Fuse_Home/etc directory. and trying to load that by providing the cfg file name in persistence-id of osgix:cm-properties tag, now i restarted my server and child containers but its not loading the property from the cfg file.

            I am able to read the properties only if add the property file in Fuse Management Console > Profiles > Config Files. But my requirement is to have a centralized property config file at server level so i can share the data_src and other properties across all my child containers and profiles.