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-539) ClassCastExceptions on rebind (trying to persist catalog items)
Date Thu, 21 Sep 2017 15:54:00 GMT

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

Aled Sage commented on BROOKLYN-539:
------------------------------------

I played around with {{CatalogTypes$CatalogItemFromRegistredType}}, making it implement {{BrooklynObjectIntenal}}.
When it does, the pesistence sub-directory {{/catalog}} is populated with all the catalog
items. For a clean launch (i.e. no existing persisted state), the {{/catalog}} persisted state
dir has been empty every since Alex's big PRs including https://github.com/apache/brooklyn-server/pull/746.
Instead the catalog items are loaded from the bundles each time (see {{/bundles}} persisted
state directory.

[~alex.heneveld] we need your guidance on this one. I think that no-one else yet fully understands
the new bundle loading and bundle persistence, or your complete vision for it. Were you intending
for the /catalog persistence directory to be empty? If so, we should remove the code that
requests those files to be (re-)persisted rather than relying on the exception. What about
for non-karaf mode?

> ClassCastExceptions on rebind (trying to persist catalog items)
> ---------------------------------------------------------------
>
>                 Key: BROOKLYN-539
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-539
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Aled Sage
>
> With bleeding edge 0.12.0-SNAPSHOT, I started Brooklyn (in Karaf mode), then stopped
it and restarted it again.
> On rebind, I see exceptions like that below many times in the info log. I think it's
logged once per item in the catalog.
> {noformat}
> 2017-09-20T11:42:36,406 WARN  122 o.a.b.c.m.r.PersistenceExceptionHandlerImpl [FelixStartLevel]
Problem persisting (ignoring): generate memento for CATALOG_ITEM org.apache.brooklyn.core.typereg.RegisteredTypes$CatalogItemFromRegisteredType
> (pr-128-top-level:1.0.0)
> java.lang.ClassCastException: org.apache.brooklyn.core.typereg.RegisteredTypes$CatalogItemFromRegisteredType
cannot be cast to org.apache.brooklyn.core.objs.BrooklynObjectInternal
>         at org.apache.brooklyn.core.mgmt.rebind.PeriodicDeltaChangeListener.persistNowInternal(PeriodicDeltaChangeListener.java:454)
[122:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
>         at org.apache.brooklyn.core.mgmt.rebind.PeriodicDeltaChangeListener.persistNowSafely(PeriodicDeltaChangeListener.java:379)
[122:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
>         at org.apache.brooklyn.core.mgmt.rebind.PeriodicDeltaChangeListener.persistNowSafely(PeriodicDeltaChangeListener.java:373)
[122:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
>         at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl.forcePersistNow(RebindManagerImpl.java:476)
[122:org.apache.brooklyn.core:0.12.0.SNAPSHOT]
>         at org.apache.brooklyn.launcher.common.BasicLauncher.persist(BasicLauncher.java:434)
[126:org.apache.brooklyn.launcher-common:0.12.0.SNAPSHOT]
>         at org.apache.brooklyn.launcher.common.BasicLauncher.startPartTwo(BasicLauncher.java:426)
[126:org.apache.brooklyn.launcher-common:0.12.0.SNAPSHOT]
>         at org.apache.brooklyn.launcher.osgi.OsgiLauncherImpl.startOsgi(OsgiLauncherImpl.java:116)
[333:org.apache.brooklyn.karaf-init:0.12.0.SNAPSHOT]
>         at Proxy5b14e94c_cf63_4a4e_a22b_a2fdda9c9134.startOsgi(Unknown Source) [?:?]
>         at org.apache.brooklyn.launcher.osgi.start.OsgiLauncherCompleter.init(OsgiLauncherCompleter.java:36)
[335:org.apache.brooklyn.karaf-start:0.12.0.SNAPSHOT]
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
~[?:?]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
~[?:?]
>         at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
>         at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:299)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:980)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:736)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:848)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:811)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
>         at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:255)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:186)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:704)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:410)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:275)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:300)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:269)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:265)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:255)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)
[15:org.apache.aries.blueprint.core:1.8.2]
>         at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179)
[?:?]
>         at org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730)
[?:?]
>         at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485)
[?:?]
>         at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4563) [?:?]
>         at org.apache.felix.framework.Felix.startBundle(Felix.java:2173) [?:?]
>         at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1372) [?:?]
>         at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
[?:?]
>         at java.lang.Thread.run(Thread.java:748) [?:?]
> {noformat}
> I added a breakpoint to find out where it was requesting that the offending item be persisted.
The {{CatalogTypes$CatalogItemFromRegistredType}} instance is wrapping a {{BasicRegisteredType[org.apache.brooklyn.entity.group.QuarantineGroup:5.0.0-SNAPSHOT;null]}}.
Stacktrace below:
> {noformat}
> Daemon Thread [brooklyn-execmanager-i4bfeoG9-0] (Suspended (breakpoint at line 125 in
PeriodicDeltaChangeListener$DeltaCollector))	
> 	owns: PeriodicDeltaChangeListener  (id=284)	
> 	owns: Object  (id=285)	
> 	PeriodicDeltaChangeListener$DeltaCollector.add(BrooklynObject) line: 125	
> 	PeriodicDeltaChangeListener.onChanged(BrooklynObject) line: 541	
> 	PeriodicDeltaChangeListener.onManaged(BrooklynObject) line: 516	
> 	RebindManagerImpl$SafeChangeListener.onManaged(BrooklynObject) line: 643	
> 	BasicBrooklynCatalog.reset(CatalogDto, boolean) line: 233	
> 	BasicBrooklynCatalog.reset(CatalogDto) line: 191	
> 	BasicBrooklynCatalog.reset(Collection<CatalogItem<?,?>>) line: 244	
> 	CatalogInitialization.populateCatalogImpl(BasicBrooklynCatalog, boolean, boolean, Collection<CatalogItem<?,?>>)
line: 228	
> 	CatalogInitialization.populateCatalog(ManagementNodeState, boolean, boolean, Collection<CatalogItem<?,?>>)
line: 199	
> 	InitialFullRebindIteration(RebindIteration).installBundlesAndRebuildCatalog() line:
473	
> 	InitialFullRebindIteration(RebindIteration).doRun() line: 255	
> 	InitialFullRebindIteration.doRun() line: 69	
> 	InitialFullRebindIteration(RebindIteration).run() line: 282	
> 	RebindManagerImpl.rebindImpl(ClassLoader, RebindExceptionHandler, ManagementNodeState)
line: 575	
> 	RebindManagerImpl$3.call() line: 525	
> 	RebindManagerImpl$3.call() line: 523	
> 	BasicExecutionManager$SubmissionCallable<T>.call() line: 529	
> 	FutureTask<V>.run() line: 266	
> 	ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1149	
> 	ThreadPoolExecutor$Worker.run() line: 624	
> 	Thread.run() line: 748	
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message