Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Deploy plugins separately
Deploy plugins separately [message #1397840] Thu, 10 July 2014 08:23 Go to next message
r k is currently offline r kFriend
Messages: 20
Registered: June 2012
Junior Member
Hello together,

i just want to confirm, if the following idea makes sense:

in case you have a java project compiled in a .war file and you want to add other plugins to it subsequently developed by a third party without affecting the sourcecode in the war.

The new plugins contain functionality related to functions inside the .war file, would it be possible to use e.g. Apache Felix to reload newly developed plugins?

Thanks in advance,
R



Edit: Due to the fact, that the plugins itsself are OSGi bundles, it should be possible to add them manually?

[Updated on: Thu, 10 July 2014 10:18]

Report message to a moderator

Re: Deploy plugins separately [message #1398227 is a reply to message #1397840] Thu, 10 July 2014 20:29 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
r k <forums-noreply@xxxxxxxx> wrote:
> Hello together,
> i just want to confirm, if the following idea makes sense:
> in case you have a java project compiled in a .war file and you want to
> add other plugins to it subsequently developed by a third party without
> affecting the sourcecode in the war.
> The new plugins contain functionality related to functions inside the
> .war file, would it be possible to use e.g. Apache Felix to reload newly developed plugins?
>
> Thanks in advance, R

Yes, you can "add" plugins to the application without touching the war if
the felix plugin is in your war file, but we experienced issues doing it
while the app is running. So just to add functionality to the war
application it works like a charm.
Re: Deploy plugins separately [message #1398534 is a reply to message #1398227] Fri, 11 July 2014 07:54 Go to previous messageGo to next message
r k is currently offline r kFriend
Messages: 20
Registered: June 2012
Junior Member
Hey Markus,

thanks for your fast reply!

Does it mean, that i can just drop the apache felix lib inside my war file, build it and deploy it on the server. Afterwards I or a third party is able to develop new plugins (on the basis of the functionality used inside the war) and deploy these plugins "inside" the war or can I deploy them "next to" the war as a jar file?

Thanks a lot in advance!
R

Re: Deploy plugins separa tely [message #1398905 is a reply to message #1398534] Fri, 11 July 2014 19:25 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
r k <forums-noreply@xxxxxxxx> wrote:
> Hey Markus,
> thanks for your fast reply!
> Does it mean, that i can just drop the apache felix lib inside my war
> file, build it and deploy it on the server. Afterwards I or a third party
> is able to develop new plugins (on the basis of the functionality used
> inside the war) and deploy these plugins "inside" the war or can I deploy
> them "next to" the war as a jar file?
>
> Thanks a lot in advance!
> R

Yes. You need to add the Felix bundle to you RAP project and build thr War
file. Then you can set the felix system property in your application server
for the location of your third party plugins. In this folder you can add
compiled third party plugins. Now, if you deploy and start your
application, these bundles are automatically adde to the osgi runtime of
your rap application.
Re: Deploy plugins separa tely [message #1400400 is a reply to message #1398905] Mon, 14 July 2014 06:28 Go to previous messageGo to next message
r k is currently offline r kFriend
Messages: 20
Registered: June 2012
Junior Member
Hey Markus,

as far as I read in the felix focumentation, it has to be set in a config.ini file?

i will try it and give u some feedback!

Thank you!
R
Re: Deploy plugins separa tely [message #1421513 is a reply to message #1400400] Thu, 11 September 2014 13:13 Go to previous messageGo to next message
m wFriend
Messages: 1
Registered: September 2014
Junior Member
Hey Markus,

could you be so kind and explain me, where I have to place the configuration file (config.ini?) inside my project?
I could not really find something about it in the Felix documentation.

Thanks a lot.
Michael
Re: Deploy plugins separa tely [message #1421790 is a reply to message #1421513] Thu, 11 September 2014 22:48 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
m w <forums-noreply@xxxxxxxx> wrote:
> Hey Markus,
> could you be so kind and explain me, where I have to place the
> configuration file (config.ini?) inside my project?
> I could not really find something about it in the Felix documentation.
> Thanks a lot. Michael

Actually, I dont really know what config.ini you mean in conext of using
felix. If you have a WAR file with an RAP application the config.ini known
from eclipse resides in this WAR file. If you include the felix bundle in
your build, then you can configure felix using systemprperties, i.e. to
define the director felix reads plugins from.
Re: Deploy plugins separa tely [message #1422157 is a reply to message #1421790] Fri, 12 September 2014 12:02 Go to previous messageGo to next message
r k is currently offline r kFriend
Messages: 20
Registered: June 2012
Junior Member
Hi Markus,

what do you exactly mean by "systemproperties"? The Felix bundles should be included in the RAP application. Isn't there a configuration file that has to be included in the "application"?

Regards,
R
Re: Deploy plugins separa tely [message #1422359 is a reply to message #1422157] Fri, 12 September 2014 18:41 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
By systemproperties I mean java systemproperties. You need to set them in
your applicationserver.

r k <forums-noreply@xxxxxxxx> wrote:
> Hi Markus,
> what do you exactly mean by "systemproperties"? The Felix bundles should
> be included in the RAP application. Isn't there a configuration file that
> has to be included in the "application"?
>
> Regards, R
Re: Deploy plugins separa tely [message #1424101 is a reply to message #1422359] Mon, 15 September 2014 13:08 Go to previous messageGo to next message
r k is currently offline r kFriend
Messages: 20
Registered: June 2012
Junior Member
Hey Markus,

just to make sure everything is configured correctly (not working atm):
- The systemparameter will be set for Java to configure Felix (especially the auto deply directory)
- The Felix bundle will be added to the application war
- The Application will be deployed in JBoss
- The auto deploy dir will be created and the bundles added
- Start JBoss

Can I see somewhere, that it worked? There is no "starting" message printed by JBoss atm. Can I loo up the OSGi context somehow?

Thanks a lot,
best regards,
R
Re: Deploy plugins separa tely [message #1424393 is a reply to message #1424101] Mon, 15 September 2014 23:06 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
Ok, lets start over. Thats what we did:
1. Build a RAP application using tycho. The product and its feature already
includes the felix bundle so it will be included in the war.
2. set the felix systemproperty on the jboss startup script.
3. start jboss
4. deploy the war
Now we can add bundle dynamically to the configured folder.

In the web.xml you can enable the osgi console with a port. That way you
can telnet into it and check if felix is active.

Hope that helps.


r k <forums-noreply@xxxxxxxx> wrote:
> Hey Markus,
> just to make sure everything is configured correctly (not working atm): -
> The systemparameter will be set for Java to configure Felix (especially
> the auto deply directory)
> - The Felix bundle will be added to the application war
> - The Application will be deployed in JBoss
> - The auto deploy dir will be created and the bundles added
> - Start JBoss
>
> Can I see somewhere, that it worked? There is no "starting" message
> printed by JBoss atm. Can I loo up the OSGi context somehow?
>
> Thanks a lot, best regards, R
Re: Deploy plugins separa tely [message #1425477 is a reply to message #1424393] Wed, 17 September 2014 11:17 Go to previous messageGo to next message
r k is currently offline r kFriend
Messages: 20
Registered: June 2012
Junior Member
Thank you Markus!

The connection works with Telnet. The OSGi console is up and running. I tryied to configure the auto-deploy dir now, but the bundles inside the "bundle" folder do not show up in the bundle list of the OSGi console.

The server has been restarted, the deploy parameter are configrued as follows:

felix.auto.deploy.dir=bundle
felix.auto.deploy.action=start,install

That should be enough.

Do you have any idea?

Thank you,
R
Re: Deploy plugins separa tely [message #1425554 is a reply to message #1425477] Wed, 17 September 2014 13:23 Go to previous messageGo to next message
r k is currently offline r kFriend
Messages: 20
Registered: June 2012
Junior Member
For some reason, my auto deploy directory (<JBoss>/deploy/bundle) wont be accepted. The bundles inside this folder are not added to the applications OSGi context.

felix.auto.deploy.dir=bundle

is the configuration.

Regards,
R


Edit: I added the web-console bundle in order to make the web-console available. Therefore I tryied the following:

org.osgi.service.http.port=8888
org.osgi.manager.root=/system/console
manager.root=/system/console
felix.webconsole.manager.root=/system/console

but the web-console is as well not reachable...

[Updated on: Wed, 17 September 2014 14:15]

Report message to a moderator

Re: Deploy plugins separa tely [message #1425801 is a reply to message #1425554] Wed, 17 September 2014 21:34 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
r k <forums-noreply@xxxxxxxx> wrote:
> For some reason, my auto deploy directory (<JBoss>/deploy/bundle) wont be
> accepted. The bundles inside this folder are not added to the applications OSGi context.
> felix.auto.deploy.dir=bundle
>
> is the configuration.
> Regards, R

I think we missunderstood each other. By felix bunde I mean the felix
fileinstall bundle see here:

http://felix.apache.org/site/apache-felix-file-install.html

There is another systemproperty felix.fileinstall.dir.
With this it works for us.
Re: Deploy plugins separa tely [message #1426191 is a reply to message #1425801] Thu, 18 September 2014 11:28 Go to previous messageGo to next message
r k is currently offline r kFriend
Messages: 20
Registered: June 2012
Junior Member
Hi Markus,

thanks for the reply, good hint.

I added the fileinstall bundle to the war and configured it:

felix.fileinstall.dir=./bundle,/bundle,bundle
felix.fileinstall.log.level=1
felix.fileinstall.bundles.new.start=true

on the server (JBoss) I created the folder "bundle" next to the .war file in the deploy folder and dropped some jars.

When I start the server now and connect to Felix via telnet, i can see the fileinstall bundle active, but the bundle folder has not been "autodeployed" and the bundles inside have not been added to the OSGi context.

Anything apart from just using the fileinstall bundle I have to do?
Where do I have to put the "bundle" directory?

Thanks,
regards,
R
Re: Deploy plugins separa tely [message #1426282 is a reply to message #1426191] Thu, 18 September 2014 14:06 Go to previous messageGo to next message
r k is currently offline r kFriend
Messages: 20
Registered: June 2012
Junior Member
Hi Markus,

it's horrible. I tried several different cofnigruations and solutions in order to get Apache Felix File Install running, but it wont deploy my bundles.

I have passed the systemproperty
-Dfelix.fileinstall.dir=./bundle,/bundle,bundle

and placed the jar bundles for felix inside the war file (file-install, felix, etc) and deployed it within JBoss.

When I start the shell with telnet, I can see, that fileinstall is active, but I can not see my bundles in there.

Where does the "bundle" auto deploy folder have to be created? It seems not to be enough if it relies in the directory in which the .war file with the felix bundles has been placed.

Do I have to place it somewhere else?


Even if I try to deploy it manually via "install <absolute_or_relative_path_to_bundle>" it is not working and just gives the following error messages:

gogo: BundleException: Error reading bundle content.

so it seems to be the wrong path even if its absolute?

Thank you again for your help...,
R
Re: Deploy plugins separa tely [message #1426434 is a reply to message #1426282] Thu, 18 September 2014 18:55 Go to previous messageGo to next message
Markus  rüger is currently offline Markus rügerFriend
Messages: 369
Registered: July 2009
Senior Member
r k <forums-noreply@xxxxxxxx> wrote:
> Hi Markus,
> it's horrible. I tried several different cofnigruations and solutions in
> order to get Apache Felix File Install running, but it wont deploy my bundles.
> I have passed the systemproperty
> -Dfelix.fileinstall.dir=./bundle,/bundle,bundle
>
> and placed the jar bundles for felix inside the war file (file-install,
> felix, etc) and deployed it within JBoss.
> When I start the shell with telnet, I can see, that fileinstall is
> active, but I can not see my bundles in there.
> Where does the "bundle" auto deploy folder have to be created? It seems
> not to be enough if it relies in the directory in which the .war file
> with the felix bundles has been placed.
>
> Do I have to place it somewhere else?
>
>
> Even if I try to deploy it manually via "install
> <absolute_or_relative_path_to_bundle>" it is not working and just gives
> the following error messages:
> gogo: BundleException: Error reading bundle content.
>
> so it seems to be the wrong path even if its absolute?
>
> Thank you again for your help..., R

Hi, we just point to a directory somwhere outside from the server using
absolute path, i.e. -Dfelix.fileinstall.dir=/home/foo/autoinstall
Then we put our bundle jars there and start jboss with already deployed rap
app including felix fileinstall (this is just one extra bundle, not more).
Re: Deploy plugins separa tely [message #1426934 is a reply to message #1426434] Fri, 19 September 2014 12:51 Go to previous messageGo to next message
r k is currently offline r kFriend
Messages: 20
Registered: June 2012
Junior Member
Hi Markus,

I set up the whole server again and newly deployed the war archive together with the felix.shell, remote.shell and felix.fileinstall bundles.

When I start the server now and connect to it via telnet to see the bundles which are started, I can see, that all bundles are active except from the fileinstall bundle which is in state "STOPPING".

When I try to start it manually with "start <bundle>" it throws the following error:

"BundleException: Unable to acquire the state change lock for the module: osgi.identity; osgi.identity (...)"

Do you have any idea why exactly this bundle does not start properly?

Thanks a lot for your patience,
regards,
R
Re: Deploy plugins separa tely [message #1426978 is a reply to message #1426934] Fri, 19 September 2014 14:02 Go to previous message
Eclipse UserFriend
No, sorry, no clue on that.

Am 19.09.2014 14:51, schrieb r k:
> Hi Markus,
> I set up the whole server again and newly deployed the war archive
> together with the felix.shell, remote.shell and felix.fileinstall bundles.
> When I start the server now and connect to it via telnet to see the
> bundles which are started, I can see, that all bundles are active except
> from the fileinstall bundle which is in state "STOPPING".
> When I try to start it manually with "start <bundle>" it throws the
> following error:
> "BundleException: Unable to acquire the state change lock for the
> module: osgi.identity; osgi.identity (...)"
>
> Do you have any idea why exactly this bundle does not start properly?
>
> Thanks a lot for your patience, regards, R
Previous Topic:Tooltips in TreeViewer
Next Topic:Use "RAP Target Platform" as deployment platform or run an extra application server?
Goto Forum:
  


Current Time: Fri Mar 29 08:24:36 GMT 2024

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

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

Back to the top