Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » e(fx)clipse » How to correctly deploy an e4 application that uses e(fx)clipse?
How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385218] Thu, 05 June 2014 04:11 Go to next message
Fernando Paz is currently offline Fernando PazFriend
Messages: 22
Registered: May 2014
Junior Member
In a normal (SWT) e4 application I can export my product to a directory containing a native executable file that runs my application.

I'm developing an e4 application using e(fx)clipse and I'm following the same steps in order to have a runnable executable file. However, when I run the .exe file, I got the following error in a popup:

The Eclipse executable launcher was unable to locate its companion shared library.


After a quick search on the web, I notice that this happens because the project is not exporting native shared libraries like the "org.eclipse.equinox.launcher.win32.win32.*" for Windows. I tried to add this as a plugin (or fragment?) in my e(fx)clipse product/feature but it's not being listed in the available plugins.

I created an empty e4 project and if I search for the same plugin, it's there. So this might have something to do with the Target Platform (which is different for the e(fx)clipse - see e(fx)clipse tutorial [1]).

I also created an empty e(fx)clipse e4 project and exported the product. I get the same error when I run the executable. I had the idea to copy the folder "org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140116-2212" that the normal e4 application generated and for my surprise it worked in the empty e(fx)clipse application.

However, my "src/main/resources" folder is embedded in the jar file. I don't want this because there are configuration files there.

This is kinda confusing. So what's a good approach to deploy an e4 application using the e(fx)clipse platform?

Thanks in advance.

[1]: https://wiki.eclipse.org/Efxclipse/Tutorials/Tutorial4
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385265 is a reply to message #1385218] Thu, 05 June 2014 09:37 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
The idea is that you use javafx-packager to do the deployment.

The problem with the eclipse.exe and native launcher are that they don't
work on Mac OS-X - long story short:

If you look at the generated project infrastructure you'll notice in the
releng project an build.xml which launches the JavaFX-Packageing
infrastructure who creates a native launcher and an msi/setup.exe
installer - you need to have the needed javafx setup generation
toolchain installed!

Tom

On 05.06.14 06:11, Fernando Paz wrote:
> In a normal (SWT) e4 application I can export my product to a directory
> containing a native executable file that runs my application.
>
> I'm developing an e4 application using e(fx)clipse and I'm following the
> same steps in order to have a runnable executable file. However, when I
> run the .exe file, I got the following error in a popup:
>
> The Eclipse executable launcher was unable to locate its companion
> shared library.
>
>
> After a quick search on the web, I notice that this happens because the
> project is not exporting native shared libraries like the
> "org.eclipse.equinox.launcher.win32.win32.*" for Windows. I tried to add
> this as a plugin (or fragment?) in my e(fx)clipse product/feature but
> it's not being listed in the available plugins.
>
> I created an empty e4 project and if I search for the same plugin, it's
> there. So this might have something to do with the Target Platform
> (which is different for the e(fx)clipse - see e(fx)clipse tutorial [1]).
>
> I also created an empty e(fx)clipse e4 project and exported the product.
> I get the same error when I run the executable. I had the idea to copy
> the folder
> "org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.200.v20140116-2212"
> that the normal e4 application generated and for my surprise it worked
> in the empty e(fx)clipse application.
>
> However, my "src/main/resources" folder is embedded in the jar file. I
> don't want this because there are configuration files there.
>
> This is kinda confusing. So what's a good approach to deploy an e4
> application using the e(fx)clipse platform?
>
> Thanks in advance.
>
> [1]: https://wiki.eclipse.org/Efxclipse/Tutorials/Tutorial4
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385512 is a reply to message #1385265] Sun, 08 June 2014 07:27 Go to previous messageGo to next message
Fernando Paz is currently offline Fernando PazFriend
Messages: 22
Registered: May 2014
Junior Member
By "javafx setup generation toolchain" you mean the javafxpackager tool?
I get this error when I try to run the ant task:

Buildfile: E:\dev\eclipse-workspaces\test.efxclipse\test.efxclipse.app.releng\build.xml
init-fx-tasks:
  [taskdef] Could not load definitions from resource com/sun/javafx/tools/ant/antlib.xml. It could not be found.
do-deploy:
[fxosgilauncher] E:\dev\eclipse-workspaces\test.efxclipse\test.efxclipse.app.product\target\products\test.efxclipse.app.product\noenv\noenv\noenv does not exist.
[fxosgilauncher] 	at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483)
[fxosgilauncher] 	at org.apache.tools.ant.types.FileSet.iterator(FileSet.java:69)
[fxosgilauncher] 	at org.eclipse.fx.ide.ant.FXOsgiLaunchTask.execute(FXOsgiLaunchTask.java:66)
[fxosgilauncher] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[fxosgilauncher] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[fxosgilauncher] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[fxosgilauncher] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[fxosgilauncher] 	at java.lang.reflect.Method.invoke(Unknown Source)
[fxosgilauncher] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[fxosgilauncher] 	at org.apache.tools.ant.Task.perform(Task.java:348)
[fxosgilauncher] 	at org.apache.tools.ant.Target.execute(Target.java:392)
[fxosgilauncher] 	at org.apache.tools.ant.Target.performTasks(Target.java:413)
[fxosgilauncher] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[fxosgilauncher] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[fxosgilauncher] 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[fxosgilauncher] 	at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[fxosgilauncher] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[fxosgilauncher] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
[fxosgilauncher] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)

BUILD FAILED
E:\dev\eclipse-workspaces\test.efxclipse\test.efxclipse.app.releng\build.xml:23: Problem: failed to create task or type javafx:com.sun.javafx.tools.ant:resources
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet


Total time: 381 milliseconds


In Run > External Tools > External Tools configuration > JRE tab, I changed my Execution environment to a JDK8, as suggested here [1]. However, the ant script is still not being able to create the folder "E:\dev\eclipse-workspaces\test.efxclipse\test.efxclipse.app.product\target\products\test.efxclipse.app.product\noenv\noenv\noenv". I created the folder manually and now I'm getting this error:

Buildfile: E:\dev\eclipse-workspaces\test.efxclipse\test.efxclipse.app.releng\build.xml
init-fx-tasks:
do-deploy:
[fxosgilauncher] java.util.NoSuchElementException
[fxosgilauncher] 	at org.apache.tools.ant.types.resources.FileResourceIterator.nextResource(FileResourceIterator.java:141)
[fxosgilauncher] 	at org.apache.tools.ant.types.resources.FileResourceIterator.next(FileResourceIterator.java:125)
[fxosgilauncher] 	at org.eclipse.fx.ide.ant.FXOsgiLaunchTask.execute(FXOsgiLaunchTask.java:66)
[fxosgilauncher] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[fxosgilauncher] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[fxosgilauncher] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[fxosgilauncher] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[fxosgilauncher] 	at java.lang.reflect.Method.invoke(Method.java:483)
[fxosgilauncher] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[fxosgilauncher] 	at org.apache.tools.ant.Task.perform(Task.java:348)
[fxosgilauncher] 	at org.apache.tools.ant.Target.execute(Target.java:392)
[fxosgilauncher] 	at org.apache.tools.ant.Target.performTasks(Target.java:413)
[fxosgilauncher] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[fxosgilauncher] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[fxosgilauncher] 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[fxosgilauncher] 	at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
[fxosgilauncher] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[fxosgilauncher] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
[fxosgilauncher] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
Using base JDK at: C:\Program Files\Java\jdk1.8.0\jre
  Skip [Windows Application Bundler] due to [Main application jar is missing.]
  Skip [MSI Bundler (WiX based)] due to [Main application jar is missing.]
  Skip [Exe Bundler (based on Inno Setup)] due to [Main application jar is missing.]
BUILD SUCCESSFUL
Total time: 587 milliseconds


The exception points to the following line in build.xml:
<fxosgilauncher classpathref="fxant" equinoxlauncherjarref="equinox-launcher"/>


It seems that the script is not finding the equinox-launcher. And why is it asking for the "Main application jar"?

I tried to run with Maven too (mvn clean verify) but then I get this error:
[ERROR] Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'efxclipse-addons' from location http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/runtime/nightly/site/: No repository found at http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/runtime/nightly/site. -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Failed to load p2 repository with ID 'efxclipse-addons' from location http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/runtime/nightly/site/
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:167)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
        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:483)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.RuntimeException: Failed to load p2 repository with ID 'efxclipse-addons' from location http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/runtime/nightly/site/
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:300)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.gatherExternalInstallableUnits(TargetPlatformFactoryImpl.java:268)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:166)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:119)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.createTargetPlatform(TargetPlatformFactoryImpl.java:1)
        at org.eclipse.tycho.p2.resolver.P2TargetPlatformResolver.computeTargetPlatform(P2TargetPlatformResolver.java:215)
        at org.eclipse.tycho.core.resolver.DefaultTychoDependencyResolver.resolveProject(DefaultTychoDependencyResolver.java:100)
        at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead(TychoMavenLifecycleParticipant.java:75)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:317)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
        ... 11 more
Caused by: org.eclipse.equinox.p2.core.ProvisionException: No repository found at http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/runtime/nightly/site.
        at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.fail(AbstractRepositoryManager.java:395)
        at org.eclipse.equinox.internal.p2.repository.helpers.AbstractRepositoryManager.loadRepository(AbstractRepositoryManager.java:692)
        at org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager.loadRepository(MetadataRepositoryManager.java:96)
        at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:59)
        at org.eclipse.tycho.p2.remote.RemoteMetadataRepositoryManager.loadRepository(RemoteMetadataRepositoryManager.java:52)
        at org.eclipse.tycho.p2.target.TargetPlatformFactoryImpl.loadMetadataRepository(TargetPlatformFactoryImpl.java:296)
        ... 20 more


It's the first time I'm using this so I am a bit lost. Any help is appreciated.

[1]: https://groups.google.com/forum/#!topic/efxclipse/x3vHUfgTka0

[Updated on: Sun, 08 June 2014 10:31]

Report message to a moderator

Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385566 is a reply to message #1385512] Mon, 09 June 2014 13:52 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
You will get an exe/.... from the packaging tool and it will start your
e4 application as you are used to when using the Eclipse-Launcher.

Please read about the tool / give it a try and then come back with
questions/problems.

Tom

On 08.06.14 09:27, Fernando Paz wrote:
> Thanks for the tip Tom. I've never deployed using the JavaFX Packaging
> tool, but I'm afraid that this will not work with an e4 application. My
> deploy must have a file (exe, cmd, shortcut, whatever) that starts the
> OSGi container with all plugins installed and activated, like my
> product/feature definition does.
>
> I thought that simply exporting my product (as instructed in most of
> Eclipse tutorials) would work. Is there any way to do this?
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385602 is a reply to message #1385566] Mon, 09 June 2014 20:42 Go to previous messageGo to next message
Fernando Paz is currently offline Fernando PazFriend
Messages: 22
Registered: May 2014
Junior Member
Sorry Tom, the answer you replied was edited. Actually I updated my question with my attempts to make it work.
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385625 is a reply to message #1385602] Tue, 10 June 2014 06:47 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Please don't update messages - I'm reading the forum using thunderbird
using the newsgroups and don't see those modifications!

I'll try to test this stuff in the next few days and come back with
informations, maybe there's a bug in the build.xml or something has
changed in tycho - what version of tycho are you running on?

Tom

On 09.06.14 22:42, Fernando Paz wrote:
> Sorry Tom, the answer you replied was edited. Actually I updated my
> question with my attempts to make it work.
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385740 is a reply to message #1385625] Tue, 10 June 2014 20:53 Go to previous messageGo to next message
Fernando Paz is currently offline Fernando PazFriend
Messages: 22
Registered: May 2014
Junior Member
I tried Tycho 0.18.0 and 0.19.0.
I also tried to change the Eclipse Target Platform to e(fx)clipse nightly builds, but I get the same errors.
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385742 is a reply to message #1385740] Tue, 10 June 2014 21:19 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Ok - on OS-X things work like a charme for me using JDK8.

What I did as a test is:
a) generate an e4-project structure
b) updated the root pom to tycho 0.21
c) executed mvn clean package (using m2e)
d) executed the build.xml

I'm going to run this on win8 let me see what I get.

Tom

On 10.06.14 22:53, Fernando Paz wrote:
> I tried Tycho 0.18.0 and 0.19.0.
> I also tried to change the Eclipse Target Platform to e(fx)clipse
> nightly builds, but I get the same errors.
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385744 is a reply to message #1385742] Tue, 10 June 2014 21:23 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On 10.06.14 23:19, Tom Schindl wrote:
> Ok - on OS-X things work like a charme for me using JDK8.
>
> What I did as a test is:
> a) generate an e4-project structure
> b) updated the root pom to tycho 0.21
0.21.0-SNAPSHOT

Tom
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385745 is a reply to message #1385744] Tue, 10 June 2014 21:35 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
The folder you mention:
> E:\dev\eclipse-workspaces\test.efxclipse\test.efxclipse.app.product\target\products\test.efxclipse.app.product\noenv\noenv\noenv

should have been created by the maven build. Did you run maven?

Tom


On 10.06.14 23:23, Tom Schindl wrote:
> On 10.06.14 23:19, Tom Schindl wrote:
>> Ok - on OS-X things work like a charme for me using JDK8.
>>
>> What I did as a test is:
>> a) generate an e4-project structure
>> b) updated the root pom to tycho 0.21
> 0.21.0-SNAPSHOT
>
> Tom
>
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1385749 is a reply to message #1385745] Tue, 10 June 2014 21:59 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
tested on win8 & jdk8 and it runs like a charme!

Tom

On 10.06.14 23:35, Tom Schindl wrote:
> The folder you mention:
>> E:\dev\eclipse-workspaces\test.efxclipse\test.efxclipse.app.product\target\products\test.efxclipse.app.product\noenv\noenv\noenv
>
> should have been created by the maven build. Did you run maven?
>
> Tom
>
>
> On 10.06.14 23:23, Tom Schindl wrote:
>> On 10.06.14 23:19, Tom Schindl wrote:
>>> Ok - on OS-X things work like a charme for me using JDK8.
>>>
>>> What I did as a test is:
>>> a) generate an e4-project structure
>>> b) updated the root pom to tycho 0.21
>> 0.21.0-SNAPSHOT
>>
>> Tom
>>
>
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1386016 is a reply to message #1385749] Thu, 12 June 2014 23:48 Go to previous messageGo to next message
Fernando Paz is currently offline Fernando PazFriend
Messages: 22
Registered: May 2014
Junior Member
Hi Tom.

I noticed that the error was the efxclipse P2 repository URL in the root pom.xml.

This URL is invalid: http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/runtime/nightly/site/

I had to change to this one: http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/addons/nightly/site/

Now I'm getting other errors, but I know it's related to unsatisfied dependencies because some of my bundles doesn't have a pom.xml file.


Cheers.
Re: How to correctly deploy an e4 application that uses e(fx)clipse? [message #1386036 is a reply to message #1386016] Fri, 13 June 2014 07:04 Go to previous message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
On 13.06.14 01:48, Fernando Paz wrote:
> Hi Tom.
>
> I noticed that the error was the efxclipse P2 repository URL in the root
> pom.xml.
>
> This URL is invalid:
> http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/runtime/nightly/site/
>
>
> I had to change to this one:
> http://downloads.efxclipse.org/efxclipse.bestsolution.at/p2-repos/addons/nightly/site/

That's correct! I filed
https://bugs.eclipse.org/bugs/show_bug.cgi?id=437324 and fixed it.

>
>
> Now I'm getting other errors, but I know it's related to unsatisfied
> dependencies because some of my bundles doesn't have a pom.xml file.
>

You should simply copy the one from the "app" and adjust the names,
version, ..., afterwards add a module to the pom.xml in "releng" and
don't forget to adjust the feature.

Tom
Previous Topic:Tooling to create JavaFX Beans?
Next Topic:Custom setup file
Goto Forum:
  


Current Time: Sat Apr 20 16:35:19 GMT 2024

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

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

Back to the top