I'm a bit green when it comes to Jenkins. From what I can see, I don't have 
any scripts in my job that are causing this problem. It only occurs when I 
try to send multiple parameters to a Job Generator. What I need to be able 
to do is pass the environment from the current job (a freestyle job) to a 
job generator job. I did some digging and found this prior jenkins issue 
<https://issues.jenkins-ci.org/browse/JENKINS-18115?jql=project%20%3D%20JENKINS%20AND%20status%20in%20(Resolved%2C%20Closed)%20AND%20component%20%3D%20jobgenerator-plugin>
 that 
seems to be the same problem, but it was supposedly fixed in 2013. I think 
it may have been better if GeneratorKeyValueParameterValue instead had a 
constructor that takes a StringParameterValueParameter as it's only 
parameter, and use that constructor to create the parameter values instead 
of trying to downcast the StringParameterValueParameters.


On Thursday, December 17, 2015 at 12:48:08 PM UTC-6, Victor Martinez wrote:
>
> Hi there (beforehand),
>
>  AFAIS there is cast issue when converting a StringParameterValue to 
> GeneratorKeyValueParameterValue, basically it means that script is 
> somehow expecting another kind of input parameter. Can you review your 
> script? It's worth if you gist your script to help you out 
>
> Cheers (afterwards)
>
> On Thursday, 17 December 2015 19:09:28 UTC+1, Ranando King wrote:
>>
>> I've tried creating a Freestyle Project with multiple parameters. That 
>> works fine.
>> I've tried creating a Job Generator with multiple generator parameters. 
>> That works fine.
>> I've tried calling the Job Generator from the Freestyle Project passing a 
>> single pre-defined parameter (key=value). That works fine.
>> I've tried calling the Job Generator from the Freestyle Project passing 
>> multiple pre-defined parameters. That fails with
>>
>> Started by upstream project "ADMIN_CreateMobileProjectWorkingBranch 
>> <http://macmini01.jbhunt.com:8000/jenkins/job/ADMIN_CreateMobileProjectWorkingBranch/>"
>>  build number 28 
>> <http://macmini01.jbhunt.com:8000/jenkins/job/ADMIN_CreateMobileProjectWorkingBranch/28>
>> originally caused by:
>>  Started by user Ranando King 
>> <http://macmini01.jbhunt.com:8000/jenkins/user/jisark5>
>> [EnvInject] - Loading node environment variables.
>> [EnvInject] - Preparing an environment for the build.
>> [EnvInject] - Keeping Jenkins system variables.
>> [EnvInject] - Keeping Jenkins build variables.
>> [EnvInject] - Injecting contributions.
>> Building in workspace 
>> /Applications/jenkins-1.638-1/apps/jenkins/jenkins_home/jobs/GENERATOR_Create_BUILD_DEV_Job/workspace@16
>> FATAL: hudson.model.StringParameterValue cannot be cast to 
>> org.jenkinsci.plugins.jobgenerator.parameters.GeneratorKeyValueParameterValuejava.lang.ClassCastException
>>  
>> <http://stacktrace.jenkins-ci.org/search?query=java.lang.ClassCastException>:
>>  hudson.model.StringParameterValue cannot be cast to 
>> org.jenkinsci.plugins.jobgenerator.parameters.GeneratorKeyValueParameterValue
>>      at 
>> org.jenkinsci.plugins.jobgenerator.GeneratorRun.expand(GeneratorRun.java:164)
>>  
>> <http://stacktrace.jenkins-ci.org/search/?query=org.jenkinsci.plugins.jobgenerator.GeneratorRun.expand&entity=method>
>>      at 
>> org.jenkinsci.plugins.jobgenerator.GeneratorRun.getExpandedJobName(GeneratorRun.java:217)
>>  
>> <http://stacktrace.jenkins-ci.org/search/?query=org.jenkinsci.plugins.jobgenerator.GeneratorRun.getExpandedJobName&entity=method>
>>      at 
>> org.jenkinsci.plugins.jobgenerator.GeneratorRun$GeneratorImpl.checkParameters(GeneratorRun.java:730)
>>  
>> <http://stacktrace.jenkins-ci.org/search/?query=org.jenkinsci.plugins.jobgenerator.GeneratorRun$GeneratorImpl.checkParameters&entity=method>
>>      at 
>> org.jenkinsci.plugins.jobgenerator.GeneratorRun$GeneratorImpl.doRun(GeneratorRun.java:295)
>>  
>> <http://stacktrace.jenkins-ci.org/search/?query=org.jenkinsci.plugins.jobgenerator.GeneratorRun$GeneratorImpl.doRun&entity=method>
>>      at 
>> hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:534)
>>  
>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.AbstractBuild$AbstractBuildExecution.run&entity=method>
>>      at hudson.model.Run.execute(Run.java:1738) 
>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Run.execute&entity=method>
>>      at 
>> org.jenkinsci.plugins.jobgenerator.GeneratorRun.run(GeneratorRun.java:284) 
>> <http://stacktrace.jenkins-ci.org/search/?query=org.jenkinsci.plugins.jobgenerator.GeneratorRun.run&entity=method>
>>      at hudson.model.ResourceController.execute(ResourceController.java:98) 
>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.ResourceController.execute&entity=method>
>>      at hudson.model.Executor.run(Executor.java:410) 
>> <http://stacktrace.jenkins-ci.org/search/?query=hudson.model.Executor.run&entity=method>
>> Finished: FAILURE
>>
>>
>> I've tried calling the Job Generator from the Freestyle Project using every 
>> combination of current build parameters and current generator parameters. 
>> They all fail with the same error as before.
>>
>> Any ideas how to get past this?
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/13b5e5ac-b6f2-421b-8e04-302add9eb37f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to