hpcloud / cloudfoundry-jenkins

Jenkins plugin to push an application to Cloud Foundry at the end of a build
MIT License
4 stars 33 forks source link

Boolean cannot be cast to String #3

Closed jdeklerk2 closed 9 years ago

jdeklerk2 commented 9 years ago

Seeing this across multiple apps + languages:

Started by user anonymous
[EnvInject] - Loading node environment variables.
Building in workspace /var/lib/jenkins/jobs/ViasatBuild/workspace/integration_tests
Cloud Foundry Plugin:
WARNING: No manifest value for memory. Using default value: 512
WARNING: No manifest value for hostname. Using app name: domo.viasat.simulators
Pushing domo.viasat.simulators app to https://api.run.pez.pivotal.io
java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.String
    at org.cloudfoundry.client.lib.domain.CloudApplication.setEnv(CloudApplication.java:213)
    at org.cloudfoundry.client.lib.util.CloudEntityResourceMapper.mapApplicationResource(CloudEntityResourceMapper.java:177)
    at org.cloudfoundry.client.lib.util.CloudEntityResourceMapper.mapResource(CloudEntityResourceMapper.java:73)
    at org.cloudfoundry.client.lib.rest.CloudControllerClientImpl.mapCloudApplication(CloudControllerClientImpl.java:958)
    at org.cloudfoundry.client.lib.rest.CloudControllerClientImpl.getApplications(CloudControllerClientImpl.java:926)
    at org.cloudfoundry.client.lib.CloudFoundryClient.getApplications(CloudFoundryClient.java:218)
    at com.activestate.cloudfoundryjenkins.CloudFoundryPushPublisher.createApplicationIfNeeded(CloudFoundryPushPublisher.java:334)
    at com.activestate.cloudfoundryjenkins.CloudFoundryPushPublisher.processOneApp(CloudFoundryPushPublisher.java:236)
    at com.activestate.cloudfoundryjenkins.CloudFoundryPushPublisher.perform(CloudFoundryPushPublisher.java:179)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:779)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
    at hudson.model.Build$BuildExecution.post2(Build.java:185)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
    at hudson.model.Run.execute(Run.java:1769)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:374)
Build step 'Push to Cloud Foundry' marked build as failure
Finished: FAILURE
mtp401 commented 9 years ago

I had a similar issue:

java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
    at org.cloudfoundry.client.lib.domain.CloudApplication.setEnv(CloudApplication.java:213)
    at org.cloudfoundry.client.lib.util.CloudEntityResourceMapper.mapApplicationResource(CloudEntityResourceMapper.java:177)
    at org.cloudfoundry.client.lib.util.CloudEntityResourceMapper.mapResource(CloudEntityResourceMapper.java:73)
    at org.cloudfoundry.client.lib.rest.CloudControllerClientImpl.mapCloudApplication(CloudControllerClientImpl.java:958)
    at org.cloudfoundry.client.lib.rest.CloudControllerClientImpl.getApplications(CloudControllerClientImpl.java:926)
    at org.cloudfoundry.client.lib.CloudFoundryClient.getApplications(CloudFoundryClient.java:218)
    at com.activestate.cloudfoundryjenkins.CloudFoundryPushPublisher.createApplicationIfNeeded(CloudFoundryPushPublisher.java:334)
    at com.activestate.cloudfoundryjenkins.CloudFoundryPushPublisher.processOneApp(CloudFoundryPushPublisher.java:236)
    at com.activestate.cloudfoundryjenkins.CloudFoundryPushPublisher.perform(CloudFoundryPushPublisher.java:179)
    at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
    at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:770)
    at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:734)
    at hudson.model.Build$BuildExecution.post2(Build.java:183)
    at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:683)
    at hudson.model.Run.execute(Run.java:1770)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:89)
    at hudson.model.Executor.run(Executor.java:240)

This issue is a bug in the cloudfoundry client lib and was fixed in 1.1.1.

I've updated the shaded library that the the plugin uses and that fixed my issue. I've submitted PR #5 to fix.

WGautier commented 9 years ago

My apologies, I missed the notification on this. Version 1.4.2 includes the 1.1.3 cf client lib, so this should actually be fixed now.