brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aled Sage (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BROOKLYN-409) Rebind fails in karaf, with app referencing classes in catalog item's bundle
Date Wed, 14 Dec 2016 10:48:58 GMT

    [ https://issues.apache.org/jira/browse/BROOKLYN-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15747993#comment-15747993
] 

Aled Sage commented on BROOKLYN-409:
------------------------------------

BROOKLYN-379 is slightly different, in that it talks about referencing a bundle that was pre-installed
in karaf (rather than referenced via the catalog item's {{brooklyn.libraries}}, which is the
case for BROOKLYN-409).

> Rebind fails in karaf, with app referencing classes in catalog item's bundle
> ----------------------------------------------------------------------------
>
>                 Key: BROOKLYN-409
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-409
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Aled Sage
>
> Using Brooklyn 0.10.0-SNAPSHOT, running in karaf...
> A customer deployed an app, which uses entity and policy classes defined in an OSGi bundle
(supplied via brooklyn.libraries). A simplified version of the catalog item is something like
that below (where {{com.example.apps.MyTopLevelApp}} and {{com.example.policies.MyPolicy}}
are Java classes in my-bundle.jar):
> {noformat}
> brooklyn.catalog:
>   brooklyn.libraries:
>   - file:///path/to/my-bundle.jar
>   id: com.example.MyApp
>   itemType: template
>   version: 1.3
>   description: My App
>   displayName: My App
>   item:
>     services:
>     - type: com.example.apps.MyTopLevelApp
>       brooklyn.config: 
>         childSpec:
>           $brooklyn:entitySpec:
>             type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
>             name: Sshable
>             brooklyn.config:
>               checkRunning.command: echo true
>               customize.command: echo true
>               launch.command: echo true
>             brooklyn.policies:
>             - type: com.example.policies.MyPolicy
> {noformat}
> This deploys fine. However, when one stops and restarts Brooklyn (so rebinding to persisted
state) it gives the exception below:
> {noformat}
> 2016-12-14 09:30:47,157 WARN  116 o.a.b.c.m.r.RebindExceptionHandlerImpl [nager-msT0tE2K-0]
Rebind: continuing after problem creating POLICY isk2552l4k of type com.example.policies.MyPolicy
> java.lang.IllegalStateException: Unable to load com.example.policies.MyPolicy from []:
Invalid class: com.example.policies.MyPolicy: ClassNotFoundException: com.example.policies.MyPolicy
>         at org.apache.brooklyn.util.guava.IllegalStateExceptionSupplier.get(IllegalStateExceptionSupplier.java:40)[139:org.apache.brooklyn.utils-common:0.10.0.20161205_1210]
>         at org.apache.brooklyn.util.guava.IllegalStateExceptionSupplier.get(IllegalStateExceptionSupplier.java:26)[139:org.apache.brooklyn.utils-common:0.10.0.20161205_1210]
>         at org.apache.brooklyn.util.guava.Maybe$Absent.getException(Maybe.java:337)[139:org.apache.brooklyn.utils-common:0.10.0.20161205_1210]
>         at org.apache.brooklyn.util.guava.Maybe$Absent.get(Maybe.java:331)[139:org.apache.brooklyn.utils-common:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.classloading.AbstractBrooklynClassLoadingContext.loadClass(AbstractBrooklynClassLoadingContext.java:55)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindIteration$BrooklynObjectInstantiator.load(RebindIteration.java:953)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindIteration$BrooklynObjectInstantiator.newPolicy(RebindIteration.java:1039)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.instantiateAdjuncts(RebindIteration.java:482)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.doRun(RebindIteration.java:242)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.rebind.InitialFullRebindIteration.doRun(InitialFullRebindIteration.java:69)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.run(RebindIteration.java:266)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl.rebindImpl(RebindManagerImpl.java:558)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:508)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:506)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:522)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_71]
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_71]
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_71]
>         at java.lang.Thread.run(Thread.java:745)[:1.7.0_71]
> Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Unable to
load com.example.policies.MyPolicy from []: Invalid class: com.example.policies.MyPolicy:
ClassNotFoundException: com.example.policies.MyPolicy
>         at org.apache.brooklyn.util.exceptions.Exceptions.create(Exceptions.java:432)[139:org.apache.brooklyn.utils-common:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.classloading.BrooklynClassLoadingContextSequential.tryLoadClass(BrooklynClassLoadingContextSequential.java:88)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.classloading.AbstractBrooklynClassLoadingContext.tryLoadClass(AbstractBrooklynClassLoadingContext.java:61)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         ... 15 more
> Caused by: java.lang.IllegalStateException: Invalid class: com.example.policies.MyPolicy
>         at org.apache.brooklyn.util.guava.IllegalStateExceptionSupplier.get(IllegalStateExceptionSupplier.java:40)[139:org.apache.brooklyn.utils-common:0.10.0.20161205_1210]
>         at org.apache.brooklyn.util.guava.IllegalStateExceptionSupplier.get(IllegalStateExceptionSupplier.java:26)[139:org.apache.brooklyn.utils-common:0.10.0.20161205_1210]
>         at org.apache.brooklyn.util.guava.Maybe$Absent.getException(Maybe.java:337)[139:org.apache.brooklyn.utils-common:0.10.0.20161205_1210]
>         at org.apache.brooklyn.util.guava.Maybe.getException(Maybe.java:465)[139:org.apache.brooklyn.utils-common:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.classloading.BrooklynClassLoadingContextSequential.tryLoadClass(BrooklynClassLoadingContextSequential.java:85)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         ... 16 more
> Caused by: java.lang.ClassNotFoundException: com.example.policies.MyPolicy
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:366)[:1.7.0_71]
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:355)[:1.7.0_71]
>         at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_71]
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:354)[:1.7.0_71]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:425)[:1.7.0_71]
>         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)[:1.7.0_71]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_71]
>         at org.apache.brooklyn.util.javalang.AggregateClassLoader.findClass(AggregateClassLoader.java:135)[139:org.apache.brooklyn.utils-common:0.10.0.20161205_1210]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:425)[:1.7.0_71]
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_71]
>         at org.apache.brooklyn.core.mgmt.classloading.JavaBrooklynClassLoadingContext.tryLoadClass0(JavaBrooklynClassLoadingContext.java:101)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.classloading.JavaBrooklynClassLoadingContext.tryLoadClass(JavaBrooklynClassLoadingContext.java:84)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         at org.apache.brooklyn.core.mgmt.classloading.BrooklynClassLoadingContextSequential.tryLoadClass(BrooklynClassLoadingContextSequential.java:81)[116:org.apache.brooklyn.core:0.10.0.20161205_1210]
>         ... 16 more
> {noformat}
> Brooklyn does start up, but the policy no longer exists on the entity.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message