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

System Classloader getting closed by the GroovyParser.clearCache() method #851

Closed
rbioteau opened this issue Mar 23, 2019 · 6 comments
Closed
Assignees
Labels
Milestone

Comments

@rbioteau
Copy link

When GroovyParser.clearCache() is called (when a project is closed or a Full build is invoked), all URLClassloader in the parent hierachy are closed including the System Classloader.

It leads to errors when the application try to load classes from the JRE like the crypto classes.
The side effect is that it is no more possible to fetch a git repository by example, you get exceptions like

java.security.NoSuchAlgorithmException: SunTls12RsaPremasterSecret KeyGenerator not available

The GroovyClassLoaderFactory should filter the Classloader.getSystemClassloader() in the close() method.

@eric-milles eric-milles self-assigned this Mar 23, 2019
@eric-milles eric-milles added this to the v3.3.0 milestone Mar 23, 2019
eric-milles added a commit that referenced this issue Mar 23, 2019
or any other not created by GroovyClassLoaderFactory
@eric-milles
Copy link
Member

Thanks for finding the source of this issue and reporting it. I was wondering why I was seeing https problems in the past few days.

Ready to test.

@rbioteau
Copy link
Author

The fix resolves my issue. 👍
I don't know about the potential other side effects though.

Do you know if it is possible to integrate groovy-eclipse v3.3.0 on a 2018-12 target platform (with org.eclipse.jdt.core_3.16.0.xx-201812291959-e2018-12-RELEASE) ? Or do I need to update JDT too ?

@eric-milles
Copy link
Member

Are you asking about the Java 12 patch or something else?

@rbioteau
Copy link
Author

Not especially, it is just that we integrate groovy-eclipse in a RCP product ans we are targeting Eclipse 2018-12 target platform for our june release. The compatible version of groovy-eclipse for this version is v3.2.0. If I want this fix in my version for June, is it possible to keep all other plugins on the 2018-12 release train and only update groov-eclipse to v3.3.0 when it comes out ?
I known that groovy-eclipse patches jdt so there could some issues on this side of the integration.

@eric-milles
Copy link
Member

This issue should not be present in the 3.2.0 release. Use of system class loader was done in the past week as a response to Java 12 testing. 3.3.0 will be released very soon -- before the end of March.

Also, I'm curious about the product integration. Can you share details about the product or is it not available to the public? I always try to keep in mind the different circumstances where the compiler, editor and whatnot could be used when planning/making changes.

@rbioteau
Copy link
Author

Sadly, this issue was present in 3.2.0. That's where I found it. As the close() was recusring all the parent URLClassloader, it was falling to the system class loader anyway.

I tried to integration the 3.3.0 snapshot and it looks ok.

I work at Bonitasoft. We use groovy as a scripting language in a BPM engine.
We have Studio which is an Eclipse RCP integrating groovy-eclipse.
Bonita is open source if you want to have a look.
https://fr.bonitasoft.com/ and https://github.com/bonitasoft/bonita-studio

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants