Skip to Content

Building an Adapter using Camel Adapter

Hi,

I am trying to build an SDI adapter using Camel adapter according to the guide: Data Provisioning Adapter SDK Guide

adapters.xml:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Adapters>
    <Adapter type="CamelForexAdapter" displayName="Camel Forex Adapter">
        <RemoteSourceDescription>
            <PropertyGroup name="configuration" displayName="Configuration">
                <PropertyEntry name="sourceURL" displayName="Server URL" description="Forex source server" isRequired="false"/>
            </PropertyGroup>
        </RemoteSourceDescription>
        <Capabilities>
            CAP_SELECT
        </Capabilities>
        <RouteTemplate>forex-spring.xml</RouteTemplate>
    </Adapter>
</Adapters>

forex-spring.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
           http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
           http://camel.apache.org/schema/spring
           http://camel.apache.org/schema/spring/camel-spring.xsd">
    <bean id="sqlBean" class="com.sap.hana.dp.camel.ConvertSQLBean"/>
    <bean id="http" class="org.apache.camel.component.http.HttpComponent">
        <property name="camelContext" ref="camel"/>
    </bean>
    <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
        <route>
            <from uri="direct:start"/>
            <to uri="https://www.freeforexapi.com/api/live?pairs=EURGBP"/>
        </route>
    </camelContext>
</beans>

I have downloaded jar file with HttpComponent class and put it into folders: <dpagent>/camel/lib, <dpagent>/camel, <dpagent>/plugins

When I try to activate a Remote Source I get the error:

SAP DBTech JDBC: [403]: internal error: Cannot get remote source objects: Cannot find class [org.apache.camel.component.http.HttpComponent] for bean with name 'http' defined in file [/usr/sap/dataprovagent/camel/forex-spring.xml]; nested exception is 
java.lang.ClassNotFoundException: org.apache.camel.component.http.HttpComponent cannot be found by com.sap.hana.dp.cameladapter_2.3.5

What did I miss? Should I register the jar somehow/somewhere?

I tried different versions of the jar, checked that it has the required class inside.

Don't please pay much attention to the route in Camel context, I really try as the first step make Camel Adapter see the HttpComponent class.

Yury

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Feb 06 at 10:59 PM

    I close the question. The issue related to unresolved dependencies from the Camel Component.

    It became obvious after setting the trace level to DEBUG.

    Add comment
    10|10000 characters needed characters exceeded