Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 365134

Summary: Classpath issues with IVY
Product: z_Archived Reporter: Cliff DeCarlo <cdecarlo>
Component: WindowBuilderAssignee: Konstantin Scheglov <Konstantin.Scheglov>
Status: CLOSED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3 CC: clayberg, nicolas.lalevee, schlm3
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Cliff DeCarlo CLA 2011-11-29 15:55:48 EST
Our eclipse project is setup to use an ivy managed library for classpath management.  We cannot seem to open any of our swing gui classes with the windowbuilder tool (Eclipse version 3.7.1 Ivy version 2.2.0 Windowbuilder version 1.1.0.r37).  All of our swing gui classes extend some class that we manage as part of another internal project and publish via ivy.  When trying to open any of our gui forms the windowbuilder cannot resolve the super class.  It throws the following stacktrace....the class ucs.ucms.client.swing.universal.taskmanager.DefaultTaskComponentDialog is defined through an ivy managed jar file.  The Eclipse java builders/launchers  have no problem resolving this class.

org.eclipse.wb.internal.core.utils.exception.DesignerException: 109 (Unable to load 'super' class). ucs.ucms.client.swing.universal.taskmanager.DefaultTaskComponentDialog
	at org.eclipse.wb.internal.core.parser.AbstractParseFactory.getSuperClass(AbstractParseFactory.java:387)
	at org.eclipse.wb.internal.swing.parser.ParseFactory.getRootContext(ParseFactory.java:120)
	at org.eclipse.wb.internal.core.parser.JavaInfoParser.prepareParseContext(JavaInfoParser.java:1185)
	at org.eclipse.wb.internal.core.parser.JavaInfoParser.parse(JavaInfoParser.java:244)
	at org.eclipse.wb.internal.core.parser.JavaInfoParser.access$9(JavaInfoParser.java:240)
	at org.eclipse.wb.internal.core.parser.JavaInfoParser$1.runObject(JavaInfoParser.java:153)
	at org.eclipse.wb.internal.core.parser.JavaInfoParser$1.runObject(JavaInfoParser.java:1)
	at org.eclipse.wb.internal.core.utils.execution.ExecutionUtils.runDesignTime(ExecutionUtils.java:153)
	at org.eclipse.wb.internal.core.parser.JavaInfoParser.parse(JavaInfoParser.java:151)
	at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF(DesignPage.java:513)
	at org.eclipse.wb.internal.core.editor.DesignPage.access$9(DesignPage.java:501)
	at org.eclipse.wb.internal.core.editor.DesignPage$8$1.run(DesignPage.java:434)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4330)
	at org.eclipse.wb.internal.core.editor.DesignPage$8.run(DesignPage.java:431)
	at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
	at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF_withProgress(DesignPage.java:450)
	at org.eclipse.wb.internal.core.editor.DesignPage.internal_refreshGEF(DesignPage.java:400)
	at org.eclipse.wb.internal.core.editor.UndoManager.refreshDesignerEditor(UndoManager.java:381)
	at org.eclipse.wb.internal.core.editor.UndoManager.activate(UndoManager.java:90)
	at org.eclipse.wb.internal.core.editor.DesignPage.handleActiveState_True(DesignPage.java:248)
	at org.eclipse.wb.internal.core.editor.DesignPage.handleActiveState(DesignPage.java:226)
	at org.eclipse.wb.internal.core.editor.multi.DefaultMultiMode.showPage(DefaultMultiMode.java:125)
	at org.eclipse.wb.internal.core.editor.multi.DefaultMultiMode$1.widgetSelected(DefaultMultiMode.java:63)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:240)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1282)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1267)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1061)
	at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:2745)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1432)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:257)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.lang.ClassNotFoundException: ucs.ucms.client.swing.universal.taskmanager.DefaultTaskComponentDialog
	at org.eclipse.wb.internal.core.utils.reflect.CompositeClassLoader.findClass(CompositeClassLoader.java:163)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	at org.eclipse.wb.internal.core.parser.AbstractParseFactory.getSuperClass(AbstractParseFactory.java:385)
	... 59 more
Comment 1 Konstantin Scheglov CLA 2011-12-02 14:38:20 EST
WindowBuilder basically uses JDT to ask classpath.
Does IVY provide this classpath correctly to JDT?

  public static String[] getClasspath(IJavaProject javaProject) throws Exception {
    List<String> locations = Lists.newArrayList();
    // prepare unresolved class path
    IRuntimeClasspathEntry[] unresolvedEntries =
        JavaRuntime.computeUnresolvedRuntimeClasspath(javaProject);
    // resolve each entry
    for (int unresolvedIndex = 0; unresolvedIndex < unresolvedEntries.length; unresolvedIndex++) {
      IRuntimeClasspathEntry enresolvedEntry = unresolvedEntries[unresolvedIndex];
      IRuntimeClasspathEntry[] resolvedEntries =
          JavaRuntime.resolveRuntimeClasspathEntry(enresolvedEntry, javaProject);
      for (int resolvedIndex = 0; resolvedIndex < resolvedEntries.length; resolvedIndex++) {
        IRuntimeClasspathEntry resolvedEntry = resolvedEntries[resolvedIndex];
        String location = resolvedEntry.getLocation();
        if (location != null) {
          location = location.replace('\\', '/');
          locations.add(location);
        }
      }
    }
    // convert into array
    return locations.toArray(new String[locations.size()]);
  }

  Do you run your application using _normal_ JDT launch configuration, or IVY specific one?

  WindowBuilder works with PDE classpath container without special tweaks (except of support for fragments).
  So, I think that if it does not work for IVY, then may be IVY missing something.
  
  I don't have time to learn IVY now.
  If you can provide small workspace, which I can just extract and use with Eclipse + extracted manually downloaded IVY, then I could check this.
  Full Eclipse + IVY + workspace would be even better, but it may be too big, so this may be problem for you to host it.
Comment 2 Markus Schlegel CLA 2013-08-23 02:43:39 EDT
This problem has been reported to ivyDE project, but was closed since they say that "WindowBuilder" is likey to do it wrong...
See https://issues.apache.org/jira/browse/IVYDE-337#comment-13748341
Comment 3 Nicolas Lalevée CLA 2013-08-26 12:51:05 EDT
It was a bug in IvyDE. I don't know which, the trunk is working but the last released version don't.