Github user geomacy commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/338#discussion_r79995509
  
    --- Diff: 
core/src/main/java/org/apache/brooklyn/core/mgmt/internal/AbstractManagementContext.java
 ---
    @@ -128,20 +128,18 @@ private static DataGridFactory 
loadDataGridFactory(BrooklynProperties properties
                 public BrooklynClassLoadingContext apply(@Nullable Object 
input) {
                     if (input instanceof EntityInternal) {
                         EntityInternal internal = (EntityInternal)input;
    -                    if (internal.getCatalogItemId() != null) {
    -                        RegisteredType item = 
internal.getManagementContext().getTypeRegistry().get(internal.getCatalogItemId());
    -
    -                        if (item != null) {
    -                            BrooklynClassLoadingContext itemLoader = 
CatalogUtils.newClassLoadingContext(internal.getManagementContext(), item);
    -                            // Falls back to the entity's class loader
    -                            JavaBrooklynClassLoadingContext entityLoader = 
JavaBrooklynClassLoadingContext.create(input.getClass().getClassLoader());
    -                            BrooklynClassLoadingContext seqLoader = new 
BrooklynClassLoadingContextSequential(internal.getManagementContext(), 
itemLoader, entityLoader);
    -                            return seqLoader;
    -                        } else {
    -                            log.error("Can't find catalog item " + 
internal.getCatalogItemId() +
    -                                    " used for instantiating entity " + 
internal +
    -                                    ". Falling back to application 
classpath.");
    +                    final List<String> catalogItemSuperIds = 
internal.getCatalogItemSuperIds();
    +                    if (catalogItemSuperIds.size() > 0) {
    +                        BrooklynClassLoadingContextSequential seqLoader = 
new BrooklynClassLoadingContextSequential(internal.getManagementContext());
    +                        for (String catalogItemId : catalogItemSuperIds) {
    --- End diff --
    
    check - probably as well as the catalog items we *should* still also use 
the entity class loader?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to