Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » Errors Creating Addons
Errors Creating Addons [message #1126248] Sat, 05 October 2013 06:20 Go to next message
Ghislain Mustermann is currently offline Ghislain Mustermann
Messages: 7
Registered: April 2013
Junior Member
Hello Everyone,

im building a E4 Application with e(fx)clipse. I tried to create a Addon for my Trimmed Window like this :

package de.demo.app.handlers;

import javax.annotation.PostConstruct;

import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow;

public class InitWindowAddon {

	@PostConstruct
	void init(MApplication application) {
		/*
		 * Preconditions.checkArgument(application != null,
		 * "Application dont exist!");
		 * 
		 * Preconditions.checkArgument(!application.getChildren().isEmpty(),
		 * "Application has no Children!");
		 */

		if (application.getChildren().get(0) instanceof MTrimmedWindow) {

			MTrimmedWindow window = (MTrimmedWindow) application.getChildren()
					.get(0);

			window.setLabel("Es ist perfekt!!!");
		}
	}
}


I also tried to used Guava Librairies without success. But after a while when i run my product i see those Errors :


Quote:
!ENTRY org.eclipse.emf.ecore 2 0 2013-10-05 11:56:12.455
!MESSAGE Both 'org.eclipse.e4.tools.css.editor.ui' and 'org.eclipse.fx.ide.css.ui' register an extension parser for 'css'
Invalid type stored in transient data with the key binding
Invalid type stored in transient data with the key binding


Quote:
!ENTRY org.eclipse.equinox.event 4 0 2013-10-05 11:56:13.216
!MESSAGE Exception while dispatching event org.osgi.service.event.Event [topic=org/eclipse/e4/ui/model/ui/UIElement/widget/SET] to handler org.eclipse.e4.ui.services.internal.events.UIEventHandler@6d9ef75f
!STACK 0
java.lang.ClassCastException: org.eclipse.fx.ui.workbench.renderers.fx.DefWindowRenderer$WWindowImpl cannot be cast to org.eclipse.swt.widgets.Widget


I has already such Errors in the past, and i removed from my run configurations all SWT Plugins. But this Errors suddenly come again.

Why and How can i solve this?
Re: Errors Creating Addons [message #1127070 is a reply to message #1126248] Sun, 06 October 2013 04:10 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 4651
Registered: July 2009
Senior Member
On 05.10.13 14:22, Ghislain Mustermann wrote:
> Hello Everyone,
>
> im building a E4 Application with e(fx)clipse. I tried to create a Addon
> for my Trimmed Window like this :
>
>
> package de.demo.app.handlers;
>
> import javax.annotation.PostConstruct;
>
> import org.eclipse.e4.ui.model.application.MApplication;
> import org.eclipse.e4.ui.model.application.ui.basic.MTrimmedWindow;
>
> public class InitWindowAddon {
>
> @PostConstruct
> void init(MApplication application) {
> /*
> * Preconditions.checkArgument(application != null,
> * "Application dont exist!");
> * *
> Preconditions.checkArgument(!application.getChildren().isEmpty(),
> * "Application has no Children!");
> */
>
> if (application.getChildren().get(0) instanceof MTrimmedWindow) {
>
> MTrimmedWindow window = (MTrimmedWindow)
> application.getChildren()
> .get(0);
>
> window.setLabel("Es ist perfekt!!!");
> }
> }
> }
> I also tried to used Guava Librairies without success. But after a while
> when i run my product i see those Errors :
>
>
> Quote:
>> !ENTRY org.eclipse.emf.ecore 2 0 2013-10-05 11:56:12.455
>> !MESSAGE Both 'org.eclipse.e4.tools.css.editor.ui' and
>> 'org.eclipse.fx.ide.css.ui' register an extension parser for 'css'
>> Invalid type stored in transient data with the key binding
>> Invalid type stored in transient data with the key binding
>

So where do you see this message, when you launch your app? This makes
no sense at all. You noted the term "ide" in the package name? To me it
looks like you are not launching the e4 app but an inner IDE.

>
> Quote:
>> !ENTRY org.eclipse.equinox.event 4 0 2013-10-05 11:56:13.216
>> !MESSAGE Exception while dispatching event
>> org.osgi.service.event.Event
>> [topic=org/eclipse/e4/ui/model/ui/UIElement/widget/SET] to handler
>> org.eclipse.e4.ui.services.internal.events.UIEventHandler@6d9ef75f
>> !STACK 0
>> java.lang.ClassCastException:
>> org.eclipse.fx.ui.workbench.renderers.fx.DefWindowRenderer$WWindowImpl
>> cannot be cast to org.eclipse.swt.widgets.Widget
>

So are you writing an SWT e4 app which embeds JavaFX or a pure e4 JavaFX
application? If it is the latter please make sure that you've set an
appropriate target platform (this would make your first problem
disappear as well).

In case you want to embed JavaFX into e4 you need to make sure that the
rendering engine of SWT is used.

Tom
Re: Errors Creating Addons [message #1127155 is a reply to message #1127070] Sun, 06 October 2013 06:23 Go to previous messageGo to next message
Ghislain Mustermann is currently offline Ghislain Mustermann
Messages: 7
Registered: April 2013
Junior Member
Hallo Tom,

i just want to use a pure e4 JavaFX. I follow your tipps and tried to set a new Target Platform for my Project like this : wiki.eclipse.org/Efxclipse/Tutorials/Tutorial4.
Im using Eclipse Kepler and after set the Target Platform i see an Error saying that Quote:
You have selected a target with a newer version than your current Eclipse Installation. This can cause unexpected behaviour in PDE. Please use a newer version of eclipse.


And when im running the product.launch : Quote:
"org.eclipse.fx.ui.workbench.fx" was unable to instantiate class "org.eclipse.fx.ui.workbench.fx.E4Application".


By the way my Project is build like i already wrote on Google Groups : groups.google.com/forum/#!topic/efxclipse/olNlqcbkhe8.

Thanks

[Updated on: Sun, 06 October 2013 07:07]

Report message to a moderator

Re: Errors Creating Addons [message #1127190 is a reply to message #1127155] Sun, 06 October 2013 07:18 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas Schindl
Messages: 4651
Registered: July 2009
Senior Member
On 06.10.13 12:23, Ghislain Mustermann wrote:
> Hallo Tom,
>
> i just want to use a pure e4 JavaFX. I follow your tipps and tried to
> set a new Target Platform for my Project like this :
> wiki.eclipse.org/Efxclipse/Tutorials/Tutorial4. Im using Eclipse Kepler
> and after set the Target Platform i see an Error saying that Quote:
>> You have selected a target with a newer version than your current
>> Eclipse Installation. This can cause unexpected behaviour in PDE.
>> Please use a newer version of eclipse.

That's not a problem!

>
>
> And when im running the product.launch : Quote:
>> "org.eclipse.fx.ui.workbench.fx" was unable to instantiate class
>> "org.eclipse.fx.ui.workbench.fx.E4Application".

Not sure what's wrong with your launch config. Does the project itself
compile?

Tom
Re: Errors Creating Addons [message #1127215 is a reply to message #1127190] Sun, 06 October 2013 07:51 Go to previous messageGo to next message
Ghislain Mustermann is currently offline Ghislain Mustermann
Messages: 7
Registered: April 2013
Junior Member
Hi Tom,

Yes the Project itself compile (mvn clean install). But when i run it (right click -> run as.. ), it dont show my application anymore and show this error message. Thats happend since i touched the Target Platform in Eclipse Preferences.

Here the Whole Error :

Quote:
!ENTRY org.eclipse.equinox.app 4 0 2013-10-06 14:20:51.421
!MESSAGE Plug-in "org.eclipse.fx.ui.workbench.fx" was unable to instantiate class "org.eclipse.fx.ui.workbench.fx.E4Application".
!STACK 0
org.eclipse.core.runtime.CoreException: Plug-in "org.eclipse.fx.ui.workbench.fx" was unable to instantiate class "org.eclipse.fx.ui.workbench.fx.E4Application".
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:186)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:191)
at org.eclipse.equinox.internal.app.AnyThreadAppLauncher.run(AnyThreadAppLauncher.java:26)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.NullPointerException: A null service reference is not allowed.
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.getService(BundleContextImpl.java:586)
at org.eclipse.fx.osgi.util.LoggerCreator.createLogger(LoggerCreator.java:37)
at org.eclipse.fx.ui.workbench.fx.E4Application.<init>(E4Application.java:94)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.Class.newInstance(Class.java:374)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184)
... 6 more



Thanks

[Updated on: Sun, 06 October 2013 08:22]

Report message to a moderator

Re: Errors Creating Addons [message #1127254 is a reply to message #1127215] Sun, 06 October 2013 08:54 Go to previous messageGo to next message
Ghislain Mustermann is currently offline Ghislain Mustermann
Messages: 7
Registered: April 2013
Junior Member
Well! My Bad!

I forgot after changing the Platform to go into my product :

1. Into my Product Overview -> Product Definition Tab -> set Product and set Application

After that i opened the Run Configuration -> Plugins -> press Add required Plugins.

Now my Application run without any Errors. I hope i have now the right settings.

Thanks to Tom.
Re: Errors Creating Addons [message #1127275 is a reply to message #1127254] Sun, 06 October 2013 09:25 Go to previous messageGo to next message
Ghislain Mustermann is currently offline Ghislain Mustermann
Messages: 7
Registered: April 2013
Junior Member
To Close my Post. I see into the Plugins Librairies that efxclipse use Guava is that the same version than this one : code.google.com/p/guava-libraries/wiki/Release15 ??

Thanks
Re: Errors Creating Addons [message #1127320 is a reply to message #1127275] Sun, 06 October 2013 10:28 Go to previous message
Thomas Schindl is currently offline Thomas Schindl
Messages: 4651
Registered: July 2009
Senior Member
No ours is 10.0.1.v201203051515

Tom

On 06.10.13 15:25, Ghislain Mustermann wrote:
> To Close my Post. I see into the Plugins Librairies that efxclipse use
> Guava is that the same version than this one :
> code.google.com/p/guava-libraries/wiki/Release15 ??
>
> Thanks
Previous Topic:How to build Test Project
Next Topic:Building OSGi-JavaFX program into jars
Goto Forum:
  


Current Time: Mon Oct 07 15:08:09 EDT 2013

Powered by FUDForum. Page generated in 0.02181 seconds