3 Replies Latest reply on Nov 6, 2012 5:21 PM by charlie7

    Class Hierarchy not working with Blueprint

    charlie7

      I tried with the Apache Aries tutorial and I am able to get Blueprint working with Interfaces as follows

       

      TestAppProj (contains Interface - com.link.si.services.TestService  : OSGI Bundle)

       

      TestServiceProj (Contains Service class - com.link.si.services.impl.TestServiceImpl : OSGI Bundle). The Service class in TestService implements the interface in TestApp

       

      The config.xml is as follows

       

      <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">

             

               <!-- The service classfrom TestService Project which implements TestService Interface -->

                   <bean id="testservice"

                           class="com.link.si.services.impl.TestServiceImpl">

                   </bean>

       

              <!-- The interface from TestApp -->

                  <service ref="testservice"

                           interface="com.link.si.services.TestService" />

      </blueprint>

       

      ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

      However if I bring in one more Project

       

      TestLibProj (contains abstract class - com.link.si.services.TestAbstract : OSGI Bundle )

       

      and have the Service class in TestServiceProj extend the abstract class like

       

      public class TestServiceImpl extends TServiceAbstract implements BounceService

       

      I get a class not found exception

       

      Is there any way that I can mention an abstract class configuration also in the blueprint config.xml

       

      Thanks for any help in advance

        • 1. Re: Class Hierarchy not working with Blueprint
          ulrichromahn

          Hi Charlie7,

           

          I don't think anybody will be able to help you without getting a few details about your project.

          1. Would it be possible to post or attach the entire stack trace?
          2. Could you post or attach the MANIFEST.MF files from both bundles?

          The reason for your issue could be related to some generic OSGi issues and may have nothing to do with Blueprint.

          • 2. Re: Class Hierarchy not working with Blueprint
            thomas.diesler

            Yes this sounds like a generic OSGi issue. If the abstract thing is supposed to be private to the service thing - it needs to be embedded witht the appropriate Bundle-Classpath set. If it is intended to be shared it needs to export some package capability (i.e. Export-Package: some.package.other.than.the.service.package) - the service bundle then needs to have a package requirement (i.e Import-Package: some.package.other.than.the.service.package)

            • 3. Re: Class Hierarchy not working with Blueprint
              charlie7

              yes . that was the issue

               

              Both the projects , interfaces and the one with abstarct classes  were having the same package structure. (com.link.si.services)

              After changing them and the Export-Package structure its working now.

               

              Thanks Thomas