You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Konstantinos Giannoutakis <kg...@iti.gr> on 2011/05/18 11:50:13 UTC

Launch felix within eclipse

Hi,

I am developing an eclipse plugin where the user should be able to run 
Felix with some bundles installed.
All bundles are stored within a Maven repository, and the plugin should 
be able to start the Felix framework with these bundles installed.

The pax runner plugin does this job, but it is incompatible with Eclipse 
3.6.
Can anyone give me any example or any link about starting a felix 
framework with bundles from a maven repository?

Thank you very much






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Launch felix within eclipse

Posted by Přemek Brada <br...@kiv.zcu.cz>.
Hi Kostas,

as Chris wrote, you don't use the activator to install a bundle into a
framework. In the most basic setup, you use
org.osgi.framework.BundleContext.installBundle(path-to-bundle-jar) to
add a bundle to a framework; or you can use anything more clever (like
Felix File Install,
http://felix.apache.org/site/apache-felix-file-install.html).

HTH,
Premek


On 20 May 2011 07:34, Christopher Armstrong <ca...@fastmail.com.au> wrote:
> Hi Konstantinos
>
> You shouldn't have to
> On 19/05/2011, at 22:50 PM, Konstantinos Giannoutakis wrote:
>
>> It looks like that your plugin is suitable for me...But I have one question: If I have a jar OSGi bundle file, how should I get programmatically its activator in order to add it to the Felix framework?
>
> You don't need its activator to add it to the framework. My plugin uses the Eclipse Target Platform to get your bundles, and Eclipse automatically registers the bundle projects in your workspace with my plugin. My plugin uses a custom Felix launcher to add your target platform and workspace bundles automatically to the Felix framework, and it automatically updates them each time you launch the framework from your workspace (as an OSGi framework).
>
> If your bundle has an activator, Felix will call it when the bundle is started within the Felix container that is created from the OSGi launch configuration that you put together in the Debug Configurations dialog. Its just like starting up an Eclipse OSGi framework - you just need to select Apache Felix as your framework and ensure that Felix is in your Eclipse target platform (configured under Window->Preferences->OSGi Frameworks->Target Platform IIRC).
>
> Cheers
>
> Chris
> --------
> Christopher Armstrong
> carmstrong@fastmail.com.au
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Premek Brada (Ing et MSc, PhD)
  Lecturer in Software enginering, Webmaster
  Department of Computer Science and Engineering
  University of West Bohemia in Pilsen, CZ
  << brada at kiv.zcu.cz | www.kiv.zcu.cz/~brada/ | +420-377-63-2435 >>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Launch felix within eclipse

Posted by Christopher Armstrong <ca...@fastmail.com.au>.
Hi Konstantinos

Apologies, I generally assume that users know how to setup Eclipse for an OSGi framework, as I wrote the plugin as a substitute for using Equinox. Admittedly, it was designed for experienced users who are familiar with developing OSGi in Eclipse, and wanted tighter integration and a simpler solution than Pax Runner. It should still be possible for beginner's to use it, but it requires more setup.

1. Configure your workspace's Target Platform. You can do this in the Preferences under OSGi Frameworks. The target platform is just a set of OSGi bundles you want to always debug with, usually infrastructure components that you sourced from other parties, such as Apache Felix and some of its Compendium implementations. I usually add a copy of the Felix framework bundle and any other "infrastructure" bundles I want (such as OSGi console, Config Admin, Declarative Services runtime, etc). You don't add your own bundles - they are assembled automatically from the projects in your workspace.

2. Add any OSGi projects to your workspace that you want to debug with.

3. Goto Debug -> Debug Configurations... (the little bug button). Create an OSGi framework configuration, set the OSGi framework to Apache Felix. Checkbox any bundles you want to run in this debug configuration from your target platform and your workspace, and then click Debug!

Basically, the process is the same as debugging with Eclipse Equinox, another OSGi framework (which has builtin support in Eclipse).

Cheers
Chris

On 25/05/2011, at 17:49 PM, Konstantinos Giannoutakis wrote:

> Hi Chris,
> 
> I installed your plugin into my eclipse installation, but I am not sure about how to use it. Do you have any related documentation?
> I am not so familiar with OSGi framework :)
> 
> thank you and best regards,
> Kostas

--------
Christopher Armstrong
carmstrong@fastmail.com.au






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Launch felix within eclipse

Posted by Konstantinos Giannoutakis <kg...@iti.gr>.
Hi Chris,

I installed your plugin into my eclipse installation, but I am not sure 
about how to use it. Do you have any related documentation?
I am not so familiar with OSGi framework :)

thank you and best regards,
Kostas



On 20/5/2011 8:34 πμ, Christopher Armstrong wrote:
> Hi Konstantinos
>
> You shouldn't have to
> On 19/05/2011, at 22:50 PM, Konstantinos Giannoutakis wrote:
>
>> It looks like that your plugin is suitable for me...But I have one question: If I have a jar OSGi bundle file, how should I get programmatically its activator in order to add it to the Felix framework?
> You don't need its activator to add it to the framework. My plugin uses the Eclipse Target Platform to get your bundles, and Eclipse automatically registers the bundle projects in your workspace with my plugin. My plugin uses a custom Felix launcher to add your target platform and workspace bundles automatically to the Felix framework, and it automatically updates them each time you launch the framework from your workspace (as an OSGi framework).
>
> If your bundle has an activator, Felix will call it when the bundle is started within the Felix container that is created from the OSGi launch configuration that you put together in the Debug Configurations dialog. Its just like starting up an Eclipse OSGi framework - you just need to select Apache Felix as your framework and ensure that Felix is in your Eclipse target platform (configured under Window->Preferences->OSGi Frameworks->Target Platform IIRC).
>
> Cheers
>
> Chris
> --------
> Christopher Armstrong
> carmstrong@fastmail.com.au
>
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Launch felix within eclipse

Posted by Christopher Armstrong <ca...@fastmail.com.au>.
Hi Konstantinos

You shouldn't have to
On 19/05/2011, at 22:50 PM, Konstantinos Giannoutakis wrote:

> It looks like that your plugin is suitable for me...But I have one question: If I have a jar OSGi bundle file, how should I get programmatically its activator in order to add it to the Felix framework?

You don't need its activator to add it to the framework. My plugin uses the Eclipse Target Platform to get your bundles, and Eclipse automatically registers the bundle projects in your workspace with my plugin. My plugin uses a custom Felix launcher to add your target platform and workspace bundles automatically to the Felix framework, and it automatically updates them each time you launch the framework from your workspace (as an OSGi framework).

If your bundle has an activator, Felix will call it when the bundle is started within the Felix container that is created from the OSGi launch configuration that you put together in the Debug Configurations dialog. Its just like starting up an Eclipse OSGi framework - you just need to select Apache Felix as your framework and ensure that Felix is in your Eclipse target platform (configured under Window->Preferences->OSGi Frameworks->Target Platform IIRC).

Cheers 

Chris
--------
Christopher Armstrong
carmstrong@fastmail.com.au






---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Launch felix within eclipse

Posted by Konstantinos Giannoutakis <kg...@iti.gr>.
Hi Christopher,

Thank you very much for your response.

It looks like that your plugin is suitable for me...But I have one 
question: If I have a jar OSGi bundle file, how should I get 
programmatically its activator in order to add it to the Felix framework?

Thank you,
Kostas


On 19/5/2011 9:56 πμ, Christopher Armstrong wrote:
> Hi Konstantinos
>
> I developed a plugin for Eclipse that lets you run Apache Felix as an
> Eclipse target platform. It doesn't depend on Pax Runner. You might be
> able to extend it so that it can navigate a maven repository and add
> bundles from it to the target platform.
>
> See http://code.google.com/p/felix-eclipse
>
> Regards
> Christopher Armstrong
>
> On Wed, 18 May 2011 12:50 +0300, "Konstantinos Giannoutakis"
> <kg...@iti.gr>  wrote:
>> Hi,
>>
>> I am developing an eclipse plugin where the user should be able to run
>> Felix with some bundles installed.
>> All bundles are stored within a Maven repository, and the plugin should
>> be able to start the Felix framework with these bundles installed.
>>
>> The pax runner plugin does this job, but it is incompatible with Eclipse
>> 3.6.
>> Can anyone give me any example or any link about starting a felix
>> framework with bundles from a maven repository?
>>
>> Thank you very much



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Launch felix within eclipse

Posted by Christopher Armstrong <ca...@fastmail.com.au>.
Hi Konstantinos

I developed a plugin for Eclipse that lets you run Apache Felix as an
Eclipse target platform. It doesn't depend on Pax Runner. You might be
able to extend it so that it can navigate a maven repository and add
bundles from it to the target platform.

See http://code.google.com/p/felix-eclipse

Regards
Christopher Armstrong

On Wed, 18 May 2011 12:50 +0300, "Konstantinos Giannoutakis"
<kg...@iti.gr> wrote:
> Hi,
> 
> I am developing an eclipse plugin where the user should be able to run 
> Felix with some bundles installed.
> All bundles are stored within a Maven repository, and the plugin should 
> be able to start the Felix framework with these bundles installed.
> 
> The pax runner plugin does this job, but it is incompatible with Eclipse 
> 3.6.
> Can anyone give me any example or any link about starting a felix 
> framework with bundles from a maven repository?
> 
> Thank you very much
-- 
  Christopher Armstrong
  carmstrong ^^AT^ fastmail dOT com /Dot/ au


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Native library crash in OSGi

Posted by "niibasta@gmail.com" <ni...@gmail.com>.
On 18.05.2011 19:19, Richard S. Hall wrote:
> On 5/18/11 11:13, niibasta@gmail.com wrote:
>> Hello!
>>
>> I wonder, is anybody tested such behavior:
>>
>> We have one bundle with native library inside. Library throws, for 
>> example, "AccessViolation". Usually, when operation system catches 
>> such exception, it asks you to kill process. I wonder, what would be 
>> with felix? Whole instance will fail or only one bundle will fall and 
>> others continuous to work?
>>
>> On my opinion, whole felix instance will fall down, because all 
>> bundles are running on the same jvm on the same process. Am I wrong?
>
> I would assume so too.
>
>>
>> I heard about "distributed osgi". Are there any work in this direction?
>
> Apache CXF has support for the OSGi Remote Services specification.

Thanks for advice, but it's very heavy for my task.

>
> -> richard
>
>>
>> Thanks.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Native library crash in OSGi

Posted by "Richard S. Hall" <he...@ungoverned.org>.
On 5/18/11 11:13, niibasta@gmail.com wrote:
> Hello!
>
> I wonder, is anybody tested such behavior:
>
> We have one bundle with native library inside. Library throws, for 
> example, "AccessViolation". Usually, when operation system catches 
> such exception, it asks you to kill process. I wonder, what would be 
> with felix? Whole instance will fail or only one bundle will fall and 
> others continuous to work?
>
> On my opinion, whole felix instance will fall down, because all 
> bundles are running on the same jvm on the same process. Am I wrong?

I would assume so too.

>
> I heard about "distributed osgi". Are there any work in this direction?

Apache CXF has support for the OSGi Remote Services specification.

-> richard

>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Native library crash in OSGi

Posted by CD Rasmussen <ra...@gmail.com>.
Also check out rOSGi, which is Remote OSGi. The point here is not so much
the remoteness but that it can be used for any process not in the current
container.

Cheers.
On Wed, May 18, 2011 at 11:13 AM, niibasta@gmail.com <ni...@gmail.com>wrote:

> Hello!
>
> I wonder, is anybody tested such behavior:
>
> We have one bundle with native library inside. Library throws, for example,
> "AccessViolation". Usually, when operation system catches such exception, it
> asks you to kill process. I wonder, what would be with felix? Whole instance
> will fail or only one bundle will fall and others continuous to work?
>
> On my opinion, whole felix instance will fall down, because all bundles are
> running on the same jvm on the same process. Am I wrong?
>
> I heard about "distributed osgi". Are there any work in this direction?
>
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Native library crash in OSGi

Posted by "niibasta@gmail.com" <ni...@gmail.com>.
Hello!

I wonder, is anybody tested such behavior:

We have one bundle with native library inside. Library throws, for 
example, "AccessViolation". Usually, when operation system catches such 
exception, it asks you to kill process. I wonder, what would be with 
felix? Whole instance will fail or only one bundle will fall and others 
continuous to work?

On my opinion, whole felix instance will fall down, because all bundles 
are running on the same jvm on the same process. Am I wrong?

I heard about "distributed osgi". Are there any work in this direction?

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Launch felix within eclipse

Posted by Přemek Brada <br...@kiv.zcu.cz>.
Hello Kostas,

have a look at classes ApacheACERunner and VMLauncherUtility at
http://www.assembla.com/code/eclipse-ace/subversion/nodes/trunk/src/src/cz/zcu/kiv/apacheace
- the first calls the second, which creates a lauch configuration with
VM instance that loads Pax Runner daemon class from a path stored in
plugin preferences. Hope this helps.

We don't load bundles to the started framework from Eclipse however,
so I can't help in this aspect I'm afraid.

Premek


On 18 May 2011 16:47, Konstantinos Giannoutakis <kg...@iti.gr> wrote:
> Dear Premek,
>
> It would be great if you point me to specific parts of code. Actually I am
> interested in creating the Felix framework and installing bundles on it
> programmatically.
>
> Thank you in advance,
> Kostas
>
>
> On 18/5/2011 5:30 μμ, Přemek Brada wrote:
>>
>> Hello,
>>
>> in our ACE IDE project (http://www.assembla.com/spaces/eclipse-ace/),
>> we are using Pax Runner to launch Felix loaded with local Apache ACE
>> server/gateway from within Eclipse Helios (3.6) - it works without
>> problems, though we are not loading bundles from a maven repo.  I will
>> be happy to point to specific places in the code if you would like to
>> have a look.
>>
>> Premek
>>
>>
>> On 18 May 2011 11:50, Konstantinos Giannoutakis<kg...@iti.gr>  wrote:
>>>
>>> Hi,
>>>
>>> I am developing an eclipse plugin where the user should be able to run
>>> Felix
>>> with some bundles installed.
>>> All bundles are stored within a Maven repository, and the plugin should
>>> be
>>> able to start the Felix framework with these bundles installed.
>>>
>>> The pax runner plugin does this job, but it is incompatible with Eclipse
>>> 3.6.
>>> Can anyone give me any example or any link about starting a felix
>>> framework
>>> with bundles from a maven repository?
>>>
>>> Thank you very much
>>>
>>>
>>>
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>>
>>>
>>
>>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Premek Brada (Ing et MSc, PhD)
  Lecturer in Software enginering, Webmaster
  Department of Computer Science and Engineering
  University of West Bohemia in Pilsen, CZ
  << brada at kiv.zcu.cz | www.kiv.zcu.cz/~brada/ | +420-377-63-2435 >>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Launch felix within eclipse

Posted by Konstantinos Giannoutakis <kg...@iti.gr>.
Dear Premek,

It would be great if you point me to specific parts of code. Actually I 
am interested in creating the Felix framework and installing bundles on 
it programmatically.

Thank you in advance,
Kostas


On 18/5/2011 5:30 μμ, Přemek Brada wrote:
> Hello,
>
> in our ACE IDE project (http://www.assembla.com/spaces/eclipse-ace/),
> we are using Pax Runner to launch Felix loaded with local Apache ACE
> server/gateway from within Eclipse Helios (3.6) - it works without
> problems, though we are not loading bundles from a maven repo.  I will
> be happy to point to specific places in the code if you would like to
> have a look.
>
> Premek
>
>
> On 18 May 2011 11:50, Konstantinos Giannoutakis<kg...@iti.gr>  wrote:
>> Hi,
>>
>> I am developing an eclipse plugin where the user should be able to run Felix
>> with some bundles installed.
>> All bundles are stored within a Maven repository, and the plugin should be
>> able to start the Felix framework with these bundles installed.
>>
>> The pax runner plugin does this job, but it is incompatible with Eclipse
>> 3.6.
>> Can anyone give me any example or any link about starting a felix framework
>> with bundles from a maven repository?
>>
>> Thank you very much
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Launch felix within eclipse

Posted by Přemek Brada <br...@kiv.zcu.cz>.
Hello,

in our ACE IDE project (http://www.assembla.com/spaces/eclipse-ace/),
we are using Pax Runner to launch Felix loaded with local Apache ACE
server/gateway from within Eclipse Helios (3.6) - it works without
problems, though we are not loading bundles from a maven repo.  I will
be happy to point to specific places in the code if you would like to
have a look.

Premek


On 18 May 2011 11:50, Konstantinos Giannoutakis <kg...@iti.gr> wrote:
> Hi,
>
> I am developing an eclipse plugin where the user should be able to run Felix
> with some bundles installed.
> All bundles are stored within a Maven repository, and the plugin should be
> able to start the Felix framework with these bundles installed.
>
> The pax runner plugin does this job, but it is incompatible with Eclipse
> 3.6.
> Can anyone give me any example or any link about starting a felix framework
> with bundles from a maven repository?
>
> Thank you very much
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Premek Brada (Ing et MSc, PhD)
  Lecturer in Software enginering, Webmaster
  Department of Computer Science and Engineering
  University of West Bohemia in Pilsen, CZ
  << brada at kiv.zcu.cz | www.kiv.zcu.cz/~brada/ | +420-377-63-2435 >>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org