Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

script help #3695

scastria ·
I cannot figure this out. I am trying to use a script for a step success condition. I can't even get a simple thing to work. I do NOT put the script delimiters since QB is expecting a script. I try this:

vars.get("shouldStartService").getBooleanValue()

and I keep getting:

Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Boolean
at com.pmease.quickbuild.setting.step.executecondition.ScriptExecuteCondition.satisfied(ScriptExecuteCondition.java:39)
at com.pmease.quickbuild.setting.step.executecondition.ScriptExecuteCondition$$EnhancerByCGLIB$$28cf2732.CGLIB$satisfied$1(<generated>)
at com.pmease.quickbuild.setting.step.executecondition.ScriptExecuteCondition$$EnhancerByCGLIB$$28cf2732$$FastClassByCGLIB$$fe12f907.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:261)
at com.pmease.quickbuild.setting.step.executecondition.ScriptExecuteCondition$$EnhancerByCGLIB$$28cf2732.satisfied(<generated>)
at com.pmease.quickbuild.stepsupport.Step.shouldExecute(Step.java:747)
at com.pmease.quickbuild.plugin.basis.CommandBuildStep$$EnhancerByCGLIB$$9afe18cf.CGLIB$shouldExecute$89(<generated>)
at com.pmease.quickbuild.plugin.basis.CommandBuildStep$$EnhancerByCGLIB$$9afe18cf$$FastClassByCGLIB$$78f00ad4.invoke(<generated>)
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:261)
at com.pmease.quickbuild.plugin.basis.CommandBuildStep$$EnhancerByCGLIB$$9afe18cf.shouldExecute(<generated>)
at com.pmease.quickbuild.stepsupport.StepProcessJob.executeStepAwareJob(StepProcessJob.java:34)
... 8 more


I tried different things for 1 hour and it all returns this same exception. What am I missing?
  • replies 2
  • views 606
  • stars 0
Varal ·
First of all I would suggest vars.getValue() instead of vars.get() as getValue returns a String whereas get returns a VariableWrapper object.
Second thing the error states clearly that the script is trying to cast String to Boolean, so instead of getBooleanValue() i would simply try to compare two strings:

vars.getValue("shouldStartService") == "true"


If this doesn't work try to print the result of vars.get("shouldStartService") or vars.getValue("shouldStartService") to know what you are actually dealing with <!-- s:) --><img src="{SMILIES_PATH}/icon_smile.gif" alt=":)" title="Smile" /><!-- s:) -->

Hope this helps!
robinshen ADMIN ·
You mentioned step success condition, but the stack trace is about step execute condition script. If you mean about step execute condition, it work at my side with both QB6 and QB7.