Fluffy
Fluffy

Reputation: 409

Camel route leads to Missing dependencies error

i am currently trying to deploy a camel route to my karaf container (in Spring DSL):

<?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"
    xsi:schemaLocation="
      http://www.osgi.org/xmlns/blueprint/v1.0.0
      http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd">
    <bean id="milo-client" class="org.apache.camel.component.milo.client.MiloClientComponent">
        <!--<property name="enableAnonymousAuthentication" value="true"/>-->
    </bean>
    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
      <route id="opctorest">
        <from uri="timer://simpleTimer?period=1000"/>
        <log message="Triggered Route: opctorest: Sensorreading body: ${body}"/>
        <to uri="milo-client:tcp://127.0.0.1:4840/freeopcua/server?namespaceUri=http://examples.freeopcua.github.io"/>
        <convertBodyTo type="java.lang.String"/>        
        <to uri="stream:out"/>
      </route>
    </camelContext>
</blueprint>

The bundle for that route is not installed, but remains in "GracePeriod" status. I fixed all missing dependencies (i thought it did), but i do not understand this message:

Bundle 251 ---------- Status: GracePeriod Blueprint 11/23/16 2:08 PM Missing dependencies: (&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/blueprint))

What can i do to resolve that dependency? camel-blueprint is installed, as is aries. Karaf is version 4.0.5. Blueprint is 2.16.3.

Thanks!

Upvotes: 1

Views: 1620

Answers (2)

Fluffy
Fluffy

Reputation: 409

It seems to be related to Camel 2.16.3 somehow. As soon as i upgraded to 2.18, everything was fine. The milo-client endpoint depends on Camel 2.18.

Thank you all for your help!

Upvotes: 0

Alessandro Da Rugna
Alessandro Da Rugna

Reputation: 4695

What if you add camel XSD url to schemaLocation attribute?

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    
           xmlns:camel="http://camel.apache.org/schema/blueprint"
           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">

EDIT: I was commenting but it's a long story, so here it is.

I'm not 100% sure, but <camelContext xmlns="http://camel.apache.org/schema/blueprint"> tells Blueprint which namespace to use to validate that part of XML. Blueprint needs to know "where" to look for that namespace's schema (xmlns = XML Name Space), and searches schemaLocation attribute.
A namespace is tags' prefix, for example in <mythings:tag> mythings is the namespace. By using xmlns attribute you are saying basically "everything in here has the following namespace".

I realized this was the issue from:

Bundle 251 ---------- Status: GracePeriod Blueprint 11/23/16 2:08 PM Missing dependencies: (&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/blueprint))

Upvotes: 0

Related Questions