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.

Error iterating over configurations #4034

tardis4500 ·

I'm trying to write a script to use in a copy variables step to generate a list of configurations.
groovy:
builds = system.getConfiguration('ConstructConnect/Builds/BaRT')
branches = []
for (branch in builds.children) { branches.add(branch.pathName) }
branches

but this fails with:
16:36:20,754 INFO - Executing pre-execute action...
16:36:20,755 INFO - Running step...
16:36:20,782 INFO - Executing post-execute action...
16:36:20,782 ERROR - Step 'master' is failed: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.pmease.quickbuild.model.Configuration.children, could not initialize proxy - no Session
at org.hibernate.collection.internal.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:576)
at org.hibernate.collection.internal.AbstractPersistentCollection.withTemporarySessionIfNeeded(AbstractPersistentCollection.java:215)
at org.hibernate.collection.internal.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:555)
at org.hibernate.collection.internal.AbstractPersistentCollection.read(AbstractPersistentCollection.java:143)
at org.hibernate.collection.internal.PersistentBag.iterator(PersistentBag.java:294)
at java_util_List$iterator.call(Unknown Source)
at script15470695063751555691953.run(script15470695063751555691953.groovy:4)
at com.pmease.quickbuild.plugin.basis.BasisPlugin$32.evaluate(BasisPlugin.java:382)
at com.pmease.quickbuild.DefaultScriptEngine.evaluate(DefaultScriptEngine.java:305)
at com.pmease.quickbuild.DefaultScriptEngine.evaluate(DefaultScriptEngine.java:74)
at com.pmease.quickbuild.setting.step.repetition.ScriptValues.get(ScriptValues.java:34)
at com.pmease.quickbuild.setting.step.repetition.ScriptValues$$EnhancerByCGLIB$$88036191.CGLIB$get$2( )
at com.pmease.quickbuild.setting.step.repetition.ScriptValues$$EnhancerByCGLIB$$88036191$$FastClassByCGLIB$$ec0a447f.invoke( )
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.repetition.ScriptValues$$EnhancerByCGLIB$$88036191.get( )
at com.pmease.quickbuild.stepsupport.CompositeStep.findChildren(CompositeStep.java:180)
at com.pmease.quickbuild.stepsupport.SequentialStep$$EnhancerByCGLIB$$707b0f41.CGLIB$findChildren$15( )
at com.pmease.quickbuild.stepsupport.SequentialStep$$EnhancerByCGLIB$$707b0f41$$FastClassByCGLIB$$fbe797b0.invoke( )
at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:215)
at com.pmease.quickbuild.DefaultScriptEngine$Interpolator.intercept(DefaultScriptEngine.java:261)
at com.pmease.quickbuild.stepsupport.SequentialStep$$EnhancerByCGLIB$$707b0f41.findChildren( )
at com.pmease.quickbuild.stepsupport.SequentialStep.triggerChildren(SequentialStep.java:33)
at com.pmease.quickbuild.stepsupport.CompositeStep.run(CompositeStep.java:117)
at com.pmease.quickbuild.stepsupport.Step.doExecute(Step.java:664)
at com.pmease.quickbuild.stepsupport.Step.execute(Step.java:570)
at com.pmease.quickbuild.stepsupport.StepExecutionJob.executeStepAwareJob(StepExecutionJob.java:31)
at com.pmease.quickbuild.stepsupport.StepAwareJob.executeBuildAwareJob(StepAwareJob.java:56)
at com.pmease.quickbuild.BuildAwareJob.execute(BuildAwareJob.java:77)
at com.pmease.quickbuild.grid.GridJob.run(GridJob.java:129)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

  • replies 3
  • views 17
  • stars 0
robinshen ADMIN ·

Please use system.configurationManager.getChildren(builds) instead of builds.children, as access to children directly needs a hibernate session context which is not available in script by default.

tardis4500 ·

Unfortunately, I have configurations with '=' in the name but the run fails because parameter values can't have '=' in them. How is it possible to loop over configurations which have '=' in them?

robinshen ADMIN ·

This is not possible as QB uses '=' character to identify param name/value pair. Please consider to replace '=' with some other character in your configuration.