Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIXED JENKINS-37538] Set the context class loader to a neutral value inside step executions #50

Merged
merged 1 commit into from Aug 25, 2016

Conversation

jglick
Copy link
Member

@jglick jglick commented Aug 24, 2016

JENKINS-37538

Amends #42. Probably fixes a bug which I have not yet been able to reproduce. My working hypothesis is that with certain class loaders as Thread.contextClassLoader, SAXParserFactory.newInstance() fails for reasons TBD but probably related to a mismatch between the ClassLoader defining some copy of SAXParserFactory and one defining a copy of org.apache.xerces.jaxp.SAXParserFactoryImpl, due to a design flaw in ServiceLoader.

My first thought was to use d.clazz.getClassLoader() so that the Step’s own plugin code would be available, but in the case of artifactory (cf. jfrog/jenkins-artifactory-plugin#30) this will delegate to the loader of parameterized-trigger which currently (reasons TBD) bundles WEB-INF/lib/xercesImpl-2.9.1.jar, so that is still possibly a problem. Instead I am taking the more conservative choice of the context loader in effect for most other plugin code in Jenkins, leaving the use of GroovyClassLoader.InnerLoader to code run directly from Pipeline script.

@reviewbybees

@ghost
Copy link

ghost commented Aug 24, 2016

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@jglick jglick changed the title [JENKINS-37538] Set the context class loader to a neutral value inside step executions [FIXED JENKINS-37538] Set the context class loader to a neutral value inside step executions Aug 25, 2016
@rsandell
Copy link
Member

🐝

@oleg-nenashev
Copy link
Member

LGTM 🐝

@jglick jglick merged commit 6f65f3c into jenkinsci:master Aug 25, 2016
@jglick jglick deleted the CCL-JENKINS-37538 branch August 25, 2016 12:52
svanoort added a commit that referenced this pull request Sep 28, 2017
…okup

[JENKINS-37573] / [JENKINS-45553] Provide a fast view of block structures in the flow graph
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants