camel git commit: CAMEL-10689: NoFactoryAvailableException when invoking component-list ssh command

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

camel git commit: CAMEL-10689: NoFactoryAvailableException when invoking component-list ssh command

lburgazzoli-2
Repository: camel
Updated Branches:
  refs/heads/master 720ce73bb -> 77f8f36d1


CAMEL-10689: NoFactoryAvailableException when invoking component-list ssh command


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/77f8f36d
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/77f8f36d
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/77f8f36d

Branch: refs/heads/master
Commit: 77f8f36d18f719c42de0ecec45a79098338b3021
Parents: 720ce73
Author: lburgazzoli <[hidden email]>
Authored: Tue Jan 10 16:26:44 2017 +0100
Committer: lburgazzoli <[hidden email]>
Committed: Tue Jan 10 16:27:04 2017 +0100

----------------------------------------------------------------------
 .../apache/camel/impl/DefaultCamelContext.java  | 36 +++++++++++++++++---
 .../spring/boot/MySpringBootApplication.java    |  7 ++--
 .../src/main/resources/application.yml          |  4 ++-
 3 files changed, 38 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/77f8f36d/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
index fa9c255..31e947e 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
@@ -1391,7 +1391,14 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
         // where the documentation exists as well
         FactoryFinder finder = getFactoryFinder(DefaultComponentResolver.RESOURCE_PATH);
         try {
-            Class<?> clazz = finder.findClass(componentName);
+            Class<?> clazz = null;
+            try {
+                finder.findClass(componentName);
+            } catch (NoFactoryAvailableException e) {
+                // ignore, i.e. if a component is an auto-configured spring-boot
+                // components
+            }
+
             if (clazz == null) {
                 // fallback and find existing component
                 Component existing = hasComponent(componentName);
@@ -1432,7 +1439,14 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
         // where the documentation exists as well
         FactoryFinder finder = getFactoryFinder(DefaultComponentResolver.RESOURCE_PATH);
         try {
-            Class<?> clazz = finder.findClass(componentName);
+            Class<?> clazz = null;
+            try {
+                clazz = finder.findClass(componentName);
+            } catch (NoFactoryAvailableException e) {
+                // ignore, i.e. if a component is an auto-configured spring-boot
+                // component
+            }
+
             if (clazz == null) {
                 // fallback and find existing component
                 Component existing = hasComponent(componentName);
@@ -1473,7 +1487,14 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
         // where the documentation exists as well
         FactoryFinder finder = getFactoryFinder(DefaultDataFormatResolver.DATAFORMAT_RESOURCE_PATH);
         try {
-            Class<?> clazz = finder.findClass(dataFormatName);
+            Class<?> clazz = null;
+            try {
+                finder.findClass(dataFormatName);
+            } catch (NoFactoryAvailableException e) {
+                // ignore, i.e. if a component is an auto-configured spring-boot
+                // data-formats
+            }
+
             if (clazz == null) {
                 return null;
             }
@@ -1504,7 +1525,14 @@ public class DefaultCamelContext extends ServiceSupport implements ModelCamelCon
         // where the documentation exists as well
         FactoryFinder finder = getFactoryFinder(DefaultLanguageResolver.LANGUAGE_RESOURCE_PATH);
         try {
-            Class<?> clazz = finder.findClass(languageName);
+            Class<?> clazz = null;
+            try {
+                finder.findClass(languageName);
+            } catch (NoFactoryAvailableException e) {
+                // ignore, i.e. if a component is an auto-configured spring-boot
+                // languages
+            }
+
             if (clazz == null) {
                 return null;
             }

http://git-wip-us.apache.org/repos/asf/camel/blob/77f8f36d/examples/camel-example-spring-boot/src/main/java/org/apache/camel/example/spring/boot/MySpringBootApplication.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot/src/main/java/org/apache/camel/example/spring/boot/MySpringBootApplication.java b/examples/camel-example-spring-boot/src/main/java/org/apache/camel/example/spring/boot/MySpringBootApplication.java
index 4aa91e9..4528682 100644
--- a/examples/camel-example-spring-boot/src/main/java/org/apache/camel/example/spring/boot/MySpringBootApplication.java
+++ b/examples/camel-example-spring-boot/src/main/java/org/apache/camel/example/spring/boot/MySpringBootApplication.java
@@ -19,11 +19,9 @@ package org.apache.camel.example.spring.boot;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 
+//CHECKSTYLE:OFF
 @SpringBootApplication
-public final class MySpringBootApplication {
-    private MySpringBootApplication() {
-    }
-
+public class MySpringBootApplication {
     /**
      * A main method to start this application.
      */
@@ -31,3 +29,4 @@ public final class MySpringBootApplication {
         SpringApplication.run(MySpringBootApplication.class, args);
     }
 }
+//CHECKSTYLE:ON
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/camel/blob/77f8f36d/examples/camel-example-spring-boot/src/main/resources/application.yml
----------------------------------------------------------------------
diff --git a/examples/camel-example-spring-boot/src/main/resources/application.yml b/examples/camel-example-spring-boot/src/main/resources/application.yml
index 6ee4f40..54bbf52 100644
--- a/examples/camel-example-spring-boot/src/main/resources/application.yml
+++ b/examples/camel-example-spring-boot/src/main/resources/application.yml
@@ -16,7 +16,9 @@
 ## ------------------------------------------------------------------------
 
 spring.main.sources: org.apache.camel.example.spring.boot.MySpringBootRouter
-shell.auth.simple.user.password: password
+
+management.shell.auth.simple.user.name: user
+management.shell.auth.simple.user.password: password
 
 camel:
   springboot:

Loading...