brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BROOKLYN-451) Rebind of old persisted state for yaml-DSL broken
Date Tue, 14 Mar 2017 16:07:42 GMT

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

ASF GitHub Bot commented on BROOKLYN-451:
-----------------------------------------

Github user m4rkmckenna commented on a diff in the pull request:

    https://github.com/apache/brooklyn-server/pull/593#discussion_r105952235
  
    --- Diff: core/src/main/java/org/apache/brooklyn/util/core/xstream/XmlSerializer.java
---
    @@ -80,6 +80,11 @@ protected MapperWrapper wrapMapper(MapperWrapper next) {
     
             xstream.registerConverter(new EnumCaseForgivingConverter());
             xstream.registerConverter(new Inet4AddressConverter());
    +        
    +        // See ObjectWithDefaultStringImplConverter (and its usage) for why we want to
auto-detect 
    +        // annotations (usages of this is in the camp project, so we can't just list
it statically
    +        // here unfortunately).
    +        xstream.autodetectAnnotations(true);
    --- End diff --
    
    From http://x-stream.github.io/annotations-tutorial.html#AutoDetect
    
    > In auto-detection mode XStream will have to examine any unknown class type for annotations.
This will slow down the marshalling process until all processed types have been examined once.


> Rebind of old persisted state for yaml-DSL broken
> -------------------------------------------------
>
>                 Key: BROOKLYN-451
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-451
>             Project: Brooklyn
>          Issue Type: Bug
>            Reporter: Aled Sage
>            Priority: Blocker
>
> As discovered by Ivana, rebinding to old persisted state of yaml-DSL is broken (in 0.11.0-SNAPSHOT
only).
> I've added example failing tests at https://github.com/apache/brooklyn-server/pull/593.
> The error message that Ivana hit is shown below:
> {noformat}
> 2017-03-13 18:32:45,954 WARN  120 o.a.b.c.m.r.RebindExceptionHandlerImpl [nager-o3dVnQ0i-0]
problem adding enricher klcueb1ide (Transformer{name=org.apache.brooklyn.enricher.stock.Transformer,
uniqueTag=docker-bind-url-generator, running=true, entity=VanillaSoftwareProcessImpl{id=ofov78knm2},
id=klcueb1ide}) to entity ofov78knm2 (VanillaSoftwareProcessImpl{id=ofov78knm2}); continuing
> java.lang.IllegalArgumentException: Error resolving config enricher.targetSensor, $brooklyn:sensorName(java.lang.Object@74d44767),
in org.apache.brooklyn.util.core.task.BasicExecutionContext@700e5716([Wrapped[contextEntity:VanillaSoftwareProcessImpl{id=ofov78knm2}],
LocalManagementContext[Sm0k6v6V-o3dVnQ0i]]): Cannot resolve 'java.lang.Object@74d44767' as
a sensor (got type java.lang.Object)
> 	at org.apache.brooklyn.util.core.task.ValueResolver.getMaybeInternal(ValueResolver.java:548)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.util.core.task.ValueResolver.getMaybe(ValueResolver.java:319)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.util.core.task.ValueResolver.get(ValueResolver.java:312)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.util.core.task.Tasks.resolveValue(Tasks.java:147)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.config.BasicConfigKey.resolveValue(BasicConfigKey.java:405)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.config.BasicConfigKey.extractValue(BasicConfigKey.java:390)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl.resolveRawValueFromContainer(AbstractConfigMapImpl.java:316)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl$3.apply(AbstractConfigMapImpl.java:376)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl$3.apply(AbstractConfigMapImpl.java:372)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl.getConfigImpl(AbstractConfigMapImpl.java:388)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.config.internal.AbstractConfigMapImpl.getConfig(AbstractConfigMapImpl.java:109)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.objs.AbstractConfigurationSupportInternal.get(AbstractConfigurationSupportInternal.java:173)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.objs.AbstractEntityAdjunct.getConfig(AbstractEntityAdjunct.java:330)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.enricher.stock.AbstractTransformer.setEntity(AbstractTransformer.java:82)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.entity.AbstractEntity$BasicEnricherSupport.add(AbstractEntity.java:1695)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.mgmt.rebind.BasicEntityRebindSupport.addEnrichers(BasicEntityRebindSupport.java:157)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.mgmt.rebind.BasicEntityRebindSupport.addEnrichers(BasicEntityRebindSupport.java:56)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.associateAdjunctsWithEntities(RebindIteration.java:649)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.doRun(RebindIteration.java:243)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.mgmt.rebind.InitialFullRebindIteration.doRun(InitialFullRebindIteration.java:69)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.mgmt.rebind.RebindIteration.run(RebindIteration.java:265)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl.rebindImpl(RebindManagerImpl.java:560)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:510)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.core.mgmt.rebind.RebindManagerImpl$3.call(RebindManagerImpl.java:508)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.util.core.task.BasicExecutionManager$SubmissionCallable.call(BasicExecutionManager.java:529)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_101]
> 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_101]
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_101]
> 	at java.lang.Thread.run(Thread.java:745)[:1.8.0_101]
> Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Cannot resolve
'java.lang.Object@74d44767' as a sensor (got type java.lang.Object)
> 	at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:130)[141:org.apache.brooklyn.utils-common:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.util.time.Durations.get(Durations.java:63)[141:org.apache.brooklyn.utils-common:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.util.time.Durations.get(Durations.java:68)[141:org.apache.brooklyn.utils-common:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.util.core.task.ValueResolver.getMaybeInternal(ValueResolver.java:483)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	... 28 more
> Caused by: java.util.concurrent.ExecutionException: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException:
Cannot resolve 'java.lang.Object@74d44767' as a sensor (got type java.lang.Object)
> 	at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_101]
> 	at java.util.concurrent.FutureTask.get(FutureTask.java:192)[:1.8.0_101]
> 	at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)[68:com.google.guava:18.0.0]
> 	at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.util.time.Durations.get(Durations.java:43)[141:org.apache.brooklyn.utils-common:0.11.0.20170310_1638]
> 	... 30 more
> Caused by: org.apache.brooklyn.util.exceptions.PropagatedRuntimeException: Cannot resolve
'java.lang.Object@74d44767' as a sensor (got type java.lang.Object)
> 	at org.apache.brooklyn.util.exceptions.Exceptions.propagate(Exceptions.java:130)[141:org.apache.brooklyn.utils-common:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.camp.brooklyn.spi.dsl.BrooklynDslDeferredSupplier.get(BrooklynDslDeferredSupplier.java:120)[118:org.apache.brooklyn.camp:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.util.core.task.ValueResolver$2.call(ValueResolver.java:468)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.util.core.task.DynamicSequentialTask$DstJob.call(DynamicSequentialTask.java:362)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	... 5 more
> Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalStateException:
Cannot resolve 'java.lang.Object@74d44767' as a sensor (got type java.lang.Object)
> 	at java.util.concurrent.FutureTask.report(FutureTask.java:122)[:1.8.0_101]
> 	at java.util.concurrent.FutureTask.get(FutureTask.java:192)[:1.8.0_101]
> 	at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:63)[68:com.google.guava:18.0.0]
> 	at org.apache.brooklyn.util.core.task.BasicTask.get(BasicTask.java:361)[120:org.apache.brooklyn.core:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.camp.brooklyn.spi.dsl.BrooklynDslDeferredSupplier.get(BrooklynDslDeferredSupplier.java:114)[118:org.apache.brooklyn.camp:0.11.0.20170310_1638]
> 	... 7 more
> Caused by: java.lang.IllegalStateException: Cannot resolve 'java.lang.Object@74d44767'
as a sensor (got type java.lang.Object)
> 	at org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent$DslSensorSupplier$1.resolve(DslComponent.java:710)[118:org.apache.brooklyn.camp:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent$DslSensorSupplier$1.resolve(DslComponent.java:708)[118:org.apache.brooklyn.camp:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent$DslSensorSupplier$1.call(DslComponent.java:691)[118:org.apache.brooklyn.camp:0.11.0.20170310_1638]
> 	at org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent$DslSensorSupplier$1.call(DslComponent.java:688)[118:org.apache.brooklyn.camp:0.11.0.20170310_1638]
> 	... 5 more
> {noformat}
> The persisted state contains things like:
> {noformat}
>   <config>
>     <myConfigKeyName>myval</myConfigKeyName>
>     <sensorSupplier1>
>       <org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent_-DslSensorSupplier>
>         <component>
>           <componentId></componentId>
>           <scope>THIS</scope>
>         </component>
>         <sensorName>mySensorName</sensorName>
>       </org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.DslComponent_-DslSensorSupplier>
>     </sensorSupplier1>
>  {noformat}
>  
> More recent persisted state would instead say {{<sensorName class="string">mySensorName</sensorName>}}.
> This is because the field {{DslSensorSupplier.sensorName}} was changed from type String
to Object in commit https://github.com/apache/brooklyn-server/commit/b70346cc6fd6c7a898305157082565e527649104
> When xstream tries to deserialize the persisted state, it doesn't know what type the
field should be. It therefore instantiates a {{java.lang.Object}} (and ignores the actual
xml element such as "mySensorName" in the example above!).



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message