[
https://issues.apache.org/jira/browse/BROOKLYN-379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15702377#comment-15702377
]
ASF GitHub Bot commented on BROOKLYN-379:
-----------------------------------------
Github user neykov commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/442#discussion_r89816716
--- Diff:
core/src/main/java/org/apache/brooklyn/core/mgmt/ha/OsgiManager.java ---
@@ -189,10 +194,15 @@ public static boolean
isBundleNameEqualOrAbsent(CatalogBundle bundle, Bundle b)
Maybe<Bundle> bundle = findBundle(osgiBundle);
if (bundle.isPresent()) {
Bundle b = bundle.get();
- Class<T> clazz;
+ Optional<String> strippedType =
osgiClassPrefixer.stripMatchingPrefix(b, type);
+ String typeToLoad = strippedType.isPresent() ?
strippedType.get() : type;
+ if (osgiClassPrefixer.hasPrefix(typeToLoad)) {
+ bundleProblems.put(osgiBundle, new
UserFacingException("Bundle does not match prefix in type name
'"+typeToLoad+"'"));
+ continue;
+ }
--- End diff --
`getResource(s)` needs the same update. Turns out we can't load prefixed
resources when combined with `brooklyn.libraries`.
Could be addressed as another PR.
> Rebind error when entity type references pre-installed OSGi bundle
> ------------------------------------------------------------------
>
> Key: BROOKLYN-379
> URL: https://issues.apache.org/jira/browse/BROOKLYN-379
> Project: Brooklyn
> Issue Type: Bug
> Reporter: Aled Sage
>
> When persisting an entity whose type is in an OSGi bundle (pre-installed in
> Karaf), using the OSGi symbolic name prefix in the {{type: ...}} declaration,
> it fails to deserialize.
> For example, if you deploy the blueprint below and then try to restart
> Brooklyn, it fails because it can't load the class
> {{com.example.MyEntityImpl}} (note the absence of the OSGi bundle prefix).
> {noformat}
> services:
> - type: com.example.my_osgi_bundle_name:com.example.MyEntity
> {noformat}
> See [~svet]'s example test in
> https://github.com/apache/brooklyn-server/pull/396.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)