Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » How to export a standalone application
How to export a standalone application [message #1712455] Sun, 25 October 2015 07:41 Go to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 573
Registered: October 2012
Location: Bern, Switzerland
Senior Member
For a private scout project, I created a standalone application by following the steps explained in the following post: https://wiki.eclipse.org/Scout/HowTo/3.9/Create_a_Standalone_Client_with_DB_Access

This works nicely. Now that development is more or less complete, I would like to export my project into a single executable that I can launch from outside eclipse. I have never used the "Export Scout Project" feature before (in our projects at work, artefacts are created using a maven/tycho build) and I cannot get it to work. I do not know if the reason for it not working is due to the standalone feature or if there some other issue.

I am using Eclipse Mars and Scout Mars (have not yet upgraded to SR1). I have both a development and production product, both work when started from within eclipse.
index.php/fa/23703/0/

When I start the export process, I am guided through these steps:
index.php/fa/23704/0/
index.php/fa/23705/0/

When I now click on the browse button, I get a popup showing my SWT project, but it does not list any of the two products that are present in that project:
index.php/fa/23706/0/

Is there an additional step that I need to take to make those products visible?

Is this the right approach to export my standalone application? What I want is an exe containing both server and client code as well as jetty to run the server when the client is launched. Can I use the same plugins in the production product as I am using in the development product (at the moment they are the same) or do I need to add others (or remove some)?

Any hints are welcome.
  • Attachment: Products.png
    (Size: 12.49KB, Downloaded 729 times)
  • Attachment: Step1.png
    (Size: 28.60KB, Downloaded 751 times)
  • Attachment: Step2.png
    (Size: 22.82KB, Downloaded 738 times)
  • Attachment: Step3.png
    (Size: 22.74KB, Downloaded 703 times)
Re: How to export a standalone application [message #1712456 is a reply to message #1712455] Sun, 25 October 2015 07:49 Go to previous messageGo to next message
Urs Beeli is currently offline Urs BeeliFriend
Messages: 573
Registered: October 2012
Location: Bern, Switzerland
Senior Member
Replying to myself: I found out why I got stuck on step 3: Because I have a standalone application, there is no sever product and the step I got stuck on was apparently trying to get me to choose a server product (even though it showed the client project). Deselecting "Server Application" in the first steps got rid of that issue and I could then select my client product in the next step.

I now have an executable that starts both server and client and I'm perfectly happy. Sorry for the noise here, hopefully it will help somebody else avoid the same mistake.
Re: How to export a standalone application [message #1713345 is a reply to message #1712456] Tue, 03 November 2015 14:17 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Quote:
Replying to myself: I found out why I got stuck on step 3: Because I have a standalone application, there is no sever product and the step I got stuck on was apparently trying to get me to choose a server product (even though it showed the client project). Deselecting "Server Application" in the first steps got rid of that issue and I could then select my client product in the next step.

This hint may saved me hours. I don't really know, because I read it before Wink

Is it somehow possible to configure your Scout bundles in such a way that you are able to build standalone clients and client/server products at the same time? The problem with the approach explained here is that you don't only change the dependencies, but you are also changing java code to make it work (ClientSession.get().goOffline()). Always reverting these changes in order to build a client-server application sucks...
As far as I see you would have to maintain two separate code bases although the differences would be minimal. Is it possible to change the behaviour of referenced/inherited plugins by "overwriting" certain parts like you would do with Java classes? This would enable you to reuse your plugins and create different products of it.

[Updated on: Tue, 03 November 2015 14:19]

Report message to a moderator

Re: How to export a standalone application [message #1713351 is a reply to message #1713345] Tue, 03 November 2015 14:40 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
In your code: If the clients are similar enough, you might want to save the energy of creating several client extensions (bundle or fragments).

In the widgets demo application, we have solved this with a property:
https://github.com/BSI-Business-Systems-Integration-AG/org.eclipse.scout.docs/blob/releases/5.0.x/code/widgets/org.eclipsescout.demo.widgets.client/src/org/eclipsescout/demo/widgets/client/ClientSession.java#L40-L46

Then we have several product files with several config.ini properties (setting the value of "server.available" to true or false, depending on what we need).
Re: How to export a standalone application [message #1713366 is a reply to message #1713351] Tue, 03 November 2015 15:29 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Thank you again Wink
I just defined a property standalone which is checked at the beginning of the client session. This is ok for me at the moment.
But I don't know how to add new products to be managed by the Scout SDK. I've no time for research right now. I'll continue tomorrow Wink
Re: How to export a standalone application [message #1713404 is a reply to message #1713366] Tue, 03 November 2015 19:36 Go to previous messageGo to next message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
This is simple:
Copy the project folder you are interested in (dev is intended to be started from the IDE, prod is intented to be build and to be used in production).

index.php/fa/23821/0/

In this example I have created the "development-standalone" folder a copy from "development".

* I recommend to rename your product file (in order not to confuse them later) => In this example I renamed it to "outlinebased-swt-client-dev-standalone.product"
* In {your app}/products/development-standalone/config.ini put the expected setting. Something like "server.available=false"
* Open the outlinebased-swt-client-dev-standalone.product and do following changes:
** In the Overview Tab, change the name (this is optional but better).
** In the Configuration Tab, update the "Use an existing config.ini file" value to /{your app}/products/development-standalone/config.ini.

I hope this helps.
  • Attachment: copy.png
    (Size: 12.92KB, Downloaded 670 times)
Re: How to export a standalone application [message #1713442 is a reply to message #1713404] Wed, 04 November 2015 08:53 Go to previous messageGo to next message
Jannik Malken is currently offline Jannik MalkenFriend
Messages: 44
Registered: October 2015
Member
Ok, that was exactly what I had done yesterday already. The difference was that I did it with the explorer outside of Eclipse. It was a simple refresh problem, so Eclipse didn't recognize the changes. For now everything seems to be fine. I don't think there will be the need of creating additional client extensions. Thanks!

Just had another weird problem. It's is sometimes hard to persuade Eclipse to stay in sync. The config.ini were all correctly set in the products 'Configuration' tab and I was able to start them via the products 'Overview' tab. However, by starting with the Scout Object Explorer it always chose the wrong config.ini. After more than one time clicking "Synchronize this configuration with the product's defining plug-in" everything worked correctly.
Re: How to export a standalone application [message #1713589 is a reply to message #1713442] Thu, 05 November 2015 10:58 Go to previous message
Jeremie Bresson is currently offline Jeremie BressonFriend
Messages: 1252
Registered: October 2011
Senior Member
Jannik Malken wrote on Wed, 04 November 2015 09:53
Ok, that was exactly what I had done yesterday already. The difference was that I did it with the explorer outside of Eclipse. It was a simple refresh problem, so Eclipse didn't recognize the changes.


If you ask me, this belongs to the wrong default settings in Eclipse. Check this:
http://stackoverflow.com/questions/6626703/eclipse-source-out-of-sync-with-file-system

Jannik Malken wrote on Wed, 04 November 2015 09:53
Just had another weird problem. It's is sometimes hard to persuade Eclipse to stay in sync. The config.ini were all correctly set in the products 'Configuration' tab and I was able to start them via the products 'Overview' tab. However, by starting with the Scout Object Explorer it always chose the wrong config.ini. After more than one time clicking "Synchronize this configuration with the product's defining plug-in" everything worked correctly.


Yes, this is a problem of Eclipse PDE...
(and an other reason why we are moving away from OSGi)
I work exactly like you.
Previous Topic:Maven build / OSGi / Tycho / manifest-first
Next Topic:[neon][ugm] Questions about migration of Scout Apps from Luna/Mars -> Neon
Goto Forum:
  


Current Time: Thu Apr 25 14:49:06 GMT 2024

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

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

Back to the top