Community
Participate
Working Groups
Build Identifier: I20110526-1708 I've been trying to provide an implementation of IResourceLoader for maven projects (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=251323 and https://issues.sonatype.org/browse/MECLIPSEWTP-11) The fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=317900 however doesn't find my custom resource loader : !MESSAGE Unable to load the class 'org.maven.ide.eclipse.wtp.jpt.MavenResourceLocator' declared for the extension point 'org.eclipse.jpt.common.core.resourceLocators' in the plug-in 'org.eclipse.jpt.common.core'. !STACK 0 java.lang.ClassNotFoundException: org.maven.ide.eclipse.wtp.jpt.MavenResourceLocator at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:345) at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229) at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1207) at org.eclipse.jpt.common.core.internal.utility.XPointTools.loadClass(XPointTools.java:61) at org.eclipse.jpt.common.core.internal.utility.XPointTools.instantiate(XPointTools.java:37) at org.eclipse.jpt.common.core.internal.resource.ResourceLocatorConfig.getResourceLocator(ResourceLocatorConfig.java:81) Looking at public ResourceLocator getResourceLocator() { return XPointTools.instantiate( JptCommonCorePlugin.PLUGIN_ID, ResourceLocatorManager.QUALIFIED_EXTENSION_POINT_ID, this.className, ResourceLocator.class); } And in XPointTools : Bundle bundle = Platform.getBundle(pluginId); Class<?> clazz; try { clazz = bundle.loadClass(className); } catch (Exception ex) { logFailedClassLoad(ex, pluginId, extensionPoint, className); return null; } Seems to me the classes are only searched in the common plugin classloader. According to Max R. Andersen, the pluginId used for the look up should be more like : element.getDeclaringExtension().getContributor().getName() instead of JptCommonCorePlugin.PLUGIN_ID Actually, createExecutableExtension() should be used http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/runtime/IConfigurationElement.html Fixing this ASAP would - hopefully - allow me to provide a fix for #251323, by the time Indigo is released. Reproducible: Always
humm read ResourceLocator, not IResourceLoader
We would like to mark this as a hotbug since it prevents good Maven/Dali integration. Affiliation: Red Hat, project: JBoss Tools, product: JBoss Developer Studio Release to be fixed in: Indigo ASAP Justification: This is a hotbug since Dali have made the effort to implement custom resourcelookup for their artifacts but it is not possible to implement them unless you are on the classpath of the Dali plugins - i.e., its not possible for 3rd party plugins such as m2ewtp to implement it. This blocks adoption of Dali + Maven with Eclipse WTP since otherwise the user experience will suffer because of impedance mismatch of where resources are located/edited.
Created attachment 197901 [details] patch Can you verify that this fixes your problem?
(In reply to comment #3) > Created attachment 197901 [details] > patch > > Can you verify that this fixes your problem? I will try as soon as I can. I currently don't have the Dali source projects checked out. Need to find some instructions for setup first
(In reply to comment #4) > (In reply to comment #3) > > Created attachment 197901 [details] [details] > > patch > > > > Can you verify that this fixes your problem? > > I will try as soon as I can. I currently don't have the Dali source projects > checked out. Need to find some instructions for setup first This should help you get started - http://wiki.eclipse.org/Dali_Developer_Documentation
Any word? We're adding this patch to our post 3.0 code stream.
(In reply to comment #6) > Any word? We're adding this patch to our post 3.0 code stream. Sorry, but I've been swamped and couldn't give it a try. Will try next week.
patch committed post 3.0. Waiting for extender feedback.
X weeks later, I confirm this is fixed in trunk. It was able to call my class. Sorry for the late reply guys. Now I have to figure out how I'm supposed to implement that locator correctly, but that's another story :-)
Marking as fixed. Fred, feel free to visit and or post any questions at the Dali forum. It's pretty well monitored. http://www.eclipse.org/forums/index.php/f/113/