You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Gerald Kallas <ca...@mailbox.org> on 2020/02/21 11:31:19 UTC
Camel 3.0.1 - DefaultProducerTemplate seems to be a different
class?
Dear community,
I've created a processor for Camel 2 that works fine. See the Java Code Snippet
...
import org.apache.camel.Exchange;
import org.apache.camel.Processor;
import org.apache.camel.ProducerTemplate;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class JsonSplitter implements Processor {
private static final transient Log log = LogFactory.getLog(JsonSplitter.class.getName());
// constants for property names
private static final String ARRAY_NAME = "arrayName";
private static final String SPLIT_SIZE = "splitSize";
// initialize variables
private ProducerTemplate producer;
private String splitString;
public void setProducer(ProducerTemplate producer) {
this.producer = producer;
}
public void process(Exchange exchange) throws Exception {
...
and the consuming Blueprint XML
...
<bean id="jsonSplitter" class="de.ag.cas.eib.JsonSplitter">
<property name="producer" ref="splitTemplate" />
</bean>
<!-- reference to NoopHostnameVerifier -->
<bean id="noopHostnameVerifier" class="org.apache.http.conn.ssl.NoopHostnameVerifier" />
<camelContext id="isp.context.user.${body.serviceId}" xmlns="http://camel.apache.org/schema/blueprint" streamCache="true" useBreadcrumb="true">
<template id="splitTemplate" defaultEndpoint="activemq:NAMES" />
<route id="isp.route.user.${body.serviceId}">
...
While deploying the Blueprint route I'm now getting an exception
org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean splitTemplate of class org.apache.camel.impl.engine.DefaultProducerTemplate
Do I miss something here? Has the class DefaultProducerTemplate been moved to another package?
Thanks in advance for any hints
- Gerald
Re: Camel 3.0.1 - DefaultProducerTemplate seems to be a different
class?
Posted by Gerald Kallas <ca...@mailbox.org>.
My fault. The endpoint defaultEndpoint="activemq:NAMES" didn't exist (activemq).
> Gerald Kallas <ca...@mailbox.org> hat am 21. Februar 2020 12:31 geschrieben:
>
>
> Dear community,
>
> I've created a processor for Camel 2 that works fine. See the Java Code Snippet
>
> ...
> import org.apache.camel.Exchange;
> import org.apache.camel.Processor;
> import org.apache.camel.ProducerTemplate;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> public class JsonSplitter implements Processor {
> private static final transient Log log = LogFactory.getLog(JsonSplitter.class.getName());
> // constants for property names
> private static final String ARRAY_NAME = "arrayName";
> private static final String SPLIT_SIZE = "splitSize";
> // initialize variables
> private ProducerTemplate producer;
> private String splitString;
> public void setProducer(ProducerTemplate producer) {
> this.producer = producer;
> }
> public void process(Exchange exchange) throws Exception {
> ...
>
> and the consuming Blueprint XML
>
> ...
> <bean id="jsonSplitter" class="de.ag.cas.eib.JsonSplitter">
> <property name="producer" ref="splitTemplate" />
> </bean>
> <!-- reference to NoopHostnameVerifier -->
> <bean id="noopHostnameVerifier" class="org.apache.http.conn.ssl.NoopHostnameVerifier" />
> <camelContext id="isp.context.user.${body.serviceId}" xmlns="http://camel.apache.org/schema/blueprint" streamCache="true" useBreadcrumb="true">
> <template id="splitTemplate" defaultEndpoint="activemq:NAMES" />
> <route id="isp.route.user.${body.serviceId}">
> ...
>
> While deploying the Blueprint route I'm now getting an exception
>
> org.osgi.service.blueprint.container.ComponentDefinitionException: Error when instantiating bean splitTemplate of class org.apache.camel.impl.engine.DefaultProducerTemplate
>
> Do I miss something here? Has the class DefaultProducerTemplate been moved to another package?
>
> Thanks in advance for any hints
> - Gerald