Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Plans that reference to shared artifacts?
Plans that reference to shared artifacts? [message #666461] Wed, 20 April 2011 13:38 Go to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre Bergamin
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Hello everyone

I'm not sure if I understand plans correctly. We have a web bundle and a
"server" bundle, both using services from a core bundle. The web bundle
and the server bundle should be deployable on the same virgo instance or
on different machines.

We now created a core.plan file that contains the bundles core.api and
core (that exposes the shared service).

I now expected that I can just create two other plan files for the web
and the server bundles that each reference to the core.plan file like so:

<plan name="web.plan" ...>
<artifact type="plan" name="core.plan" />
<artifact type="bundle" name="com.example.web" />
</plan>

<plan name="server.plan" ...>
<artifact type="plan" name="core.plan" />
<artifact type="bundle" name="com.example.server" />
</plan>

But when deploying both plans on the same virgo instance, I get an
exception that core.plan has already been installed, when the 2nd one
gets installed.

"Hot deploy failed for file 'web.plan'.
org.eclipse.virgo.kernel.deployer.core.DeploymentException:
InstallArtifact plan 'core.plan' version '1.0.0' in scope 'null' was
installed when plan 'server.plan' version '1.0.0' in scope 'null' was
installed"


So what is the proper way to handle this situation where two plans
depend on other plans or bundles, but should be startable individually?


Thank you in advance for your help,
James
Re: Plans that reference to shared artifacts? [message #666592 is a reply to message #666461] Thu, 21 April 2011 08:44 Go to previous messageGo to next message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
The current design is that plans form a "forest" of trees rather than a DAG. In other words, no two plans may refer to the same artifact.

At some point in the future, I'd love to remove that restriction, but it will be quite a meaty feature as it will involve correctly managing the state of "shared" artifacts as well as dealing with all the combinations of scoped/unscoped/atomic/non-atomic across multiple parents. This is the kind of thing that tends to stay on the back-burner, I'm afraid.

So there are two approaches to working round the restriction when you want to share a bundle between two plans.

The first, which may not apply in your scenario, is to let the bundle be auto-provisioned by virtue of bundles in the other plans having package dependencies on the "shared" bundle.

The second is a bit brutal, but works well. Add the "shared" bundle, or any other "shared" artifact for that matter, to the initialArtifacts property of the user region properties file so that it is deployed before the plans that need it.

If you feel that it is important to lift the restriction eventually, kindly raise an enhancement bugzilla. Maybe someone who fancies a challenge will then step forward in due course...
Re: Plans that reference to shared artifacts? [message #667036 is a reply to message #666592] Tue, 26 April 2011 10:25 Go to previous messageGo to next message
Jean-Pierre Bergamin is currently offline Jean-Pierre Bergamin
Messages: 51
Registered: March 2011
Location: Zürich, CH
Member
Am 21.04.2011 10:44, schrieb Glyn Normington:
> The current design is that plans form a "forest" of trees rather than a
> DAG. In other words, no two plans may refer to the same artifact.
>
> At some point in the future, I'd love to remove that restriction, but it
> will be quite a meaty feature as it will involve correctly managing the
> state of "shared" artifacts as well as dealing with all the combinations
> of scoped/unscoped/atomic/non-atomic across multiple parents. This is
> the kind of thing that tends to stay on the back-burner, I'm afraid.
>
> So there are two approaches to working round the restriction when you
> want to share a bundle between two plans.
>
> The first, which may not apply in your scenario, is to let the bundle be
> auto-provisioned by virtue of bundles in the other plans having package
> dependencies on the "shared" bundle.
>
> The second is a bit brutal, but works well. Add the "shared" bundle, or
> any other "shared" artifact for that matter, to the initialArtifacts
> property of the user region properties file so that it is deployed
> before the plans that need it.
>
> If you feel that it is important to lift the restriction eventually,
> kindly raise an enhancement bugzilla. Maybe someone who fancies a
> challenge will then step forward in due course...

Thank you for the explanation.
We will create different plan files for the different "configurations"
and include the "shared" bundles in those plan files. We later may
configure the shared bundles to be loaded with the initialArtifacts
property, so there is no urgent need for plans to support shared bundles.


Best regards,
James
Re: Plans that reference to shared artifacts? [message #667041 is a reply to message #667036] Tue, 26 April 2011 14:49 Go to previous message
Glyn Normington is currently offline Glyn Normington
Messages: 1222
Registered: July 2009
Senior Member
Thanks James.
Previous Topic:Slow JSP compilation
Next Topic:Simple Virgo Web application bundle
Goto Forum:
  


Current Time: Sat Oct 25 00:58:29 GMT 2014

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

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