| Summary: | ClassNotFoundException running snippet in debugger | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Nick Edgar <n.a.edgar> |
| Component: | Debug | Assignee: | Darin Wright <darin.eclipse> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | normal | ||
| Priority: | P1 | CC: | John_Wiegand, philippe_mulet |
| Version: | 2.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 98 | ||
| Whiteboard: | |||
|
Description
Nick Edgar
I was able to get the same evaluation (snippet) to work, in the same context (and "lookup" became null in the variables view, as expected). Problem is not specific to the test case provided. Did you try it on Win98? I tried on Win2000. Will try on 98. Had a similar occurrence on Windows 2000, also with build 20011105. My stack looked like: Thread [main] (Suspended) Shell.setBounds(int, int, int, int, int) line: 668 Shell(Control).setLocation(int, int) line: 1930 VerifyDialog.openNewTestDialog() line: 253 VerifyDialog.open(Dialog) line: 241 DialogCheck.assertDialog(Dialog, Assert) line: 57 UIMessageDialogs.testRefreshDeleteProject() line: 318 Method.invoke(Object, Object[]) UIMessageDialogs(TestCase).runTest() line: 166 UIMessageDialogs(TestCase).runBare() line: 140 TestResult$1.protect() line: 106 TestResult.runProtected(Test, Protectable) line: 124 TestResult.run(TestCase) line: 109 UIMessageDialogs(TestCase).run(TestResult) line: 131 TestSuite.runTest(Test, TestResult) line: 173 TestSuite.run(TestResult) line: 168 TestRunner(TestRunner).runTests(String[]) line: 268 TestRunner(TestRunner).run() line: 176 TestRunner.main(String[]) line: 22 UITestApplication.runEventLoop() line: 31 UITestApplication(Workbench).run(Object) line: 710 InternalBootLoader.run(String, URL, String, String[]) line: 820 BootLoader.run(String, URL, String, String[]) line: 285 Method.invoke(Object, Object[]) UIMain(Main).basicRun(String[]) line: 151 UIMain(Main).run(String[]) line: 502 UIMain.main(String[]) line: 52 In the frame for UIMessageDialogs.testRefreshDeleteProject(), I tried to evaluate: dialog.getShell().getSize(). I got the following stack trace in the console: java.lang.ClassNotFoundException: org.eclipse.ui.tests.dialogs.CodeSnippet_1 at org.eclipse.core.internal.boot.DelegatingURLClassLoader.loadClass (DelegatingURLClassLoader.java:636) at java.lang.ClassLoader.loadClass(ClassLoader.java:257) at java.lang.Class.forName1(Native Method) at java.lang.Class.forName(Class.java:134) at org.eclipse.swt.widgets.Shell.setBounds(Shell.java:668) at org.eclipse.swt.widgets.Control.setLocation(Control.java:1930) at org.eclipse.jdt.junit.internal.util.VerifyDialog.openNewTestDialog (VerifyDialog.java:253) at org.eclipse.jdt.junit.internal.util.VerifyDialog.open (VerifyDialog.java:241) at org.eclipse.jdt.junit.util.DialogCheck.assertDialog (DialogCheck.java:57) at org.eclipse.ui.tests.dialogs.UIMessageDialogs.testRefreshDeleteProject (UIMessageDialogs.java:318) at java.lang.reflect.Method.invoke(Native Method) at junit.framework.TestCase.runTest(TestCase.java:166) at junit.framework.TestCase.runBare(TestCase.java:140) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:131) at junit.framework.TestSuite.runTest(TestSuite.java:173) at junit.framework.TestSuite.run(TestSuite.java:168) at org.eclipse.jdt.junit.internal.TestRunner.runTests (TestRunner.java:268) at org.eclipse.jdt.junit.internal.TestRunner.run(TestRunner.java:176) at org.eclipse.jdt.junit.eclipse.internal.TestRunner.main (TestRunner.java:22) at org.eclipse.jdt.junit.eclipse.internal.UITestApplication.runEventLoop (UITestApplication.java:31) at org.eclipse.ui.internal.Workbench.run(Workbench.java:710) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:820) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:285) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:151) at org.eclipse.core.launcher.Main.run(Main.java:502) at org.eclipse.core.launcher.UIMain.main(UIMain.java:52) I was able to reproduce this by doing an evaluation in a binary project, rather than a source project. When using the "Eclipse Launcher" defined by com.oti.eclipsetools, the data for a binary project does not have a project folder in the "plugins" directory. Instead the data resides in a separate location, and is referenced on the classpath as an external jar. Thus, the plugin classloader cannot see the deployed class file (the plugin class loader looks for classes in the jars on the classpath and the "bin" directory of each project - but a "binary project" does not have a "bin" directory). This will not work in the current implementation. Using an AST evaluation would solve the problem. Can't you dump the file in a reserved location you always put on the classpath when launching in debug mode ? In the metadata area somewhere, not needed to be per project, just something global. Putting a class file in a special place and adding it to the classpath does not work when a custom class loader is used. For example, the Eclipse class loader does not use the explicit classpath - it just looks in the "plugins" folders and "startup.jar". NTOE: This solution would work for many programs that use a system class loader. |