Convert sanity check exception to an error log - no longer fatal after classpath catalog items use YAML.
Catalog items scanned from the classpath (using reflection and annotations) now get yaml spec rather than a java type. Can't use those when creating apps from the legacy app spec format. Fall back to direct classpath loading instead. Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/807e6d18 Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/807e6d18 Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/807e6d18 Branch: refs/heads/master Commit: 807e6d18b418f660ed17abf3650cbc4a007e9985 Parents: d66df91 Author: Svetoslav Neykov <[email protected]> Authored: Mon Jul 6 17:57:45 2015 +0300 Committer: Svetoslav Neykov <[email protected]> Committed: Tue Jul 7 17:29:16 2015 +0300 ---------------------------------------------------------------------- .../java/brooklyn/catalog/internal/BasicBrooklynCatalog.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/807e6d18/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java b/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java index 37af858..b0a8492 100644 --- a/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java +++ b/core/src/main/java/brooklyn/catalog/internal/BasicBrooklynCatalog.java @@ -1294,9 +1294,13 @@ public class BasicBrooklynCatalog implements BrooklynCatalog { resultI = catalog.getCatalogItem(typeName, BrooklynCatalog.DEFAULT_VERSION); if (resultI != null) { if (resultI.getJavaType() == null) { - throw new NoSuchElementException("Unable to find catalog item for type "+typeName + + //Catalog items scanned from the classpath (using reflection and annotations) now + //get yaml spec rather than a java type. Can't use those when creating apps from + //the legacy app spec format. + log.warn("Unable to find catalog item for type "+typeName + ". There is an existing catalog item with ID " + resultI.getId() + " but it doesn't define a class type."); + return null; } } }
