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

    https://github.com/apache/brooklyn-server/pull/338#discussion_r80220390
  
    --- 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 --
    
    Agree, the entity could be coming from another place like the white list 
(included in the distribution). Makes sense to include the entity's class 
loader as well.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to