Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » RCP Testing Tool » java.lang.NoClassDefFoundError: org/eclipse/ui/internal/Workbench
java.lang.NoClassDefFoundError: org/eclipse/ui/internal/Workbench [message #1832924] Tue, 29 September 2020 14:22 Go to next message
sadasd adasda is currently offline sadasd adasdaFriend
Messages: 4
Registered: September 2020
Junior Member
I migrated my Eclipse from 3.7 to 4.8 in order to support Java 8. I'm using RCP and PDE. Running my JUnit tests I suddenly get the following error:
```
java.lang.NoClassDefFoundError: org/eclipse/ui/internal/Workbench
at org.eclipse.ui.PlatformUI.isWorkbenchRunning(PlatformUI.java:114)
at com.gandu.console.ConsoleDisplayMgr.hasGUI(ConsoleDisplayMgr.java:108)
at com.gandu.commons.FileOps.deleteFileInBackgroundWhenPossible(FileOps.java:88)
at com.gandu.scm.file.StandardFileIO.deleteDir(StandardFileIO.java:67)
at com.gandu.scm.file.StandardFileIOTest.testDeleteDir(StandardFileIOTest.java:143)
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 junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:121)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)
```

The code:
```
public void testDeleteDir() {
final File file = new File(rootPath, "file");
file.mkdir();
assertTrue(file.exists());

final IFileIO fileIO = new StandardFileIO();
fileIO.deleteDir(file.getPath());
assertFalse(file.exists());
}
```
When I click on the test that failed in the eclipse, it points me to the line `fileIO.deleteDir(file.getPath());`

The `isWorkbenchRunning` method is:
```
public static boolean isWorkbenchRunning() {
return Workbench.getInstance() != null && Workbench.getInstance().isRunning();
}
```
Why is it fails on this line and how to resolve it? How to debug it best?

The files in my eclipse plugin directory:
```
> tree -af eclipse | grep org.eclipse.ui.workbench
eclipse/plugins/org.eclipse.ui.workbench.source_3.111.0.v20180524-1156.jar
eclipse/plugins/org.eclipse.ui.workbench.texteditor.source_3.11.0.v20180419-2011.jar
eclipse/plugins/org.eclipse.ui.workbench.texteditor_3.11.0.v20180419-2011.jar
eclipse/plugins/org.eclipse.ui.workbench_3.111.0.v20180524-1156.jar
```

Also, note that I also asked this question on StackOverflow but didn't get an answer yet (Can't attach the URL due to me being a new user).
Re: java.lang.NoClassDefFoundError: org/eclipse/ui/internal/Workbench [message #1832934 is a reply to message #1832924] Tue, 29 September 2020 16:17 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4418
Registered: July 2009
Senior Member

Are you running them as JUnit tests, or JUnit Plug-in Tests?

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: java.lang.NoClassDefFoundError: org/eclipse/ui/internal/Workbench [message #1832977 is a reply to message #1832934] Wed, 30 September 2020 09:15 Go to previous message
sadasd adasda is currently offline sadasd adasdaFriend
Messages: 4
Registered: September 2020
Junior Member
Thanks for the reply. I running them as JUnit tests. If you need any other information, please let me know. I stuck on this issue for quite a while now.

[Updated on: Wed, 30 September 2020 09:16]

Report message to a moderator

Previous Topic:RCPTT and Sirius Diagrams
Next Topic:Problem with creating custom ecl command
Goto Forum:
  


Current Time: Sun Feb 25 16:34:49 GMT 2024

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

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

Back to the top