Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » Unhandled event loop exception - interface is not visible from class loader(PDE Equinox classloader error)
Unhandled event loop exception - interface is not visible from class loader [message #1765327] Thu, 08 June 2017 13:11 Go to next message
Alex Burdusel is currently offline Alex BurduselFriend
Messages: 3
Registered: November 2016
Junior Member
I am trying to build an XText plugin for Eclipse and as part of the DSL I would like to run the MOEAFramework.

I have converted the moeaframework dependency to an Eclipse plugin using p2-maven-plugin. The application compiles fine and I can run it, however there is one constructor in the moeaframework library that throws this exception:

!ENTRY org.eclipse.ui 4 0 2017-06-08 13:12:59.871
!MESSAGE Unhandled event loop exception
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.IllegalArgumentException: interface org.moeaframework.util.progress.ProgressListener is not visible from class loader
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:65)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:282)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:264)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:488)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:433)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:454)
	at org.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem$3.handleEvent(AbstractContributionItem.java:482)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5219)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1340)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4553)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4143)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:1121)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1022)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:150)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:687)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:604)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	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 org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1492)
Caused by: java.lang.IllegalArgumentException: interface org.moeaframework.util.progress.ProgressListener is not visible from class loader
	at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:581)
	at java.lang.reflect.Proxy$ProxyClassFactory.apply(Proxy.java:557)
	at java.lang.reflect.WeakCache$Factory.get(WeakCache.java:230)
	at java.lang.reflect.WeakCache.get(WeakCache.java:127)
	at java.lang.reflect.Proxy.getProxyClass0(Proxy.java:419)
	at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:719)
	at org.apache.commons.lang3.event.EventListenerSupport.createProxy(EventListenerSupport.java:277)
	at org.apache.commons.lang3.event.EventListenerSupport.initializeTransientFields(EventListenerSupport.java:268)
	at org.apache.commons.lang3.event.EventListenerSupport.<init>(EventListenerSupport.java:144)
	at org.apache.commons.lang3.event.EventListenerSupport.<init>(EventListenerSupport.java:122)
	at org.apache.commons.lang3.event.EventListenerSupport.create(EventListenerSupport.java:106)
	at org.moeaframework.util.progress.ProgressHelper.<init>(ProgressHelper.java:109)
	at org.moeaframework.Executor.<init>(Executor.java:165)


This is the constructor code where the class throwing the exception is initialized:


	/**
	 * Constructs a new executor initialized with default settings.
	 */
	public Executor() {
		super();
		
		isCanceled = new AtomicBoolean();
		progress = new ProgressHelper(this);
		properties = new TypedProperties();
		numberOfThreads = 1;
		terminationConditions = new ArrayList<TerminationCondition>();
	}


This is the constructor of the class throwing the error:

	public ProgressHelper(Executor executor) {
		super();
		this.executor = executor;
		
		statistics = new DescriptiveStatistics(25);
		listeners = EventListenerSupport.create(ProgressListener.class);
	}


Looking at this code, to me it would seem that the Equinox cannot see the ProgressListener.class file. But it is definitely included in the loaded moea plugin and the containing package is also exported in the plugin's manifest file.

I have tried to import the moeaframework as a bundle(Require-Bundle) in the MANIFEST.MF, I have also tried to use Import-Package, however that does not fix it.

Reading about similar errors on the web, it would seem that this happens when there is a conflict between the same jar being loaded multiple times, however that is not the case here.
Re: Unhandled event loop exception - interface is not visible from class loader [message #1771406 is a reply to message #1765327] Thu, 24 August 2017 18:21 Go to previous message
Alex Burdusel is currently offline Alex BurduselFriend
Messages: 3
Registered: November 2016
Junior Member
I have resolved this by adding the libraries to the project .classpath and to the manifest file using Bundle-ClassPath.

Then I have deleted the entries for the moeaframework lib from the Require-Bundle section of the manifest.

This approach also works with tycho builds.

This has resolved the problem.

[Updated on: Thu, 24 August 2017 23:06]

Report message to a moderator

Previous Topic:Unable to see plugin in fresh Eclipse instance
Next Topic:Servet bridge: tomcat severe logs about possible memory leak
Goto Forum:
  


Current Time: Sat May 04 13:23:36 GMT 2024

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

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

Back to the top