-
Notifications
You must be signed in to change notification settings - Fork 83
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
P2Tests fail since separation of batch compiler plugin from jdt core #419
P2Tests fail since separation of batch compiler plugin from jdt core #419
Comments
@vik-chand : do you know where in the platform code (PDE?/Ant?) we specify or resolve ant classpath and add |
OK, that was not that easy but I believe I've found it: Now, the jar simply misses classes moved to batch compiler bundle. |
State before eclipse-jdt/eclipse.jdt.core#182: |
…t#181) Add moved classes located now in org.eclipse.jdt.core.compiler.batch to the jdtCompilerAdapter.jar used by pde.build & Ant (see org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator). See eclipse-pde/eclipse.pde#419 eclipse-jdt#181
Add moved classes located now in org.eclipse.jdt.core.compiler.batch to the jdtCompilerAdapter.jar used by pde.build & Ant (see org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator). See eclipse-pde/eclipse.pde#419 #181
…ipse-jdt#181) Add moved classes located now in org.eclipse.jdt.core.compiler.batch to the jdtCompilerAdapter.jar used by pde.build & Ant (see org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator). See eclipse-pde/eclipse.pde#419 eclipse-jdt#181
Add moved classes located now in org.eclipse.jdt.core.compiler.batch to the jdtCompilerAdapter.jar used by pde.build & Ant (see org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator). See eclipse-pde/eclipse.pde#419 #181
I hope with eclipse-jdt/eclipse.jdt.core#579 the problem should be fixed. |
Hmm. I can't see what should be different now, because I don't know how ant/PDE uses ecj. |
It's little odd. It says |
Arrgh, Ed, I was blind, I didn't expected that there is more than "just" missing JDTCompilerAdapter! The code in org.eclipse.ant.internal.core.AntClassLoader.loadClassPlugins(String) looks over contributed |
Neither one is trivial. There must be yet another hack or hardcoded assumption somewhere. Most important part of the stack
If I contribute batch compiler as "extraClasspathEntry", I still see same error.
If I add ant library as optional dependency to batch compiler, I can load DefaultCompilerAdapter from JDTCompilerAdapter but in next step ant throws exception that the super interfaces are different - because they were loaded from different class loaders. So JDT or PDE or ANT did before something to load batch compiler from same ant classloader that loaded DefaultCompilerAdapter. I don't see how they did that yet. :-( |
What sounds strange is that "org.eclipse.jdt.core.compiler.batch" is mentioned in the exception but you said it does not depends on ant (or does it?). I think I have seen some ant jar mangling stuff. Have you tried using
SO probably you could remove the ant.jar from the classpath, then see what packages are required and add all of those as optional/dynamic imports... |
The problem is not missing ant but wrong classloader. |
So it does work now? Because what I wanted to say is that if you only import one package but others are also required they might be loaded from somwhere else and producing issues. |
Yes. I'm just busy with other work. I have to write some documentation wrap up before committing how this magic works so next time someone wants to debug a problem it would be easier to find who does what and why and why not in usual way. |
Great! That is really good to hear. |
See README.md why the JDTCompilerAdapter classloading is not trivial. TL;DR: OSGI classloader from org.eclipse.jdt.core bundle should not find JDTCompilerAdapter class (!) so the ant started from Eclipse can find it inside jdtCompilerAdapter.jar contributed by ... org.eclipse.jdt.core bundle. Fixes eclipse-pde/eclipse.pde#419
See README.md why the JDTCompilerAdapter classloading is not trivial. TL;DR: OSGI classloader from org.eclipse.jdt.core bundle should not find JDTCompilerAdapter class (!) so the ant started from Eclipse can find it inside jdtCompilerAdapter.jar contributed by ... org.eclipse.jdt.core bundle. Fixes eclipse-pde/eclipse.pde#419
See README.md why the JDTCompilerAdapter classloading is not trivial. TL;DR: OSGI classloader from org.eclipse.jdt.core bundle should not find JDTCompilerAdapter class (!) so the ant started from Eclipse can find it inside jdtCompilerAdapter.jar contributed by ... org.eclipse.jdt.core bundle. Fixes eclipse-pde/eclipse.pde#419
Add moved classes located now in org.eclipse.jdt.core.compiler.batch to the jdtCompilerAdapter.jar used by pde.build & Ant (see org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator). See eclipse-pde/eclipse.pde#419 #181
Add moved classes located now in org.eclipse.jdt.core.compiler.batch to the jdtCompilerAdapter.jar used by pde.build & Ant (see org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator). See eclipse-pde/eclipse.pde#419 #181
See README.md why the JDTCompilerAdapter classloading is not trivial. TL;DR: OSGI classloader from org.eclipse.jdt.core bundle should not find JDTCompilerAdapter class (!) so the ant started from Eclipse can find it inside jdtCompilerAdapter.jar contributed by ... org.eclipse.jdt.core bundle. Fixes eclipse-pde/eclipse.pde#419
…t#181) Add moved classes located now in org.eclipse.jdt.core.compiler.batch to the jdtCompilerAdapter.jar used by pde.build & Ant (see org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator). See eclipse-pde/eclipse.pde#419 eclipse-jdt#181
…ipse-jdt#181) Add moved classes located now in org.eclipse.jdt.core.compiler.batch to the jdtCompilerAdapter.jar used by pde.build & Ant (see org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator). See eclipse-pde/eclipse.pde#419 eclipse-jdt#181
See README.md why the JDTCompilerAdapter classloading is not trivial. TL;DR: OSGI classloader from org.eclipse.jdt.core bundle should not find JDTCompilerAdapter class (!) so the ant started from Eclipse can find it inside jdtCompilerAdapter.jar contributed by ... org.eclipse.jdt.core bundle. Fixes eclipse-pde/eclipse.pde#419
…t#181) Add moved classes located now in org.eclipse.jdt.core.compiler.batch to the jdtCompilerAdapter.jar used by pde.build & Ant (see org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator). See eclipse-pde/eclipse.pde#419 eclipse-jdt#181
…ipse-jdt#181) Add moved classes located now in org.eclipse.jdt.core.compiler.batch to the jdtCompilerAdapter.jar used by pde.build & Ant (see org.eclipse.ant.internal.ui.datatransfer.BuildFileCreator). See eclipse-pde/eclipse.pde#419 eclipse-jdt#181
See README.md why the JDTCompilerAdapter classloading is not trivial. TL;DR: OSGI classloader from org.eclipse.jdt.core bundle should not find JDTCompilerAdapter class (!) so the ant started from Eclipse can find it inside jdtCompilerAdapter.jar contributed by ... org.eclipse.jdt.core bundle. Fixes eclipse-pde/eclipse.pde#419
See for example https://download.eclipse.org/eclipse/downloads/drops4/I20221201-1800/testresults/html/org.eclipse.pde.build.tests_ep427I-unit-cen64-gtk3-java11_linux.gtk.x86_64_11.html
org.eclipse.jdt.core.JDTCompilerAdapter
is now in separated bundle (after eclipse-jdt/eclipse.jdt.core#181), and some platform code somewhere used jdt.core bundle as ant dependency.Now the bundle is there, but outside of OSGI world it simply can't find batch compiler classes anymore, and ant rightly complains that the
Class org.eclipse.jdt.core.JDTCompilerAdapter could not be loaded because of an invalid dependency.
If I only knew where
org.eclipse.jdt.core
library was set to be in the classpath of ant!It should be now replaced through
org.eclipse.jdt.core.compiler.batch
and the problem will be solved.Stack:
Most important part of the stack
The text was updated successfully, but these errors were encountered: