Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 307076 - JUnit Plug-in test runner exception "No Classloader found for plug-in ..." is confusing
Summary: JUnit Plug-in test runner exception "No Classloader found for plug-in ..." is...
Status: VERIFIED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: All All
: P3 minor (vote)
Target Milestone: 3.6 M7   Edit
Assignee: Darin Wright CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 286049 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-03-25 11:00 EDT by Ralf Ebert CLA
Modified: 2011-01-30 17:04 EST (History)
4 users (show)

See Also:


Attachments
patch to clarify error message (1.29 KB, patch)
2010-03-28 12:55 EDT, Ralf Ebert CLA
darin.eclipse: iplog+
Details | Diff
mylyn/context/zip (766 bytes, application/octet-stream)
2010-03-28 12:55 EDT, Ralf Ebert CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Ebert CLA 2010-03-25 11:00:30 EDT
Build Identifier: 3.5.2, 20100218-1602

Try to run a JUnit Plug-in test from a bundle that has unresolved dependencies (happens quite often by mistake). The error message in this case is "No Classloader found for plug-in ...". I have seen this causing confusion for beginners who might not know what a classloader is. It should be something like "Bundle ... has unresolved dependencies".

Exception in thread "WorkbenchTestable" java.lang.IllegalArgumentException: No Classloader found for plug-in org.rcpmail.test
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.getClassLoader(RemotePluginTestRunner.java:77)
	at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.getTestClassLoader(RemotePluginTestRunner.java:71)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClass(RemoteTestRunner.java:693)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.loadClasses(RemoteTestRunner.java:429)
	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.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:62)
	at org.eclipse.pde.internal.junit.runtime.NonUIThreadTestApplication.runTests(NonUIThreadTestApplication.java:23)
	at org.eclipse.ui.internal.testing.WorkbenchTestable$1.run(WorkbenchTestable.java:71)
	at java.lang.Thread.run(Thread.java:637)


Reproducible: Always
Comment 1 Ralf Ebert CLA 2010-03-28 12:55:12 EDT
Created attachment 163183 [details]
patch to clarify error message
Comment 2 Ralf Ebert CLA 2010-03-28 12:55:17 EDT
Created attachment 163184 [details]
mylyn/context/zip
Comment 3 Darin Wright CLA 2010-04-08 16:48:05 EDT
Comment on attachment 163183 [details]
patch to clarify error message

Applied. Modified the message slightly.
Comment 4 Darin Wright CLA 2010-04-08 16:48:32 EDT
Fixed.
Comment 5 Darin Wright CLA 2010-04-08 16:49:08 EDT
Verified.
Comment 6 Ralf Ebert CLA 2010-04-08 17:33:05 EDT
Hmm, imho "bundle not found (not resolved)" is misleading now. When i read "not resolved", I think of the OSGi state "RESOLVED". But it can also happen that the bundle is just not there. That's why I wrote "might be not resolved". I think maybe we should leave that part out altogether and just say:

Bundle "bundleId" not found. This is often caused by missing dependencies.

Actually, I wanted to ask the PackageAdmin if the bundle is not there or not resolved, but doing this would duplicate almost the complete 'Platform.getBundle' code, so i settled for the 'might be not resolved' message.
Comment 7 Darin Wright CLA 2010-04-09 10:02:58 EDT
Fine. Adjusted message.
Comment 8 Markus Keller CLA 2010-04-09 10:02:59 EDT
*** Bug 286049 has been marked as a duplicate of this bug. ***
Comment 9 Markus Keller CLA 2010-04-09 10:16:00 EDT
In bug 296113 and bug 286049, the problems are due other reasons. How about:

Possible causes include missing dependencies, too restrictive version ranges, or a non-matching required execution environment.
Comment 10 Darin Wright CLA 2010-04-09 10:30:06 EDT
I'll let you two agree on a message before I change it again :-)

+1 from all those that agree with Markus' message?
Comment 11 Ralf Ebert CLA 2010-04-09 10:33:05 EDT
+1 :)
Comment 12 Darin Wright CLA 2010-04-09 10:49:22 EDT
Done.