[jira] [Commented] (CAMEL-12908) Cannot start route using rest dsl due to a mysterious duplicate route id

2018-11-16 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16689181#comment-16689181
 ] 

ASF GitHub Bot commented on CAMEL-12908:


dmvolod commented on issue #2612: CAMEL-12908: Cannot start route using rest 
dsl due to a mysterious  duplicate route id
URL: https://github.com/apache/camel/pull/2612#issuecomment-439328269
 
 
   Thanks @onderson and @oscerd 


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Cannot start route using rest dsl due to a mysterious duplicate route id
> 
>
> Key: CAMEL-12908
> URL: https://issues.apache.org/jira/browse/CAMEL-12908
> Project: Camel
>  Issue Type: Bug
>  Components: rest
>Affects Versions: 2.21.0
>Reporter: Aurélien Pupier
>Assignee: Dmitry Volodin
>Priority: Major
> Attachments: example-fixedVersionsAndRepositories.zip
>
>
> issue came from investigation on 
> https://github.com/jboss-fuse/fuse-apicurito-generator/issues/12
> the Camel files contains a single route id _route2_ but there is an error 
> while trying to start the application mentioning a duplicate id _route2_
> {noformat}
> org.apache.camel.RuntimeCamelException: 
> org.apache.camel.FailedToStartRouteException: Failed to start route route2 
> because of duplicate id detected: route2. Please correct ids to be unique 
> among all your routes.
>   at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1830)
>  ~[camel-core-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136) 
> ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.start(CamelContextFactoryBean.java:369)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:416)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:94)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:399)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
>  ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
>  ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration.createChildManagementContext(EndpointWebMvcAutoConfiguration.java:193)
>  ~[spring-boot-actuator-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration.afterSingletonsInstantiated(EndpointWebMvcAutoConfiguration.java:156)
>  ~[spring-boot-actuator-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> 

[jira] [Commented] (CAMEL-12908) Cannot start route using rest dsl due to a mysterious duplicate route id

2018-11-16 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16689182#comment-16689182
 ] 

ASF GitHub Bot commented on CAMEL-12908:


dmvolod closed pull request #2612: CAMEL-12908: Cannot start route using rest 
dsl due to a mysterious  duplicate route id
URL: https://github.com/apache/camel/pull/2612
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git 
a/camel-core/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java 
b/camel-core/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
index 041bdc212dc..b0059553bae 100644
--- a/camel-core/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
+++ b/camel-core/src/main/java/org/apache/camel/model/RouteDefinitionHelper.java
@@ -19,14 +19,18 @@
 import java.io.UnsupportedEncodingException;
 import java.net.URISyntaxException;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.ErrorHandlerBuilder;
+import org.apache.camel.model.rest.RestDefinition;
+import org.apache.camel.model.rest.VerbDefinition;
 import org.apache.camel.util.CamelContextHelper;
 import org.apache.camel.util.EndpointHelper;
 import org.apache.camel.util.ObjectHelper;
@@ -145,10 +149,11 @@ public void run() {
 for (final RouteDefinition route : routes) {
 if (route.getId() == null) {
 // keep assigning id's until we find a free name
+
 boolean done = false;
 String id = null;
 while (!done) {
-id = context.getNodeIdFactory().createId(route);
+id = route.idOrCreate(context.getNodeIdFactory());
 done = !customIds.contains(id);
 }
 route.setId(id);
@@ -162,6 +167,32 @@ public void run() {
 route.setCustomId(false);
 customIds.add(route.getId());
 }
+RestDefinition rest = route.getRestDefinition();
+if (rest != null && route.isRest()) {
+for (VerbDefinition verb : rest.getVerbs()) {
+String id = verb.idOrCreate(context.getNodeIdFactory());
+if (!verb.getUsedForGeneratingNodeId()) {
+id = route.getId();
+}
+verb.setRouteId(id);
+}
+List fromDefinitions = route.getInputs();
+
+if (ObjectHelper.isNotEmpty(fromDefinitions)) {
+FromDefinition fromDefinition = fromDefinitions.get(0);
+String endpointUri = fromDefinition.getEndpointUri();
+if (ObjectHelper.isNotEmpty(endpointUri)) {
+Map options = new HashMap();
+options.put("routeId", route.getId());
+endpointUri = 
URISupport.appendParametersToURI(endpointUri, options);
+ 
+// replace uri with new routeId
+fromDefinition.setUri(endpointUri);
+fromDefinitions.set(0, fromDefinition);
+route.setInputs(fromDefinitions);
+}
+}
+}
 }
 }
 
diff --git 
a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java 
b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
index 946fb76c16e..5fcce056d7b 100644
--- a/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/rest/RestDefinition.java
@@ -902,23 +902,7 @@ private void addRouteDefinition(CamelContext camelContext, 
List
 if (outType != null) {
 options.put("outType", outType);
 }
-// if no route id has been set, then use the verb id as route id
-if (!route.hasCustomIdAssigned()) {
-// use id of verb as route id
-String id = verb.getId();
-if (id != null) {
-route.setId(id);
-}
-}
-
-String routeId = verb.idOrCreate(camelContext.getNodeIdFactory());
-
-if (!verb.getUsedForGeneratingNodeId()) {
-routeId = route.idOrCreate(camelContext.getNodeIdFactory());
-}
 
-verb.setRouteId(routeId);
-options.put("routeId", routeId);
 

[jira] [Commented] (CAMEL-12908) Cannot start route using rest dsl due to a mysterious duplicate route id

2018-11-13 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16685218#comment-16685218
 ] 

ASF GitHub Bot commented on CAMEL-12908:


dmvolod opened a new pull request #2612: CAMEL-12908: Cannot start route using 
rest dsl due to a mysterious  duplicate route id
URL: https://github.com/apache/camel/pull/2612
 
 
   @davsclaus could you please to look at PR


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Cannot start route using rest dsl due to a mysterious duplicate route id
> 
>
> Key: CAMEL-12908
> URL: https://issues.apache.org/jira/browse/CAMEL-12908
> Project: Camel
>  Issue Type: Bug
>  Components: rest
>Affects Versions: 2.21.0
>Reporter: Aurélien Pupier
>Assignee: Dmitry Volodin
>Priority: Major
> Attachments: example-fixedVersionsAndRepositories.zip
>
>
> issue came from investigation on 
> https://github.com/jboss-fuse/fuse-apicurito-generator/issues/12
> the Camel files contains a single route id _route2_ but there is an error 
> while trying to start the application mentioning a duplicate id _route2_
> {noformat}
> org.apache.camel.RuntimeCamelException: 
> org.apache.camel.FailedToStartRouteException: Failed to start route route2 
> because of duplicate id detected: route2. Please correct ids to be unique 
> among all your routes.
>   at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1830)
>  ~[camel-core-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136) 
> ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.start(CamelContextFactoryBean.java:369)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:416)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:94)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:399)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
>  ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
>  ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration.createChildManagementContext(EndpointWebMvcAutoConfiguration.java:193)
>  ~[spring-boot-actuator-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration.afterSingletonsInstantiated(EndpointWebMvcAutoConfiguration.java:156)
>  ~[spring-boot-actuator-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> 

[jira] [Commented] (CAMEL-12908) Cannot start route using rest dsl due to a mysterious duplicate route id

2018-11-05 Thread Claus Ibsen (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16674829#comment-16674829
 ] 

Claus Ibsen commented on CAMEL-12908:
-

Ah okay, yeah we can move the code if you think its a good solution.

Maybe you can do a PR so we can take a look at the proposed code change?

> Cannot start route using rest dsl due to a mysterious duplicate route id
> 
>
> Key: CAMEL-12908
> URL: https://issues.apache.org/jira/browse/CAMEL-12908
> Project: Camel
>  Issue Type: Bug
>  Components: rest
>Affects Versions: 2.21.0
>Reporter: Aurélien Pupier
>Assignee: Dmitry Volodin
>Priority: Major
> Attachments: example-fixedVersionsAndRepositories.zip
>
>
> issue came from investigation on 
> https://github.com/jboss-fuse/fuse-apicurito-generator/issues/12
> the Camel files contains a single route id _route2_ but there is an error 
> while trying to start the application mentioning a duplicate id _route2_
> {noformat}
> org.apache.camel.RuntimeCamelException: 
> org.apache.camel.FailedToStartRouteException: Failed to start route route2 
> because of duplicate id detected: route2. Please correct ids to be unique 
> among all your routes.
>   at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1830)
>  ~[camel-core-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136) 
> ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.start(CamelContextFactoryBean.java:369)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:416)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:94)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:399)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
>  ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
>  ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration.createChildManagementContext(EndpointWebMvcAutoConfiguration.java:193)
>  ~[spring-boot-actuator-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration.afterSingletonsInstantiated(EndpointWebMvcAutoConfiguration.java:156)
>  ~[spring-boot-actuator-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:781)
>  ~[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> 

[jira] [Commented] (CAMEL-12908) Cannot start route using rest dsl due to a mysterious duplicate route id

2018-11-02 Thread Dmitry Volodin (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16673278#comment-16673278
 ] 

Dmitry Volodin commented on CAMEL-12908:


To implement through route id generation with rest and other routes it's 
necessary to move some code from RestDefinition to the RouteDefinitionHelper. 
[~davsclaus], what do you think about this? Or use RouteIdFactory as 
alternative workaround is good enough?

> Cannot start route using rest dsl due to a mysterious duplicate route id
> 
>
> Key: CAMEL-12908
> URL: https://issues.apache.org/jira/browse/CAMEL-12908
> Project: Camel
>  Issue Type: Bug
>Affects Versions: 2.21.0
>Reporter: Aurélien Pupier
>Assignee: Dmitry Volodin
>Priority: Major
> Attachments: example-fixedVersionsAndRepositories.zip
>
>
> issue came from investigation on 
> https://github.com/jboss-fuse/fuse-apicurito-generator/issues/12
> the Camel files contains a single route id _route2_ but there is an error 
> while trying to start the application mentioning a duplicate id _route2_
> {noformat}
> org.apache.camel.RuntimeCamelException: 
> org.apache.camel.FailedToStartRouteException: Failed to start route route2 
> because of duplicate id detected: route2. Please correct ids to be unique 
> among all your routes.
>   at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1830)
>  ~[camel-core-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136) 
> ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.start(CamelContextFactoryBean.java:369)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:416)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:94)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:399)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
>  ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
>  ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration.createChildManagementContext(EndpointWebMvcAutoConfiguration.java:193)
>  ~[spring-boot-actuator-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration.afterSingletonsInstantiated(EndpointWebMvcAutoConfiguration.java:156)
>  ~[spring-boot-actuator-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:781)
>  ~[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> 

[jira] [Commented] (CAMEL-12908) Cannot start route using rest dsl due to a mysterious duplicate route id

2018-11-01 Thread Dmitry Volodin (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-12908?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16671903#comment-16671903
 ] 

Dmitry Volodin commented on CAMEL-12908:


[~apupier], yes looks like a bug. I've reproduced this issue with upstream code 
just changing  to  in the 
components/camel-spring/src/test/resources/org/apache/camel/component/rest/RestRefTest.xml

Will look at route id generator for rest DSL tomorrow. Thanks for reporting.

> Cannot start route using rest dsl due to a mysterious duplicate route id
> 
>
> Key: CAMEL-12908
> URL: https://issues.apache.org/jira/browse/CAMEL-12908
> Project: Camel
>  Issue Type: Bug
>Affects Versions: 2.21.0
>Reporter: Aurélien Pupier
>Priority: Major
> Attachments: example-fixedVersionsAndRepositories.zip
>
>
> issue came from investigation on 
> https://github.com/jboss-fuse/fuse-apicurito-generator/issues/12
> the Camel files contains a single route id _route2_ but there is an error 
> while trying to start the application mentioning a duplicate id _route2_
> {noformat}
> org.apache.camel.RuntimeCamelException: 
> org.apache.camel.FailedToStartRouteException: Failed to start route route2 
> because of duplicate id detected: route2. Please correct ids to be unique 
> among all your routes.
>   at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1830)
>  ~[camel-core-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:136) 
> ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.start(CamelContextFactoryBean.java:369)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:416)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:94)
>  ~[camel-spring-2.21.0.fuse-720024.jar:2.21.0.fuse-720024]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:399)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:144)
>  ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546)
>  ~[spring-context-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
>  ~[spring-boot-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration.createChildManagementContext(EndpointWebMvcAutoConfiguration.java:193)
>  ~[spring-boot-actuator-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration.afterSingletonsInstantiated(EndpointWebMvcAutoConfiguration.java:156)
>  ~[spring-boot-actuator-1.5.13.RELEASE.jar:1.5.13.RELEASE]
>   at 
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:781)
>  ~[spring-beans-4.3.17.RELEASE.jar:4.3.17.RELEASE]
>   at 
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
>