0 Replies Latest reply on Mar 24, 2016 1:27 AM by Muthu Veerappan

    Fuse Fabric - using same PID in two different profiles to hold different values

    Muthu Veerappan Newbie

      I have two profiles,

      profile3 with PID com.test.profile 'url:fuseGateway3' and project fuse-gatway-test 1.0.0 

      profile4 with PID com.test.profile 'url:fuseGateway4' with bundle fuse-gateway-test 1.0.1

       

      Fuse-gateway-test is a simple CXF project with a get operation. There is no difference between the two versions also, am trying to change the value of PID url, so that same services get deployed with different cxf URLs.

       

      When using same PIDs, I get the following error and only fuseGateway4 endpoint is active in http://localhost:8182/cxf.

       

      Note : If I manually override the properties in the blueprint without using PID or use a different PID, then it works fine. Both URLs are active.

       

      Error Log:

       

      2016-03-23 17:49:11,052 | ERROR | ool-167-thread-1 | BlueprintCamelContext            | 476 - org.apache.camel.camel-blueprint - 2.15.1.redhat-620133 | Error occurred during starting Camel: CamelContext(httpGatewayContext) due There is an endpoint already running on /fuseGateway4.

      org.apache.cxf.service.factory.ServiceConstructionException: There is an endpoint already running on /fuseGateway4.

        at org.apache.cxf.jaxrs.JAXRSBindingFactory.addListener(JAXRSBindingFactory.java:85)

        at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:123)

        at org.apache.camel.component.cxf.jaxrs.CxfRsConsumer.doStart(CxfRsConsumer.java:50)

        at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)

        at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2869)[479:org.apache.camel.camel-core:2.15.1.redhat-620133]

        at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:3163)[479:org.apache.camel.camel-core:2.15.1.redhat-620133]

        at org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:3099)[479:org.apache.camel.camel-core:2.15.1.redhat-620133]

        at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:3029)[479:org.apache.camel.camel-core:2.15.1.redhat-620133]

        at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:2797)[479:org.apache.camel.camel-core:2.15.1.redhat-620133]

        at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:2653)[479:org.apache.camel.camel-core:2.15.1.redhat-620133]

        at org.apache.camel.impl.DefaultCamelContext.access$000(DefaultCamelContext.java:167)[479:org.apache.camel.camel-core:2.15.1.redhat-620133]

        at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2467)

        at org.apache.camel.impl.DefaultCamelContext$2.call(DefaultCamelContext.java:2463)

        at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:2486)[479:org.apache.camel.camel-core:2.15.1.redhat-620133]

        at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:2463)[479:org.apache.camel.camel-core:2.15.1.redhat-620133]

        at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)

        at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:2432)[479:org.apache.camel.camel-core:2.15.1.redhat-620133]

        at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:180)

        at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:212)

        at org.apache.camel.blueprint.BlueprintCamelContext.serviceChanged(BlueprintCamelContext.java:150)

        at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:943)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:794)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4445)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.Felix.registerService(Felix.java:3431)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)

        at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:353)

        at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:100)

        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0_74]

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0_74]

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0_74]

        at java.lang.reflect.Method.invoke(Method.java:498)[:1.8.0_74]

        at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)[14:org.apache.aries.blueprint.core:1.4.2]

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_74]

        at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:682)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:377)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:294)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:263)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:253)[14:org.apache.aries.blueprint.core:1.4.2]

        at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[9:org.apache.aries.util:1.1.0]

        at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[9:org.apache.aries.util:1.1.0]

        at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[9:org.apache.aries.util:1.1.0]

        at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[9:org.apache.aries.util:1.1.0]

        at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[9:org.apache.aries.util:1.1.0]

        at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1127)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4429)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.Felix.startBundle(Felix.java:2100)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976)[org.apache.felix.framework-4.4.1.jar:]

        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963)[org.apache.felix.framework-4.4.1.jar:]

        at io.fabric8.agent.service.Agent$BaseDeployCallback.startBundle(Agent.java:456)[83:io.fabric8.fabric-agent:1.2.0.redhat-133]

        at io.fabric8.agent.service.Deployer$3.call(Deployer.java:856)[83:io.fabric8.fabric-agent:1.2.0.redhat-133]

        at io.fabric8.agent.service.Deployer$3.call(Deployer.java:851)[83:io.fabric8.fabric-agent:1.2.0.redhat-133]

        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_74]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_74]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_74]

        at java.lang.Thread.run(Thread.java:745)[:1.8.0_74]

      Blueprint XML

       

      <?xml version="1.0" encoding="UTF-8"?>

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

        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"

        xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"

       

       

        xsi:schemaLocation="

        http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd

        http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd

        http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd">

       

       

        <cm:property-placeholder persistent-id="com.test.profile"

            placeholder-prefix="${" placeholder-suffix="}">

             <cm:default-properties>

                  <cm:property name="url" value="xxxx" />

             </cm:default-properties>

        </cm:property-placeholder>

       

       

        <cxf:rsServer id="gatewayEndpoint" address="/${url}"

        serviceClass="com.mycompany.fuse.gateway.test.GatewayFacade" />

       

        <camelContext id="httpGatewayContext"

        xmlns="http://camel.apache.org/schema/blueprint">

       

        <route id="beerRoute">

             <from uri="cxfrs:bean:gatewayEndpoint" />

             <log message="wooHoo!! did the routing correctly! for /rest/beer" />

             <transform>

                  <constant>Something is wrong in VM 2.000000!!!!!!!!!!!!</constant>

             </transform>

        </route>

        </camelContext>

      </blueprint>

      Screenshot1.JPGScreenshot2.JPG