Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Cannot launch junit plugin test in oxygen because of java 9 support
Cannot launch junit plugin test in oxygen because of java 9 support [message #1774382] Fri, 13 October 2017 14:13 Go to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
Hello,

With java 9 support it is not possible anymore to launch Junit Plugin Tests (Junit4 and openJDK 8)

exception above.

Everyone in my team has same issue, so we remove java 9 support from eclipse, but with oxygen SR1.a installation the issue comes back

Is there any way to workaround this ?

java.lang.AbstractMethodError: org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests([Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/String;Lorg/eclipse/jdt/internal/junit/runner/RemoteTestRunner;)[Lorg/eclipse/jdt/internal/junit/runner/ITestReference;
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:181)
at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethodWithException(EclipseAppContainer.java:587)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:198)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
at org.eclipse.equinox.launcher.Main.main(Main.java:1472)

[Updated on: Fri, 13 October 2017 14:22]

Report message to a moderator

Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774386 is a reply to message #1774382] Fri, 13 October 2017 14:42 Go to previous messageGo to next message
Noopur Gupta is currently offline Noopur GuptaFriend
Messages: 58
Registered: December 2012
Member
How are you installing Oxygen.1a? Can you try with a fresh build download and a new workspace? If so, please attach a simple test project which can reproduce the bug.
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774393 is a reply to message #1774386] Fri, 13 October 2017 15:38 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
Oomph updated my eclipse.

My target platform is a RAP oxygen target platform (3.2.0), so maybe this is the cause of this. I will try to upgrade the target platform to RAP Oxygen SR1a (3.3.0) and see if it fixes it

I can attach a sample project, but it is very easy to reproduce, try to launch any junit test as Junit Unit plugin test and it fails because of this.

[Updated on: Fri, 13 October 2017 15:38]

Report message to a moderator

Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774397 is a reply to message #1774393] Fri, 13 October 2017 16:12 Go to previous messageGo to next message
Noopur Gupta is currently offline Noopur GuptaFriend
Messages: 58
Registered: December 2012
Member
I am able to launch a JUnit 4 plug-in test with JDK 8 in a new Oxygen.1a installation.

Your stack trace indicates that you are running into this compatibility issue: see the second point in note at the end of "Eclipse support for JUnit 5" in the 4.7.1a news.

So you are running with an old build (build without JUnit 5 support) and have the following bundles from a new build with JUnit 5 support in your target platform:
org.eclipse.jdt.junit.runtime
org.eclipse.jdt.junit4.runtime
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774398 is a reply to message #1774397] Fri, 13 October 2017 16:53 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
I think it is the opposite, I am running a new build (Eclipse Oxygen SR1a) with Junit 5 support an my target have org.eclipse.jdt.junit.runtime
(and no org.eclipse.jdt.junit4.runtime) from an old build without JUnit 5 support (RAP Oxygen), but it probably leads to issues too.

So adding Junit5 support in Eclipse Oxygen SR1a probably broke RAP development
environment, and it is probably the reason why I had dependencies error when I
tried to upgrade my target platform to RAP Oxygen SR1 and Equinox Oxygen SR1a
(there is no RAP Oxygen SR1a but they probably should have delivered a version with Junit5 support as well)

[Updated on: Fri, 13 October 2017 17:06]

Report message to a moderator

Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774404 is a reply to message #1774398] Fri, 13 October 2017 17:09 Go to previous messageGo to next message
Noopur Gupta is currently offline Noopur GuptaFriend
Messages: 58
Registered: December 2012
Member
Just to add these observations from your stack trace:

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
refers to the #runTests method at line 444 which was the case in the old bundle.

java.lang.AbstractMethodError: org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests([Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/String;Lorg/eclipse/jdt/internal/junit/runner/RemoteTestRunner;)[Lorg/eclipse/jdt/internal/junit/runner/ITestReference;
refers to the old JUnit4TestLoader.loadTests(...) method which is not found now.
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774426 is a reply to message #1774404] Sat, 14 October 2017 06:46 Go to previous messageGo to next message
David Schowalter is currently offline David SchowalterFriend
Messages: 11
Registered: November 2014
Junior Member
I have the same problem with the oxygen.1a eclipse version:

Exception in thread "WorkbenchTestable" java.lang.AbstractMethodError: org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests([Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/String;Lorg/eclipse/jdt/internal/junit/runner/RemoteTestRunner;)[Lorg/eclipse/jdt/internal/junit/runner/ITestReference;
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
at org.eclipse.e4.ui.internal.workbench.swt.E4Testable$1.run(E4Testable.java:73)
at java.lang.Thread.run(Thread.java:748)
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774427 is a reply to message #1774426] Sat, 14 October 2017 07:37 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
It seems somehow SR1a broke the concept of "simultaneous release".
I have reported this issue to RAP forum as well, they probably need to do a SR1a with new org.eclipse.jdt.junit.runtime in their target platform.

[Updated on: Sat, 14 October 2017 17:19]

Report message to a moderator

Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774488 is a reply to message #1774427] Mon, 16 October 2017 09:20 Go to previous messageGo to next message
Noopur Gupta is currently offline Noopur GuptaFriend
Messages: 58
Registered: December 2012
Member
@Arnaud MERGEY, you can post the RAP forum link here as well for reference. If required, you can open a bug for them on Bugzilla.

Also, check if your Eclipse PDE plug-ins are up to date after the upgrade.

@David Schowalter, could you please check if you have a similar issue of misconfiguration as already discussed on this thread?
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774494 is a reply to message #1774382] Mon, 16 October 2017 12:38 Go to previous messageGo to next message
Michael Keppler is currently offline Michael KepplerFriend
Messages: 164
Registered: July 2009
Senior Member
Everyone using an Oomph setup and not actually needing the new Junit5 feature: We worked around this issue locally by fixing JDT to the Oxygen.1 version of September. Add this to your .setup file, clear the Oomph cache via Eclipse preferences, rerun the Oomph setup from the help menu and that's it.

<requirement
name="org.eclipse.jdt.feature.group"
versionRange="[3.13.1.v20170906-1700,3.13.1.v20170906-1700]"/>

Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774597 is a reply to message #1774494] Tue, 17 October 2017 16:13 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
I noticed osgi related launchers seems to be broken, not only Junit Plugin Test, osgi launchers fails with org.eclipse.jdt.launching.JavaRuntime.isModularJava(Lorg/eclipse/jdt/launching/IVMInstall
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774623 is a reply to message #1774597] Wed, 18 October 2017 05:17 Go to previous messageGo to next message
Noopur Gupta is currently offline Noopur GuptaFriend
Messages: 58
Registered: December 2012
Member
This might be a different issue. Could you please report it here with the stack trace so that developers can look into it? https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT&component=Debug.
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774645 is a reply to message #1774623] Wed, 18 October 2017 10:04 Go to previous messageGo to next message
Arnaud MERGEY is currently offline Arnaud MERGEYFriend
Messages: 243
Registered: March 2010
Location: France
Senior Member
Noopur Gupta wrote on Wed, 18 October 2017 07:17
This might be a different issue. Could you please report it here with the stack trace so that developers can look into it? https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JDT&component=Debug.


done https://bugs.eclipse.org/bugs/show_bug.cgi?id=526208
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774719 is a reply to message #1774645] Thu, 19 October 2017 05:45 Go to previous messageGo to next message
David Schowalter is currently offline David SchowalterFriend
Messages: 11
Registered: November 2014
Junior Member
I used a fresh version of eclipse oxygen.1a (JEE) and only installed the following plugins:
- Eclipse e4 Tools Developer Resources
- Websphere Application Server V8.0 Tools
- SWT Bot
- SonarLint

And I still get the error:
Exception in thread "WorkbenchTestable" java.lang.AbstractMethodError: org/eclipse/jdt/internal/junit/runner/ITestLoader.loadTests([Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/String;Lorg/eclipse/jdt/internal/junit/runner/RemoteTestRunner;)[Lorg/eclipse/jdt/internal/junit/runner/ITestReference;
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:444)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
	at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Testable$1.run(E4Testable.java:73)
	at java.lang.Thread.run(Thread.java:785)


when running an SWT Bot Test.

Furthermore, another error happens, when I want to start an ant run build:
Launch configuration *** build-wrapper.xml references non-existing project ***.

Please help out here for those two issues, because eclipse is not usable that way...

Can you provide a download link with oxygen.1 without the (a) feature?
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1774720 is a reply to message #1774645] Thu, 19 October 2017 05:45 Go to previous messageGo to next message
David Schowalter is currently offline David SchowalterFriend
Messages: 11
Registered: November 2014
Junior Member
Okay, found it by myself: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/oxygen/1/eclipse-jee-oxygen-1-win32-x86_64.zip&mirror_id=17

With this eclipse version, none of the above errors occur.

[Updated on: Thu, 19 October 2017 09:23]

Report message to a moderator

Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1775874 is a reply to message #1774720] Tue, 07 November 2017 13:22 Go to previous messageGo to next message
Mark Rösler is currently offline Mark RöslerFriend
Messages: 8
Registered: January 2013
Junior Member
Have the same Problem if I launch SWTBot Tests with the new IDE. I downloaded the IDE package
Eclipse for RCP and RAP Developers
Version: Oxygen.1a Release (4.7.1a)
Build id: 20171005-1200

Exception in thread "WorkbenchTestable" java.lang.AbstractMethodError: org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests([Ljava/lang/Class;Ljava/lang/String;[Ljava/lang/String;Lorg/eclipse/jdt/internal/junit/runner/RemoteTestRunner;)[Lorg/eclipse/jdt/internal/junit/runner/ITestReference;
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:452)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.swtbot.eclipse.core.RemotePluginTestRunner.main(RemotePluginTestRunner.java:64)
	at org.eclipse.swtbot.eclipse.core.UITestApplication.runTests(UITestApplication.java:117)
	at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
	at java.lang.Thread.run(Thread.java:748)
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1775925 is a reply to message #1775874] Wed, 08 November 2017 09:57 Go to previous messageGo to next message
Eclipse UserFriend
This happens normally when the folder in which test case is present is not a source folder, please check this post as well. Hope that helps.

[Updated on: Wed, 08 November 2017 10:00] by Moderator

Report message to a moderator

Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1775941 is a reply to message #1775925] Wed, 08 November 2017 13:39 Go to previous messageGo to next message
Mark Rösler is currently offline Mark RöslerFriend
Messages: 8
Registered: January 2013
Junior Member
Thanks Priya Arrora for your responds.
I tried to launch a SWTBot Test and a Junit Plugin Tests.
I tested with different Target Platforms and only with RCP 4.7.1 it worked and 4.6.3, 4.5.2, 4.4.2, 3.8.2, 3.7.2 it did not.
I think the test case is in a source folder because if not the test with the RCP 4.7.1 as Target Platform would have failed too.
Normal Junit tests worked with every Target Platform.

[Updated on: Thu, 09 November 2017 09:01]

Report message to a moderator

Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1776328 is a reply to message #1775941] Wed, 15 November 2017 11:46 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
I have exactly the same problem, and tests are in a source folder, so this must be some bug in Oxygen JUnit launch...

Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1776329 is a reply to message #1776328] Wed, 15 November 2017 11:59 Go to previous messageGo to next message
Noopur Gupta is currently offline Noopur GuptaFriend
Messages: 58
Registered: December 2012
Member
This has nothing to do with tests being in a source folder.

The issue may happen due to misconfiguration of the bundle versions. Please download a fresh installation of Eclipse Oxygen.1a. And make sure any installed plug-ins or target platforms (related to JDT or PDE bundles) are updated to support Oxygen.1a.
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1776336 is a reply to message #1776329] Wed, 15 November 2017 12:57 Go to previous messageGo to next message
Lorenzo Bettini is currently offline Lorenzo BettiniFriend
Messages: 1812
Registered: July 2009
Location: Firenze, Italy
Senior Member
I've installed Oxygen for Eclipse Committers, using Oomph, a few days ago, so it is up-to-date (and there's no pending updates)...

Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1777004 is a reply to message #1776336] Thu, 23 November 2017 14:34 Go to previous messageGo to next message
Mark Rösler is currently offline Mark RöslerFriend
Messages: 8
Registered: January 2013
Junior Member
I also downloaded a fresh IDE not with oomph but from the website https://www.eclipse.org/downloads/eclipse-packages/

I noticed that I can run JUnit Plugin Tests if no SWTBot is in my Target Platform and created a bug report https://bugs.eclipse.org/bugs/show_bug.cgi?id=527681
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1778943 is a reply to message #1777004] Mon, 25 December 2017 19:43 Go to previous messageGo to next message
Michael Keppler is currently offline Michael KepplerFriend
Messages: 164
Registered: July 2009
Senior Member
I meanwhile managed to find a workaround for our product: A target platform that contains only jdt.junit.runtime causes the above error. But after also adding jdt.junit4.runtime, the error is gone.

Can someone please check if that workaround is valid for him/her too?
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1790207 is a reply to message #1778943] Thu, 07 June 2018 05:36 Go to previous messageGo to next message
Plamena Marinova is currently offline Plamena MarinovaFriend
Messages: 2
Registered: June 2018
Junior Member
We had exactly the same issue and adding the org.eclipse.jdt.junit4.runtime plug-in to the target platform fixes it.

Apparently the issue was caused by a mixup of bundle versions - org.eclipse.jdt.junit.runtime was loaded from the target platform (Luna in our case) and org.eclipse.jdt.junit4.runtime was loaded from my Eclipse installation (Oxygen 3a).

Thanks to this question on Stack Overflow - JUnit Plug-in Test Ignores Target Platform in Eclipse Neon (sorry can't post links to external sites yet), I was pointed to the ${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit/org.eclipse.equinox.simpleconfigurator/bundles.info file where I could see all the bundles resolved by PDE. All of the plug-ins were coming from the target platform, except for org.eclipse.jdt.junit4.runtime.

See also bug 216946 where this behaviour of PDE is discussed.
Re: Cannot launch junit plugin test in oxygen because of java 9 support [message #1795381 is a reply to message #1790207] Fri, 21 September 2018 07:10 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

java.lang.AbstractMethodError strongly suggests you have a required class but that it is incompatible suggesting a bad installation.

Your text does not identify how you have evolved your installation, but does suggests evolution rather than a straight installation.

Java 9 is dead already, but Java 10 can have similar problems some of which are not fixed until Eclipse 2018-09.

I strongly recommend you attempt a clean installation and see whether the problem goes away.

Regards

Ed Willink

Previous Topic:[CMD] Eclipse adds project path to the cmd
Next Topic: Create fully-featured IJavaCompletionProposal from IMethod
Goto Forum:
  


Current Time: Sat Apr 27 05:40:07 GMT 2024

Powered by FUDForum. Page generated in 0.05452 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top