6 Replies Latest reply on Dec 26, 2012 3:59 AM by Claus Ibsen

    Camel: Failed to resolve endpoint: hazelcast [SOLVED]

    fivcsw Newbie

      Hi,

      I am trying to use Camel with Hazelcast. I added these dependencies to pom, all with version 2.9.0.fuse-70-097:

      • camel-core

      • camel-hazelcast

       

      If I scope them to compile, it works all OK, routes are created, they put something to hazelcast and read from hazelcast. But if I scope camel-core and camel-hazelcast to provided I get this exception:

       

      org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: hazelcast://map:foo due to: No component found with scheme: hazelcast

       

      Before I start and install the bundle I do this:

       

      features:install camel-hazelcast

       

      And this is the output of list | grep hazelcast:

       

      \[ 216\] \[Active     \] \[            \] \[       \] \[   50\] camel-hazelcast (2.9.0.fuse-70-097)

      \[ 217\] \[Active     \] \[            \] \[       \] \[   50\] hazelcast (1.9.4.6)

       

      I am using this reference in blueprint.xml just in case:

       

       

       

      Then I install the bundle successfully, but when I start it, I get the above exception. As I said, it all works if I scope camel-core and camel-hazelcast to compile, but I want to use the provided hazelcast, of course.

       

      Any help appreciated...

       

      Edited by: ymy54 on Dec 24, 2012 11:48 AM

        • 1. Re: Camel: Failed to resolve endpoint: hazelcast
          Freeman(Yue) Fang Master

          Hi,

           

          Why you need use provided scope?

          I think the problem comes from that when you use provided scope, maven-bundle-plugin can't generate correct OSGi metadata header, most likely miss some important Import-Package.

          You can compare the OSGi metadata header of your customer bundle between use "compile" and "provided"

           

          Freeman

          • 2. Re: Camel: Failed to resolve endpoint: hazelcast
            Claus Ibsen Master

            Do you use FAB to install your application or regular OSGi bundle?

            • 3. Re: Camel: Failed to resolve endpoint: hazelcast
              fivcsw Newbie

              I compared the headers of both bundles using osgi:headers, then copied the imports from the working bundle (with scope compile) to the one with scope provided. Still same error.

               

              Then I set the version explicitly to 2.9.0.fuse-70-097.

               

              I further added this import:

               

              org.apache.camel.component.hazelcast;resolution:=optional;version="2.9.0.fuse-70-097"

               

              osgi:headers lists it in white and not red, so I guess it is resolved fine. But I still get the same error when I start the bundle.

               

              @davsclaus: to get started, I am packaging as bundle. Once I get that working, I plan to change that to jar and use FAB deployment.

              • 4. Re: Camel: Failed to resolve endpoint: hazelcast
                fivcsw Newbie

                I am now deploying as FAB. I get same error as with bundle, that is: "No component found with scheme: hazelcast"

                 

                With FAB I get that error even if I set the scope of camel-core and camel-hazelcast to compile and use this extra manifest entry:

                <FAB-Provided-Dependency>

                  org.apache.camel:camel-blueprint

                  org.apache.cxf:*

                  org.apache.activemq:*

                </FAB-Provided-Dependency>

                 

                I thought this should force Fuse ESB to compile any artifacts from org.apache.camel except camel-blueprint. Anyway, I set scope to compile for testing only, I need scope provided in the long run.

                 

                Ideally, it should work with default manifest headers:

                <FAB-Provided-Dependency>

                  org.apache.camel:*

                  org.apache.cxf:*

                  org.apache.activemq:*

                </FAB-Provided-Dependency>

                 

                I tried even manually deploying hazelcast-1.9.4.4.jar, camel-core-2.9.0.jar and camel-hazelcast-2.9.0.jar. osgi:list shows them all active, then I install and start my own bundle and same as before, I get "No component found with scheme: hazelcast"

                 

                Edit: Since there is camel-hazelcast feature included with Fuse ESB and I can install it with:

                features:install camel-hazelcast

                It installs hazelcast and camel-hazelcast. I wonder, is there an example on using this feature? If I am not mistaken, this feature is intended to be used by projects that have camel-hazelcast scope set as provided.

                 

                Edit2: It seems camel-hazelcast bundle is the problematic one. If I package my project as bundle, it works if camel-hazelcast scope is compile. The other two (camel-core and hazelcast) can be provided, i.e., I can set camel-core to provided and set Embed-Transitive to false. The hazelcast 1.9.4.6 bundle from Fuse ESB is used. camel-hazelcast 2.9.0.fuse-70-097 still has to be compiled, although it is an active bundle in Fuse ESB, just like hazelcast bundle.

                 

                Edited by: ymy54 on Dec 4, 2012 1:57 PM

                • 5. Re: Camel: Failed to resolve endpoint: hazelcast
                  fivcsw Newbie

                  Some more diagnostics for the case of FAB deployment where the scope of camel-hazelcast is set to compile, but despite this I get "No component found with scheme: hazelcast"

                   

                  Attached is the output of:

                  • fab:tree

                  • fab:info

                  • fab:headers

                   

                  As I suspected, camel-hazelcast does not get compiled (it is not listed under Non-shared dependencies by fab:info, see the attached file), although its scope is compile and <FAB-Provided-Dependency> is:

                   

                                                          org.apache.camel:camel-blueprint

                                                          org.apache.camel:camel-core

                                                          org.apache.camel:camel-test

                                                     activemq     org.apache.cxf:*

                                                          org.apache.activemq:*

                   

                  Edit: I tried with the new Fuse ESB 7.1.0 that has just been released and it works OK, hazelcast is found successfully. Thanks!

                   

                  Edited by: ymy54 on Dec 24, 2012 11:44 AM

                  • 6. Re: Camel: Failed to resolve endpoint: hazelcast
                    Claus Ibsen Master

                    Thanks for sharing your solution.