Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster » Build Webstart-Application with different products
Build Webstart-Application with different products [message #526855] Tue, 13 April 2010 10:14 Go to next message
Andreas Schilling is currently offline Andreas SchillingFriend
Messages: 25
Registered: April 2010
Junior Member
hello!

we're currently setting up the Webstart-Build for one of our projects and one problem occured.
First, how does our project look like?
- plugins with GUI, business logic, etc. yadda yadda (the usual stuff)
- for database-configuration and the like we have 4 different plugins (for our testing environment and our customers' test- and production-environment)
- feature-plugin with 4 different products. each of them glues together the feature that is the same for all products+one of the above mentioned configuration plugins
- feature-plugin that is used as entry-point for the buckminster build (the site, to stay in the wording of most tutorials)

while the "normal" build works fine by selecting an p2 IU to use the correct product for building, this does not work when doing the webstart build.
how are we supposed to fix this?
this is, how our action looks like:

<public name="create.eclipse.jnlp.product" actor="ant">
  <actorProperties>
    <property key="buildFileId" value="buckminster.pdetasks"/>
    <property key="targets" value="create.eclipse.jnlp.product"/>
  </actorProperties>
  <properties>
    <property key="buckminster.eclipse.productFile"
value="one_of_our_product_files.product"/>
  <property key="buckminster.eclipse.deleteuilauncher" value="false"/>
  </properties>
  <prerequisites alias="action.requirements">
    <attribute name="feature.exports"/>
  </prerequisites>
  <products alias="action.output" base="${buckminster.output}" >
    <path path="webstart/"/>
  </products>
</public>


so, I see that you can tell which productFile to use. but how can we tell buckminster, that this file does not lie in the site-feature but in another feature? or isn't this possible at all?
currently, the build alwas uses the feature.xml of the site-project for building, which is not what we want.
any hints on how to handle this are appreciated.

best regards,

Andreas Schilling
Re: Build Webstart-Application with different products [message #526858 is a reply to message #526855] Tue, 13 April 2010 10:21 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3232
Registered: July 2009
Senior Member
Hi Andreas,
I'm not sure I understand what the problem is. The action that you provide, in what project does it reside? Can't you
just move it to the right project?

I'm sure I'm missing the point, but you have to provide some more info.

- thomas


On 04/13/2010 12:15 PM, Andreas Schilling wrote:
> hello!
>
> we're currently setting up the Webstart-Build for one of our projects
> and one problem occured.
> First, how does our project look like?
> - plugins with GUI, business logic, etc. yadda yadda (the usual stuff)
> - for database-configuration and the like we have 4 different plugins
> (for our testing environment and our customers' test- and
> production-environment)
> - feature-plugin with 4 different products. each of them glues together
> the feature that is the same for all products+one of the above mentioned
> configuration plugins
> - feature-plugin that is used as entry-point for the buckminster build
> (the site, to stay in the wording of most tutorials)
>
> while the "normal" build works fine by selecting an p2 IU to use the
> correct product for building, this does not work when doing the webstart
> build.
> how are we supposed to fix this?
> this is, how our action looks like:
>
>
> <public name="create.eclipse.jnlp.product" actor="ant">
> <actorProperties>
> <property key="buildFileId" value="buckminster.pdetasks"/>
> <property key="targets" value="create.eclipse.jnlp.product"/>
> </actorProperties>
> <properties>
> <property key="buckminster.eclipse.productFile"
> value="one_of_our_product_files.product"/>
> <property key="buckminster.eclipse.deleteuilauncher" value="false"/>
> </properties>
> <prerequisites alias="action.requirements">
> <attribute name="feature.exports"/>
> </prerequisites>
> <products alias="action.output" base="${buckminster.output}" >
> <path path="webstart/"/>
> </products>
> </public>
>
>
> so, I see that you can tell which productFile to use. but how can we
> tell buckminster, that this file does not lie in the site-feature but in
> another feature? or isn't this possible at all?
> currently, the build alwas uses the feature.xml of the site-project for
> building, which is not what we want.
> any hints on how to handle this are appreciated.
>
> best regards,
>
> Andreas Schilling
Re: Build Webstart-Application with different products [message #526863 is a reply to message #526858] Tue, 13 April 2010 10:34 Go to previous messageGo to next message
Andreas Schilling is currently offline Andreas SchillingFriend
Messages: 25
Registered: April 2010
Junior Member
hi Thomas!

the action is in the site project.
these are our plugins (apart from the plugins that make up the application)

our_project.configuration.A
our_project.configuration.B
our_project.configuration.C
our_project.configuration.D
our_project.product
our_project.site

the our_project.product defines the feature for the application along with 4 different product-files that connect the feature with on of the configuration plugins (A-D)
the our_project.site contains the cspex, the rmap, the cquery and some other files needed for the build (e.g. post-processing ant scripts).
so, the action is defined in the cspex of our_project.site.
but maybe this approach is not 100% correct? we're quite new to buckminster. before migrating from plain PDE-build to buckminster our plugins looked as above except for the our_project.site plugin. maybe we should have placed all buckminster-related stuff into the our_project.product bundle and not have a new bundle at all? we basically followed the tutorial of ralf ebert and as said, when doing a normal build (site.p2) everything works with the structure we have.
to sum it up: the problem is, that the .product files to use lie in the our_project.product bundle whereas the entrance point for the buckminster build is the our_project.site
EDIT: moving the desired .product file into the site-plugin didn't help either. it seems that the build just uses the feature.xml of the site-plugin and ignores the variable buckminster.eclipse.productFile

hope that helps to understand our problem (or, maybe there isn't a problem and it's just a slight configuration issue Wink)

regards,

Andreas Schilling

[Updated on: Wed, 14 April 2010 12:48]

Report message to a moderator

Re: Build Webstart-Application with different products [message #527701 is a reply to message #526855] Fri, 16 April 2010 07:23 Go to previous messageGo to next message
Andreas Schilling is currently offline Andreas SchillingFriend
Messages: 25
Registered: April 2010
Junior Member
hm, anyone with hints on this?
to quote the buckminster book I think I do understand now, why it does not work:
Quote:

The eclipse.feature component type is automatically generated for all Eclipse features. It can
generate a CSPEC from source or binary data. When generating the CSPEC, the various meta data files
in the source, or available in the binary representation are used to create the attributes.
If the CSPEC is generated from a p2 IU, then the IU is the single source of information.
If not generated from a p2 IU, the content of the feature.xml and build.properties files are
used. The build.properties is the source for what is included in the jar (both source and binary)
and the site category definitions. The rest of the information is picked from the feature.xml



this makes sense. if I put one of my configuration-plugins into the feature.xml of the site-plugin, everything works as expected. but that's not what I want, I want the build to use one of my .product files from the product-plugin which define what configuation-plugins to add to the base feature.
is there any way to achieve that? I can't believe we are the first ones that try to build a JNLP enabled RCP application with different configurations Wink
of course, I also can somehow patch all that into the resulting JNLP myself (we need to do some postprocessing on the JNLP files anyway) but I'd prefer a working process that can be easily applied to any project without too much of adaptional work.

regards,

Andreas
Re: Build Webstart-Application with different products [message #527774 is a reply to message #527701] Fri, 16 April 2010 12:19 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3232
Registered: July 2009
Senior Member
Hi Andreas,
It's been a long time since anyone did any work on the JNLP
functionality. Not sure if it's even documented. I'm sure it can be
improved in more ways then one and we will be happy to try and help out.

The best way forward with this is if you can write a bugzilla. If you
can attach an example that makes it easy to reproduce the problem (and
eventually validate that it's been fixed), then that usually simplifies
things a lot.

Regards,
Thomas Hallgren




On 2010-04-16 09:23, Andreas Schilling wrote:
> hm, anyone with hints on this?
> to quote the buckminster book I think I do understand now, why it does
> not work:
> Quote:
>> The eclipse.feature component type is automatically generated for all
>> Eclipse features. It can
>> generate a CSPEC from source or binary data. When generating the
>> CSPEC, the various meta data files
>> in the source, or available in the binary representation are used to
>> create the attributes.
>> If the CSPEC is generated from a p2 IU, then the IU is the single
>> source of information.
>> If not generated from a p2 IU, the content of the feature.xml and
>> build.properties files are
>> used. The build.properties is the source for what is included in the
>> jar (both source and binary)
>> and the site category definitions. The rest of the information is
>> picked from the feature.xml
>
>
> this makes sense. if I put one of my configuration-plugins into the
> feature.xml of the site-plugin, everything works as expected. but that's
> not what I want, I want the build to use one of my .product files from
> the product-plugin which define what configuation-plugins to add to the
> base feature.
> is there any way to achieve that? I can't believe we are the first ones
> that try to build a JNLP enabled RCP application with different
> configurations ;)
> of course, I also can somehow patch all that into the resulting JNLP
> myself (we need to do some postprocessing on the JNLP files anyway) but
> I'd prefer a working process that can be easily applied to any project
> without too much of adaptional work.
>
> regards,
>
> Andreas
Re: Build Webstart-Application with different products [message #528055 is a reply to message #527774] Mon, 19 April 2010 06:56 Go to previous messageGo to next message
Andreas Schilling is currently offline Andreas SchillingFriend
Messages: 25
Registered: April 2010
Junior Member
Hi Thomas!

Thomas Hallgren wrote on Fri, 16 April 2010 08:19

The best way forward with this is if you can write a bugzilla. If you can attach an example that makes it easy to reproduce the problem (and eventually validate that it's been fixed), then that usually simplifies things a lot.



We'd be fine to do that, however a great highly appreciated (probably not only from our side Wink) step would be some documentation about the JNLP building feature of buckminster, because as you said, it's not documented.
There seems to be a parameter to pass in a .product file and maybe we're just screwing up in some way and that's why it doesn't work. If there would be some small tutorial on how one should use the JNLP stuff and what it should produce it would be easier for us to judge, whether there seems to be some bug or really some feature missing.

regards,

Andreas
Re: Build Webstart-Application with different products [message #528064 is a reply to message #528055] Mon, 19 April 2010 07:32 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3232
Registered: July 2009
Senior Member
Hi Andreas,

As I said before, it's been a long while since anyone worked on the JNLP code. That means that for someone to document
it, there's some research and testing involved to figure out exactly how things work. At this point, you might well be
the one that is mostly up to date.

If you, or someone else with an interest in the JNLP support, are willing to help out on this (documenting, writing a
toturial, possibly fixing bugs), then I'd be more then happy to help answering questions, reviewing/committing patches
etc. but I do not have the cycles to drive this at the moment.

Regards,
Thomas Hallgren


On 04/19/2010 08:56 AM, Andreas Schilling wrote:
> Hi Thomas!
>
> Thomas Hallgren wrote on Fri, 16 April 2010 08:19
>> The best way forward with this is if you can write a bugzilla. If you
>> can attach an example that makes it easy to reproduce the problem (and
>> eventually validate that it's been fixed), then that usually
>> simplifies things a lot.
>
>
> We'd be fine to do that, however a great highly appreciated (probably
> not only from our side ;)) step would be some documentation about the
> JNLP building feature of buckminster, because as you said, it's not
> documented.
> There seems to be a parameter to pass in a .product file and maybe we're
> just screwing up in some way and that's why it doesn't work. If there
> would be some small tutorial on how one should use the JNLP stuff and
> what it should produce it would be easier for us to judge, whether there
> seems to be some bug or really some feature missing.
>
> regards,
>
> Andreas
Re: Build Webstart-Application with different products [message #533222 is a reply to message #528064] Wed, 12 May 2010 15:29 Go to previous messageGo to next message
Andreas Schilling is currently offline Andreas SchillingFriend
Messages: 25
Registered: April 2010
Junior Member
hi!

ok, so here's the modified mail-application we used for testing:
http://styx.head-crash.de/stuff/buckminster-jnlp.zip

what we basically did is nothing more than adding the site and put up a buckminster build and we added the configuration structure from our real projects.
to clarify how this works: we have the base of our application which is in the feature.xml of the com.example.mail.product bundle. in this simple case this is nothing more than the com.example.mail plugin and the RCP-feature. in a real-world application of course the other plugins of the application would be added as well.
the base is the same for all products we want to build.
then we have the configuration bundles (com.example.configuration.*) which simply aggregate the bundles that are specific for a certain product. main usage in our case are different database connection settings, that's why the test bundles included in the package are also called com.example.connection.*
in the example they do nothing, they are empty, but it's just to show the problem anyway.
allright, in our com.example.mail.product bundle we then have 4 different .product files which then do nothing else than combining the main feature with a configuration feature.
the "normal" builds from the .cspex run against these products (e.g. create.product.customer.prod) and work as expected.
if you run the action create.eclipse.jnlp.product from the .cspex you will get the following result:
- jnlp files for all bundles of the feature
- all jars

(EDIT: in the .cspex you can see that within the action create.eclipse.jnlp.product two properties are set:
<property key="buckminster.eclipse.productFile" value="MAIL.PRODUCER.DEV.product" />
<property key="buckminster.eclipse.deleteuilauncher" value="false" />
we just included these as we found them in some other example for a buckminster jnlp build. however it seems they do nothing at all, removing them or replacing them with any other values does not change anything in the output)

what is wrong?

  • first of all, it builds everything, not just the bundles for the different configurations. we however could live with that for the first, as we can simply delete the .jar and .jnlp files we do not need. but it's surely not what we want. however, this is nothing that stops the application from working.
  • as others already stated in other threads, the .jnlp files do not work out of the box as they use the "version" property when referencing jnlp files, while the real files have the version included in the filename (e.g. foobug_1.2.3.jnlp). we know that this works for some server setup (don't know excactly how it looks like, sorry) which we however do not use and as far as we understand most people would want to have the jnlp files with the version numbers already at the correct place.
  • the reference to the jnlp file of the configuration bundle is missing. in the main jnlp file there should be another entry saying e.g. <extension name="whatever" href="com.example.configuration.customer.prod_1.0.0.jnlp"/ > so, if the problem with the version numbers is fixed, for our case this is the last showstopper. if you don't have an application that is set up like ours, than there is only the problem with the version numbers.
  • the codebase is set to the placeholder $$codebase. it would be great if the codebase could easily be given to the buckminster action as some parameter.
  • some essential things are missing in the main jnlp file: <application-desc> with a reference to the main class (WebStartMain) as well as the webstart launcher (should be a <jar> within the <resources> part) and the eclipse product to start (should be a <property> within the <resources> part)


ok, let's sum up how our current jnlp postprocessing ANT-task looks like (this basically defines what the buckminster jnlp task should do in an ideal case Wink)

  1. fix the codebase in all jnlps by using a regex
  2. fix the version number stuff in all jnlps with a regex (search the version number, append it to the filename, delete what's nto needed)
  3. insert the <application-desc> part to reference the webstart main class in the main jnlp file
  4. insert reference to the launcher jar in the main jnlp file
  5. insert "eclipse.product" property to tell, which product to start in the main jnlp file
  6. insert the reference to the jnlp of the configuration bundle as an <extension> in the main jnlp file


here is an example (straight from our test setup, except that we replaced the codebase with some dummy path) how a fixed (main) jnlp looks like:
http://styx.head-crash.de/stuff/patched-jnlp.zip
this surely isn't an ideal jnlp, but at least with this one the application starts.
for the other jnlp files the only changes to be done are the version-fixes and inserting the correct codebase

phew, I hope I could explain everything in an understandable manner Smile if anything is unclear about what our problems are and what we wanna achieve, please ask.
we hope we can help improving the webstart building feature of buckminster!

regards,

Andreas

[Updated on: Wed, 12 May 2010 15:38]

Report message to a moderator

Re: Build Webstart-Application with different products [message #548810 is a reply to message #526855] Fri, 23 July 2010 07:20 Go to previous message
Andreas Schilling is currently offline Andreas SchillingFriend
Messages: 25
Registered: April 2010
Junior Member
hi everyone!

sorry for bumping this thread, but are there any news on the JNLP/buckminster topic? especially regarding new releases?

apart from the original problem of this topic another issue came up in the meantime. for our latest project we aren't even able to generate a working webstart version of the application with our postprocessing ant-tasks.
the main problem are the jar-references that are generated by buckminster. two problems to be exact:
a) bundle verison numbers are always attached with an underscore. but if the bundle-jar now is named a.third.party.bundle-1.0.0.jar instead of a.third.party.bundle_1.0.0.jar, the reference is broken
b) if bundle name and the name of the jar do not match, not only the underscore but the complete reference is broken (and hard or impossible to fix afterwards). if the bundle name is a.third.party.bundle and the jar is called our.superlovely.bundle.jar we're in trouble.

as you can see, this problem only occurs with third party libraries that are included in our project where we don't have that much influence on how they are delivered.

any ideas are appreciated Smile
oh, and in my previous post there are links to a small test application that can be used to reproduce our initial problems from this thread (though the latter on now is the worse to be honest, as we so far found no way to patch the JNLP afterwards with ant or anything else)

regards,

Andreas
Previous Topic:Signing and Packing
Next Topic:Problems with creating JNLP build of eclipse RCP product
Goto Forum:
  


Current Time: Fri Dec 19 16:30:45 GMT 2014

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

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