camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicolasduminil <nicolas.dumi...@simplex-software.fr>
Subject Re: java.lang.IllegalArgumentException: Cannot add component as its already previously added: jms
Date Mon, 25 Apr 2016 12:46:08 GMT
Hi Claus,

Many thanks for your suggestion. Now the code looks as follows:

public class MyRoutes extends RouteBuilder {
  @Inject
  @Uri("file:data/inbox?noop=true")
  private Endpoint inputEndpoint;

  @Inject
  @Uri("jms:incommingData")
  private Endpoint resultEndpoint;
  
  @Produces
  @Named("jms")
  public Component jmsComponent()
  {
    ConnectionFactory connectionFactory = new
ActiveMQConnectionFactory("tcp://cac40:61616?create=false");
    return JmsComponent.jmsComponentAutoAcknowledge(connectionFactory);
  }

  @Override
  public void configure() {
    from(inputEndpoint).to("bean:counterBean").to(resultEndpoint);
  }
}

Running it with camel:run raises the following:

[ERROR] Caused by: org.apache.camel.ResolveEndpointFailedException: Failed
to resolve endpoint: jms://incommingData due to: Cannot auto create
component: jms
[ERROR] at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:588)
[ERROR] at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:601)
[ERROR] at
org.apache.camel.impl.DefaultCamelContext$Proxy$_$$_WeldClientProxy.getEndpoint(Unknown
Source)
[ERROR] at
org.apache.camel.cdi.CdiCamelFactory.endpoint(CdiCamelFactory.java:119)
[ERROR] ... 65 more

Is there anything else I could try. This code was generated by the
maven-camel-jms-cdi archetype.

Kind regards,

Nicolas DUMINIL



--
View this message in context: http://camel.465427.n5.nabble.com/java-lang-IllegalArgumentException-Cannot-add-component-as-its-already-previously-added-jms-tp5781607p5781658.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message