Issue Type: Bug Bug
Assignee: Gregory Boissinot
Components: envinject
Created: 14/Feb/13 8:55 PM
Description:

https://partnerdemo.ci.cloudbees.com/job/Cloud-Foundry/job/spring-maven/1/ failed with:

[EnvInject] - Loading node environment variables.
[EnvInject] - [ERROR] - SEVERE ERROR occurs: java.io.InvalidClassException: org.jenkinsci.plugins.envinject.EnvInjectListener$2; org.jenkinsci.plugins.envinject.EnvInjectListener$2; class invalid for deserialization

which corrected itself after a restart. The 1.83 plugin was in use (at least after the restart—not sure about before); the inner class seems to be this:

return new Environment() {
    @Override
    public void buildEnvVars(Map<String, String> env) {
        envInjectEnvVarsService.resolveVars(mergedVariables, mergedVariables);
        env.putAll(mergedVariables);
    }
};

Environment is not meant to be serializable AFAICT so I am not sure why this was producing a serialization-related error message. But if this class does in fact get sent over the wire, using an anonymous inner class is dangerous. Refactor into a named static member class instead. Or perhaps some other inner class was supposed to be serializable, and got confused with this one due to the generic name $2, in which case there would be a similar fix.

The job was a Maven moduleset, with no configuration from the plugin.

By the way various copies of

new Environment() {}

could be factored into a single constant; or better yet, use the factory method in Environment with an empty EnvVars.

Project: Jenkins
Labels: serialization
Priority: Minor Minor
Reporter: Jesse Glick
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to