7 Replies Latest reply on Oct 27, 2011 11:44 PM by mpalvankar

    Routing to POJO - not working

    mpalvankar

      I have created to bundles.

       

      1. POJO service bundle - this is a simple POJO with the interface and only one method with one String parameter and return as String. This bundle uses blueprint to declare the bean and registering with registry.

       

       

      When I deply these budles and perform osgi:list, I see following on colsole:

      DataValidation OSGi Service (1.0.0.SNAPSHOT)

      Service Routing as OSGi (1.0.0.SNAPSHOT)

       

      Questions:

      1. The routing is not getting invoked as I do not see any SOPs on the console. Is there anything missing in configurations of both bundles?

      2. What does for Service Routing as OSGi mean?

      3. A similar example in examples of FUSE ESB (camel-blueprint) works but my routing bundle doe not work. Is there anything missing in bundles?

         

      Appreciate help on this issue.

        • 1. Re: Routing to POJO - not working
          ffang

          Hi,

           

          GracePeriod  means something wrong when start blueprint in that bundle, so that OSGi service register/reference from blueprint won't work in that case, you need check data/log/servicemix.log to see if there's any exception there when start your bundle.

           

          Freeman

          • 2. Re: Routing to POJO - not working
            gertv

            L.S.,

             

             

            It looks like your have the Blueprint and Spring XML syntax mixed up here.  The second example is using Spring namespaces, so if you put this into a Blueprint XML file it will go GracePeriod.  If you're using Blueprint to define the Camel routes, you should be using the namespace mentioned in http://camel.apache.org/using-osgi-blueprint-with-camel.html instead.

             

             

            Regards,

             

            Gert

            • 3. Re: Routing to POJO - not working
              mpalvankar

              I checked the logs too. There is no exception nor error in the log file for the routing bundle. I have also attached the logs for reference.

               

              I see only one line added in the logs after deployment of routing bundle which is s below:

               

              13:44:19,484 | INFO  | rint Extender: 1 | BlueprintContainerImpl           | 10 - org.apache.aries.blueprint - 0.3.1 | Bundle osgi-reportingservice-routing-bundle is waiting for namespace handlers

              • 4. Re: Routing to POJO - not working
                njiang

                Can you check if DataValidation OSGi Server bundle export the service rightly ?

                • 5. Re: Routing to POJO - not working
                  mpalvankar

                  Gert:

                   

                  I chaned the config.xml to remove the spring namespaces and use blueprint namespaces.

                   

                  Below are the contents of config.xml files in both POJO service bundle and Route bundle.

                   

                  1. config.xml in POJO service bundle

                   

                   

                  -


                   

                  And for DataValidation OSGi Service bundle, I see this bundle as Active with osgi:list and I guess it has exported the service.

                  Secondly, I have also declared export package in my pom.xml

                  <Export-Package>org.datavalidation.service</Export-Package>

                   

                  Is there any other way to see if the undle has expoted the service rightly?

                   

                  -


                   

                  I am still facing the same issue and the routing bundle has GracePeriod after the deployment.

                  • 6. Re: Routing to POJO - not working
                    gertv

                    L.S.,

                     

                     

                    If the blueprint status says "GracePeriod", you should be looking in your log file for messages like "Bundle osgi-reportingservice-routing-bundle is waiting for ..." as the one you found before.  The grace period is intended to give you a chance to install the additional bundles to provide the missing elements and that message will tell you what it is waiting for.

                     

                    In your case, I still think that the camelContext namespace is wrong here - it should read "http://camel.apache.org/schema/blueprint" instead of ""http://camel.apache.org/schema/spring" if you're using Blueprint.

                     

                    BTW, to list the services that a bundle is providing, you can use the command osgi:ls followed by the bundle id.

                     

                     

                    Regards,

                     

                    Gert

                    • 7. Re: Routing to POJO - not working
                      mpalvankar

                      Thanks Gert for the resolution and the explanation for GracePeriod.

                       

                      After changing the namespace for camelContext, my application worked successfully.

                       

                      Thank you again for all support.