Search code examples
apache-camelbundlejbossfuse

bundle stays in GracePeriod status


I am trying to instantiate a "cxf:cxfEndpoint" in my camel route. But the bundle stays in "GracePeriod" status with following log:

2016-11-10 11:03:07,598 | INFO  | rint Extender: 1 | BlueprintContainerImpl           | ? ? | 21 - org.apache.aries.blueprint.core - 1.4.2 | Bundle com.entreprise.example is waiting for namespace handlers [http://camel.apache.org/schema/blueprint]

And my camelContext.xml file is :

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws" xmlns:cxf="http://cxf.apache.org/blueprint/core"
xmlns:camel="http://camel.apache.org/schema/blueprint" xmlns:camelcxf="http://camel.apache.org/schema/blueprint/cxf"
xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd 
http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd 
http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd">

<camelcxf:cxfEndpoint id="fist"
    serviceClass="com.entreprise.example.services.firstService"
    address="http://localhost:8181/cxf/example/firstMsg">
    <camelcxf:properties>
        <entry key="dataFormat" value="POJO" />
        <entry key="loggingFeatureEnabled" value="true" />
    </camelcxf:properties>
</camelcxf:cxfEndpoint>
<camelcxf:cxfEndpoint id="second"
    serviceClass="com.entreprise.example.services.secondService"
    address="http://localhost:8181/cxf/example/secondMessage">
    <camelcxf:properties>
        <entry key="dataFormat" value="POJO" />
        <entry key="loggingFeatureEnabled" value="true" />
    </camelcxf:properties>
</camelcxf:cxfEndpoint>
<camelContext trace="false" id="example"
    xmlns="http://camel.apache.org/schema/blueprint">
    <route>
        <from uri="cxf:bean:first" />
        <to uri="cxf:bean:second" />
    </route>
</camelContext>


Solution

  • Seems like you have really messed up with your blueprint schema declartions. Replace blueprint declaration with something like below

    <?xml version="1.0" encoding="UTF-8"?>
    <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
      xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://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">
    

    And use "cxf" instead of "camelcxf" as prefix for the Endpoint and Bean this will become more clear and redeable (though you are free to use any prefix you prefer to use).

    Ok, to avoid confusion use as below, this will resolve the waiting for dependencies error:

    <?xml version="1.0" encoding="UTF-8"?>
    <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
        xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.2.0"
        xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://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">
    
        <cxf:cxfEndpoint id="fist"
            serviceClass="com.entreprise.example.services.firstService" address="http://localhost:8181/cxf/example/firstMsg">
            <cxf:properties>
                <entry key="dataFormat" value="POJO" />
                <entry key="loggingFeatureEnabled" value="true" />
            </cxf:properties>
        </cxf:cxfEndpoint>
        <cxf:cxfEndpoint id="second"
            serviceClass="com.entreprise.example.services.secondService" address="http://localhost:8181/cxf/example/secondMessage">
            <cxf:properties>
                <entry key="dataFormat" value="POJO" />
                <entry key="loggingFeatureEnabled" value="true" />
            </cxf:properties>
        </cxf:cxfEndpoint>
        <camelContext trace="false" id="example"
            xmlns="http://camel.apache.org/schema/blueprint">
            <route>
                <from uri="cxf:bean:first" />
                <to uri="cxf:bean:second" />
            </route>
    
    </blueprint>