10 Replies Latest reply on Jun 23, 2009 12:46 PM by simonepringle

    trying to work with examples shipped with SM4

    subodh.gupta

      hi,

       

      I am very new to SM4 and trying to work with examples shipped with SM4 FUSE realease. Following are doubts bothering me:

       

      1. should i always have to use the maven or bnd(for creatinf OSGi bundle) to deploy my project in the SM4 can't i use my eclipse project as it is because equinox(in eclipse) generates the MANIFEST.MF

       

      2. i am able to build the project with help of maven but when i drop my jar in deploy folder it's giving me following error for the bundle cxf-osgi-4.0.0.jar created by maven for on the example shipped with SM4

      smx@root:osgi> start 162

      ERROR CommandLineExecutionFailed: org.apache.geronimo.gshell.command.CommandException: org.osgi.fram

      ework.BundleException: Unresolved constraint in bundle 162: package; (package=META-INF.cxf.osgi)

       

      3. I am able to run another exmaple called camel-osgi but my doubt in that one is. the bean.xml is referring to the class file but the class is not bundled in the generated jar.

        • 1. Re: trying to work with examples shipped with SM4
          joe.luo

          1. should i always have to use the maven or bnd(for creatinf OSGi bundle) to deploy my project in the SM4 can't i use my eclipse project as it is because equinox(in eclipse) generates the MANIFEST.MF

           

          I'd like to make an assumption that you are developing your project using eclipse IDE with equinox based plugin and you would like to know whether you could deploy generated bundle from the eclipse project into the Fuse ESB container. Is my assumption correct?

           

          i am able to build the project with help of maven but when i drop my jar in deploy folder it's giving me following error for the bundle cxf-osgi-4.0.0.jar

           

          Normally this kind of error means that you have a dependency issue. But the error shown for the package name was kind of strange since it was looking for "META-INF.cxf.osgi" package. So if you could attach your pom.xml file or zip up your project and attach it, it would be definitely help to find out what was wrong.

           

          I am able to run another exmaple called camel-osgi but my doubt in that one is. the bean.xml is referring to the class file but the class is not bundled in the generated jar.

           

          I had a quick look at the demo that shipped with the fuse esb 4.1.0.0-fuse and the generated jar does contain MyTransform.class. Is this file what you were refereing to?

           

          In addition, I would strongly suggest you to use the latest Fuse ESB 4.1.0.0-fuse instead of 4.0.

          • 2. Re: trying to work with examples shipped with SM4
            subodh.gupta

            Thanks for your reply yes your first assumption is right i wanted to deploy the project which is there in my eclipse. I am able to do that and custom bundles are working well.

             

            I have started working on fuse esb 4.1.

             

            And lastly i made some mistake while looking through the jar, classes are deployed with module.

             

            But some more question which came up as i proceeded are:

             

            How to develop your own feature and deploy... what i mean is SM4 consist of several features like camel. jms etc. which are shipped and can be started and stopped based on the requirement, similarly can i build feature specific to my need and have it deployed like the other build in features.

            • 3. Re: trying to work with examples shipped with SM4
              joe.luo

              I believe you should be able to deploy your OSGI bundles that built in your eclipse platform with Equinox based plugin into the Fuse ESB 4.1 conatiner. But someone else might want to further clarify it.

               

              As for developing your own feature. You might want to have a look at this feature xml file:

              http://repo.open.iona.com/maven2/org/apache/servicemix/features/apache-servicemix/4.0.0.8-fuse/apache-servicemix-4.0.0.8-fuse-features.xml

              Basically, A feature is a mechanism for grouping together a list of bundles for realizing collectively a specific functionality/feature. So you can create a similar feature xml file to group together a list of your bundles and then add it as a feature URL (using features sub-shell "addUrl").

               

              Hope it helps.

              • 4. Re: trying to work with examples shipped with SM4
                simonepringle

                I have installed Fuse 4.1.0.0.  I followed the instructions to the tutorial documentation  (Fuse ESB - Getting Started) and cd InstallDir/examples/cxf-osgi

                 

                I then ran mvn install

                 

                Once the cxf-osgi-4.0.0-fuse.jar was created in the target directory, I copied it to the deploy directory.  I tried accessing the WSDL by using a browser: http://localhost:8080/cxf/HelloWorld?wsdl

                 

                I ran osgi list in ServiceMix and I could see that the bundle was installed but not active.

                 

                I restarted ServiceMix and I get the same error as listed above.

                 

                I have attached the pom.xml file for your reference.

                 

                Any ideas?

                 

                Thanks,

                Simone

                • 5. Re: trying to work with examples shipped with SM4
                  joe.luo

                  It was because you did not install "cxf-osgi" feature that the examples-cxf-osgi depends on. Just do:

                  "smx@root:features> install cxf-osgi"

                  and then start your example bundle by using "osgi > start" sub shell with  list| grep cxf-osgi

                    examples-cxf-osgi

                    cxf-osgi

                  smx@root:features>

                   

                  So you do not need to manually build the example and deploy it. So just install the "examples-cxf-osgi" features and ESB will install any dependent bundles/features (i.e. "cxf-osgi" feature) that required to start the demo.

                   

                  For more detail, please have a look at Fuse ESB 4.1 features xml file for "examples-cxf-osgi" feature:

                  http://repo.open.iona.com/maven2/org/apache/servicemix/apache-servicemix/4.1.0.0-fuse/apache-servicemix-4.1.0.0-fuse-features.xml

                  • 6. Re: trying to work with examples shipped with SM4
                    simonepringle

                    Thanks!

                     

                    That worked,

                    Simone

                    • 7. Re: trying to work with examples shipped with SM4
                      subodh.gupta

                      Hi,

                       

                       

                      I am trying deploy attached osgi module on SM4. The module is started but the camel route defined in META-INF/spring folder is not starting can you please point out the problem.

                       

                      Thanks In Advance,

                      Subodh

                      • 8. Re: trying to work with examples shipped with SM4
                        joe.luo

                        Please have a look at the "fuse-esb-4.1.0.0\examples\camel-osgi" demo "beans.xml" file under "fuse-esb-4.1.0.0\examples\camel-osgi\src\main\resources\META-INF\spring" directory.

                         

                        I believe you need to use "osgi" namespace

                        <osgi:camelContext ...

                        instead of

                        <camelContext ...

                         

                        Here is a bigger tutorial on Camel in FUSE ESB 4.x and you might find it helpful.

                        • 9. Re: trying to work with examples shipped with SM4
                          subodh.gupta

                          Hi,

                           

                          I am not using maven for deployment, so do i need to have the same package structure as that of maven?

                           

                          Also my MANIFEST.MF is inside <project-root>/META-INF how does SM4 reading it and not beans.xml.

                           

                          I have done the changes suggesd by you in beans.xml but still not running.

                           

                          Edited by: subodh.gupta on Jun 25, 2009 8:37 AM

                          • 10. Re: trying to work with examples shipped with SM4
                            subodh.gupta

                            Thanks Joe,

                             

                            I am able to run the spring bean xml from META-INF/spring/ folder problem was with my xml, i generated the camel-config.xml from FID 1.2  and deployed it, which is working fine. Thanks