Valentin Aitken created BROOKLYN-497:
----------------------------------------
Summary: Rebind failure on connectSensors is not properly reported
Key: BROOKLYN-497
URL: https://issues.apache.org/jira/browse/BROOKLYN-497
Project: Brooklyn
Issue Type: Bug
Reporter: Valentin Aitken
Normally if Apache Brooklyn fails to read an entity class it fails to start or
continues depending on how it is configured.
However if there are class loading errors which happen on connect sensors this
is only reported in the log. This could be not so fatal rebind error however
it still need some status reporting at least in Brooklyn API.
Test which I did:
I created a type which has in it reference to a class which is only in Apache
Brooklyn 0.11.0 rc2 and presumably it will be in final 0.11.0 and it will not
be in the upcoming 0.12.0.
{noformat}
@Override
protected void connectSensors() {
super.connectSensors();
logger.info(org.apache.brooklyn.rest.api.VersionApi.class.getName());
}
{noformat}
When I launch Apache Brooklyn 0.12.0 SNAPSHOT
I get a warning in logs but still Apache Brooklyn starts successfully.
The warning was:
{noformat}
2017-05-04 13:17:31,018 WARN 129 o.a.b.e.s.b.SoftwareProcessImpl
[nager-QR5KLdgy-2] Problem connecting sensors on rebind of
TypeReferringToAnOldApiImpl{id=n7o0ghxs0p}
java.lang.NoClassDefFoundError: org/apache/brooklyn/rest/api/VersionApi
at
org.apache.brooklyn.test.osgi.entities.rebind.oldapi.brooklynnodewithapi.TypeReferringToAnOldApiImpl.connectSensors(TypeReferringToAnOldApiImpl.java:32)
at
org.apache.brooklyn.entity.software.base.SoftwareProcessImpl$2.call(SoftwareProcessImpl.java:402)[129:org.apache.brooklyn.software-base:0.12.0.SNAPSHOT]
at
org.apache.brooklyn.entity.software.base.SoftwareProcessImpl$2.call(SoftwareProcessImpl.java:395)[129:org.apache.brooklyn.software-base:0.12.0.SNAPSHOT]
at
org.apache.brooklyn.util.core.task.BasicExecutionManager$ScheduledTaskCallable$1.call(BasicExecutionManager.java:451)[120:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
at
org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:529)[120:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
Caused by: java.lang.ClassNotFoundException:
org.apache.brooklyn.rest.api.VersionApi not found by
org.apache.brooklyn.rest-api [128]
at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)[org.apache.felix.framework-5.6.1.jar:]
at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)[org.apache.felix.framework-5.6.1.jar:]
at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)[org.apache.felix.framework-5.6.1.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_121]
at
org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1415)[org.apache.felix.framework-5.6.1.jar:]
at
org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1595)[org.apache.felix.framework-5.6.1.jar:]
at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1525)[org.apache.felix.framework-5.6.1.jar:]
at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)[org.apache.felix.framework-5.6.1.jar:]
at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)[org.apache.felix.framework-5.6.1.jar:]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_121]
... 9 more
{noformat}
I think there is helpful explanation about that in
https://issues.apache.org/jira/browse/BROOKLYN-425?focusedCommentId=15821864&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15821864
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)