1 2 Previous Next 16 Replies Latest reply on Jan 7, 2012 7:31 PM by Freeman(Yue) Fang

    FUSE ESB as a pass through?

    hello sir Newbie

      Hi there,


      Currently, I have two web services that call each other directly. I want to insert FUSE ESB in the middle as a straight pass through. What I want is for web service 1 to go through FUSE to get to web service 2.


      The format I'm trying to use is


      web service 1 --> endpoint-bc --> endpoint-se --> web service 2.


      Lets say that web service 1 invokes a "test" operation on web service 2 currently.


      What I want to happen now is that web service 1 invokes a "test" stub that then calls the actual "test" operation in web service 2.


      Is this a good way to implement something like this? Or is there an easier way?


      Thanks in advance.

        • 1. Re: FUSE ESB as a pass through?
          Marcelo Jabali Newbie



          I'd recommend you to take a look on the Apache Camel (FUSE Mediation Router) web service proxy sample available at  http://camel.apache.org/cxf-proxy-example.html


          Then you can host that web service proxy on FUSE ESB (ServiceMix).


          There is also a thread that Claus Ibsen responded a similar question mentioning the reasons to follow that approach  http://stackoverflow.com/questions/5939067/using-servicemix-to-proxy-remote-web-service ).


          Hope this helps,



          • 2. Re: FUSE ESB as a pass through?
            Freeman(Yue) Fang Master



            Yeah, if you start a new project from the scratch, then we suggest you use camel component but not the JBI component.


            If you have to stick to use JBI, then the work flow for your scenario is

            cxfbc:consumer===>cxfse(web service1)===>cxfse:proxy(web service2)====>cxfbc:provider


            the cxfse:proxy works as a normal object invocation

            Take a look at to get more details about how cxfse:proxy works, the "Proxies" part.





            • 3. Re: FUSE ESB as a pass through?
              hello sir Newbie

              Hi thanks for the help. I'm able to deploy the artifact into fuse esb 4.3.0, but when i try to start it i get this message


              karaf@root> Exception in thread "SpringOsgiExtenderThread-17" java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 're

              fresh' before accessing beans via the ApplicationContext

                      at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)

                      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.close(DependencyWaiterApplication


                      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.fail(DependencyWaiterApplicationC


                      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicat


                      at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicati


                      at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.j


                      at org.springframework.osgi.extender.internal.activator.ContextLoaderListener$2.run(ContextLoaderListener.java:718)

                      at java.lang.Thread.run(Thread.java:662)




              Is there some feature or bundle I need to install to get this to work in Fuse?


              Thanks in advance.

              • 4. Re: FUSE ESB as a pass through?
                Marcelo Jabali Newbie

                Couple of comments:

                - The current version of the FUSE ESB is 4.4.1. If you have no requirements to run your solution in 4.3 then you should move the latest release.

                - The reported exception doesn't tell us much. I'd suggest that you run:

                karaf@root> log:display

                and see if there is anything obvious there.

                - Can you tell us what approach are you using? Camel or JBI? Feel free to post your route  to give us a better idea how/what are you trying to do.



                • 5. Re: FUSE ESB as a pass through?
                  hello sir Newbie



                  We do have explicit instructions to be running 4.3.


                  In the servicemix.log,


                  this error seems to be what is causing the problem.



                  13:12:51,619 | ERROR | xtenderThread-17 | ContextLoaderListener            | 72 - org.springframework.osgi.extender - 1.2.0 | Application context refresh failed (OsgiBundleXmlApplicationContext(bundle=org.apache.camel.proxy, config=osgibundle:/META-INF/spring/*.xml))



                  org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace http://camel.apache.org/schema/cxf

                  Offending resource: URL bundleentry://227.fwk31664352/META-INF/spring/camel-config.xml


                       at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)[59:org.springframework.beans:3.0.5.RELEASE]

                  • 6. Re: FUSE ESB as a pass through?
                    Marcelo Jabali Newbie

                    Try running the following:

                    karaf@root> osgi:list |grep camel

                    and reporting the results back here in the forum...

                    • 7. Re: FUSE ESB as a pass through?
                      hello sir Newbie

                      Hi, we are using camel route.


                      Here is the camel-config.xml







                      • 8. Re: FUSE ESB as a pass through?
                        hello sir Newbie

                        karaf@root> osgi:list | grep camel


                        camel-core (2.6.0.fuse-03-01)

                        camel-spring (2.6.0.fuse-03-01)

                        camel-blueprint (2.6.0.fuse-03-01)

                        • 9. Re: FUSE ESB as a pass through?
                          hello sir Newbie

                          Quick backtrack...


                          In the example linked below,




                          I am able to run it using mvn camel:run.


                          Question is, how do I then deploy this example to run in fuse esb servicemix?

                          • 10. Re: FUSE ESB as a pass through?
                            Marcelo Jabali Newbie

                            Try adding the following to your pom file:




                            If I remember correctly you also need to install the camel-http feature before you deploy this bundle.

                            • 11. Re: FUSE ESB as a pass through?
                              hello sir Newbie



                              I added the plugin you suggested to my pom file, but still same error when I try to start the bundle.


                              i installed the






                              as you can see by the lines below


                              camel-cxf (2.6.0.fuse-03-01)

                              camel-http (2.6.0.fuse-03-01)

                              camel-spring (2.6.0.fuse-03-01)

                              camel-example-cxf-proxy (2.7.1.fuse-00-27)


                              when i run


                              karaf@root> osgi:start 205


                              this error occurs, and I cannot figure out what I am missing or doing wrong.


                              Please help! Thanks a lot in advance!!


                              Error executing command: The bundle "org.apache.camel.camel-example-cxf-proxy_2.7.1.fuse-00-27 " could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.camel.spring; version="[2.7.0,2.8.0)"




                              I also copied the error from the servicemix.log




                              org.osgi.framework.BundleException: The bundle "org.apache.camel.camel-example-cxf-proxy_2.7.1.fuse-00-27 " could not be resolved. Reason: Missing Constraint: Import-Package: org.apache.camel.spring; version="[2.7.0,2.8.0)"

                                   at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317)[osgi-3.6.0.v20100517.jar:]

                                   at org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301)[osgi-3.6.0.v20100517.jar:]

                                   at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319)[osgi-3.6.0.v20100517.jar:]

                                   at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)[osgi-3.6.0.v20100517.jar:]

                                   at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276)[osgi-3.6.0.v20100517.jar:]

                                   at org.apache.karaf.shell.osgi.StartBundle.doExecute(StartBundle.java:29)[27:org.apache.karaf.shell.osgi:2.1.6.fuse-01-01]

                                   at org.apache.karaf.shell.osgi.BundlesCommand.doExecute(BundlesCommand.java:49)[27:org.apache.karaf.shell.osgi:2.1.6.fuse-01-01]

                                   at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[14:org.apache.karaf.shell.console:2.1.6.fuse-01-01]

                                   at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[14:org.apache.karaf.shell.console:2.1.6.fuse-01-01]

                                   at org.apache.felix.gogo.runtime.shell.CommandProxy.execute(CommandProxy.java:50)[14:org.apache.karaf.shell.console:2.1.6.fuse-01-01]

                                   at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:229)[14:org.apache.karaf.shell.console:2.1.6.fuse-01-01]

                                   at org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:162)[14:org.apache.karaf.shell.console:2.1.6.fuse-01-01]

                                   at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:101)[14:org.apache.karaf.shell.console:2.1.6.fuse-01-01]

                                   at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:79)[14:org.apache.karaf.shell.console:2.1.6.fuse-01-01]

                                   at org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71)[14:org.apache.karaf.shell.console:2.1.6.fuse-01-01]

                                   at org.apache.karaf.shell.console.jline.Console.run(Console.java:170)[14:org.apache.karaf.shell.console:2.1.6.fuse-01-01]

                                   at java.lang.Thread.run(Thread.java:662)[:1.6.0_27]




                              here is the camel-config.xml


                              $/target/generated/src/main/java</sourceRoot>                             <wsdlOptions>                                 <wsdlOption>                                     <wsdl>$/src/main/resources/etc/report_incident.wsdl




                              The pom and camel-config are straight from the camel-example-cxf-proxy with the one plugin you had me put in.


                              To deploy the bundle, i did a "mvn install" and then copied the jar into the "deploy" folder of servicemix.


                              It installs, but is unable to start with that error message.

                              • 12. Re: FUSE ESB as a pass through?
                                Marcelo Jabali Newbie

                                On your pom file, where you have the camel-spring dependency:



                                Please let me know if that works for you...

                                • 13. Re: FUSE ESB as a pass through?
                                  hello sir Newbie

                                  Hi, I tried what you said and still the same error.

                                  • 14. Re: FUSE ESB as a pass through?
                                    Marcelo Jabali Newbie

                                    I noticed you're deploying the jar file onto the $SMX/deploy directory and that may be causing the issue once the camel version might not be matching.


                                    I could successfully deploy the sample on SMX 4.3.1 using the following in the ServiceMix console:


                                    karaf@root> osgi:install mvn:org.apache.camel/camel-example-cxf-proxy/2.6.0


                                    Hope this helps

                                    1 2 Previous Next