[ http://jira.magnolia.info/browse/MAGNOLIA-1392?page=comments#action_13555
]
Fabrizio Giustina commented on MAGNOLIA-1392:
---------------------------------------------
thanks John!
I had a deeper look at BooleanAttribute and it seems that the only way you can
set an invalid (non boolean) internal value is by using the setter method
inherited by AtomicAttribute. This is why you ends up with a String value in
magnolia (it doesn't use the constructor but the getter).
A better way to definitively fix it is to override the setValue() method in
order to be sure that value is always a boolean... this is what I would add in
BooleanAttribute:
public void setValue(Object value)
{
if (value == null)
{
throw new IllegalArgumentException("Cannot set to a null value");
}
else
{
this.value = "true".equalsIgnoreCase(value.toString());
}
}
> ClassCastException in openwfe when a filter sets a request parameter with
> value "true"
> --------------------------------------------------------------------------------------
>
> Key: MAGNOLIA-1392
> URL: http://jira.magnolia.info/browse/MAGNOLIA-1392
> Project: Magnolia
> Issue Type: Bug
> Components: workflow
> Affects Versions: 3.0.1
> Reporter: Fabrizio Giustina
> Assigned To: Fabrizio Giustina
> Priority: Critical
>
> Not sure if this should be handled in openwfe or if it should be handled in
> magnolia.
> If a filter sets a request attribute with value "true" (as a string, not a
> boolean) workflow doesn't work anymore: the following stacktrace is what
> happens when doing an activation:
> (spring filters always set this attribute...)
> ERROR info.magnolia.module.workflow.WorkflowUtil
> WorkflowUtil.java(proceed:172) 20.02.2007 14:20:51 Error while accessing the
> workflow engine
> java.lang.ClassCastException: java.lang.String cannot be cast to
> java.lang.Boolean
> at
> openwfe.org.engine.workitem.BooleanAttribute.booleanValue(BooleanAttribute.java:94)
> at
> openwfe.org.engine.workitem.BooleanAttribute.clone(BooleanAttribute.java:99)
> at
> openwfe.org.engine.workitem.MapAttribute.clone(MapAttribute.java:215)
> at
> openwfe.org.engine.workitem.MapAttribute.clone(MapAttribute.java:206)
> at
> openwfe.org.engine.workitem.InFlowWorkItem.clone(InFlowWorkItem.java:224)
> at
> openwfe.org.engine.expressions.SubProcessRefExpression.doLaunch(SubProcessRefExpression.java:627)
> at
> openwfe.org.engine.expressions.SubProcessRefExpression.innerLaunch(SubProcessRefExpression.java:549)
> at
> openwfe.org.engine.expressions.SubProcessRefExpression.apply(SubProcessRefExpression.java:268)
> at
> openwfe.org.engine.expressions.raw.RawExpression.apply(RawExpression.java:371)
> at
> openwfe.org.engine.expressions.state.NormalState.apply(NormalState.java:112)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.applyOrLaunch(SimpleExpressionPool.java:529)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.apply(SimpleExpressionPool.java:542)
> at
> openwfe.org.engine.expressions.IfExpression.applyConsequence(IfExpression.java:254)
> at
> openwfe.org.engine.expressions.IfExpression.apply(IfExpression.java:144)
> at
> openwfe.org.engine.expressions.raw.RawExpression.apply(RawExpression.java:371)
> at
> openwfe.org.engine.expressions.state.NormalState.apply(NormalState.java:112)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.applyOrLaunch(SimpleExpressionPool.java:529)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.apply(SimpleExpressionPool.java:542)
> at
> openwfe.org.engine.expressions.SequentialFlowExpression.apply(SequentialFlowExpression.java:140)
> at
> openwfe.org.engine.expressions.state.NormalState.apply(NormalState.java:112)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.applyOrLaunch(SimpleExpressionPool.java:529)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.apply(SimpleExpressionPool.java:542)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.apply(SimpleExpressionPool.java:554)
> at
> openwfe.org.engine.expressions.SequenceExpression.reply(SequenceExpression.java:130)
> at
> openwfe.org.engine.expressions.state.NormalState.reply(NormalState.java:118)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.reply(SimpleExpressionPool.java:713)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.replyToParent(SimpleExpressionPool.java:644)
> at
> openwfe.org.engine.expressions.AbstractFlowExpression.replyToParent(AbstractFlowExpression.java:479)
> at
> openwfe.org.engine.expressions.AbstractFlowExpression.applyToParent(AbstractFlowExpression.java:494)
> at
> openwfe.org.engine.expressions.LogExpression.apply(LogExpression.java:153)
> at
> openwfe.org.engine.expressions.raw.RawExpression.apply(RawExpression.java:371)
> at
> openwfe.org.engine.expressions.state.NormalState.apply(NormalState.java:112)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.applyOrLaunch(SimpleExpressionPool.java:529)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.apply(SimpleExpressionPool.java:542)
> at
> openwfe.org.engine.expressions.SequentialFlowExpression.apply(SequentialFlowExpression.java:140)
> at
> openwfe.org.engine.expressions.state.NormalState.apply(NormalState.java:112)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.applyOrLaunch(SimpleExpressionPool.java:529)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.apply(SimpleExpressionPool.java:542)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.apply(SimpleExpressionPool.java:554)
> at
> openwfe.org.engine.expressions.SequenceExpression.reply(SequenceExpression.java:130)
> at
> openwfe.org.engine.expressions.state.NormalState.reply(NormalState.java:118)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.reply(SimpleExpressionPool.java:713)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.replyToParent(SimpleExpressionPool.java:644)
> at
> openwfe.org.engine.expressions.AbstractFlowExpression.replyToParent(AbstractFlowExpression.java:479)
> at
> openwfe.org.engine.expressions.IfExpression.applyConsequence(IfExpression.java:260)
> at
> openwfe.org.engine.expressions.IfExpression.apply(IfExpression.java:144)
> at
> openwfe.org.engine.expressions.raw.RawExpression.apply(RawExpression.java:371)
> at
> openwfe.org.engine.expressions.state.NormalState.apply(NormalState.java:112)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.applyOrLaunch(SimpleExpressionPool.java:529)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.apply(SimpleExpressionPool.java:542)
> at
> openwfe.org.engine.expressions.SequentialFlowExpression.apply(SequentialFlowExpression.java:140)
> at
> openwfe.org.engine.expressions.state.NormalState.apply(NormalState.java:112)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.applyOrLaunch(SimpleExpressionPool.java:529)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.apply(SimpleExpressionPool.java:542)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.apply(SimpleExpressionPool.java:554)
> at
> openwfe.org.engine.expressions.SequenceExpression.reply(SequenceExpression.java:130)
> at
> openwfe.org.engine.expressions.state.NormalState.reply(NormalState.java:118)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.reply(SimpleExpressionPool.java:713)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.replyToParent(SimpleExpressionPool.java:644)
> at
> openwfe.org.engine.expressions.AbstractFlowExpression.replyToParent(AbstractFlowExpression.java:479)
> at
> openwfe.org.engine.expressions.OneOrZeroChildExpression.reply(OneOrZeroChildExpression.java:92)
> at
> openwfe.org.engine.expressions.ParticipantExpression.reply(ParticipantExpression.java:655)
> at
> openwfe.org.engine.expressions.state.NormalState.reply(NormalState.java:118)
> at
> openwfe.org.engine.impl.expool.SimpleExpressionPool.reply(SimpleExpressionPool.java:713)
> at
> openwfe.org.embed.impl.engine.AbstractEngine.reply(AbstractEngine.java:264)
> at
> info.magnolia.module.workflow.WorkflowUtil.proceed(WorkflowUtil.java:169)
> at
> info.magnolia.module.workflow.WorkflowUtil.proceed(WorkflowUtil.java:152)
> at
> info.magnolia.module.workflow.WorkflowUtil.proceed(WorkflowUtil.java:129)
> at info.magnolia.module.workflow.inbox.Inbox.proceed(Inbox.java:259)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> info.magnolia.cms.servlets.MVCServletHandlerImpl.execute(MVCServletHandlerImpl.java:96)
> at
> info.magnolia.cms.servlets.CommandBasedMVCServletHandler.execute(CommandBasedMVCServletHandler.java:66)
> at info.magnolia.cms.servlets.MVCServlet.doPost(MVCServlet.java:111)
> at
> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:174)
> at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.magnolia.info/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/developer.html
----------------------------------------------------------------