GitHub user aledsage opened a pull request:
https://github.com/apache/incubator-brooklyn/pull/1089
tryLoadClass: return optional.absent on NoClassDefFoundError
We encountered this error when there were a Java entity in `lib/dropins`
that still referenced the old `brooklyn.entity.basic.StartableApplication"
(i.e. it had not been recompiled, with its source code updated).
The consequence was that `GET /v1/catalog/applications` failed, so no
catalog items were displayed in the web-console. Also, the exception gives no
indication of which catalog item the error came from (we unpacked all the jars,
and did a string search across them to find it!).
With this fix, we'll get the log.debug that says which catalog item the
error came from. The catalog item will be excluded from the list, and the other
catalog items returned.
Ideally I'd like something better than just a `log.debug` to tell the user
of this serious problem. Not convinced that `JavaBrooklynClassLoadingContext`
is the right place to log.warn etc though.
I suggest we merge this, and then think about how to log better in a
subsequent PR.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/aledsage/incubator-brooklyn fix/tryLoadClass
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-brooklyn/pull/1089.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1089
----
commit 68cd3860d2428381c36721c1b322b1fec69da536
Author: Aled Sage <[email protected]>
Date: 2015-12-02T16:41:41Z
tryLoadClass: return optional.absent on NoClassDefFoundError
----
---
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.
---