You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by jochenw <jo...@googlemail.com> on 2015/01/22 08:04:05 UTC

Karaf EIK - how to configure the runtime?

Hi,

I did first steps with Karaf EIK and found some issues regarding
configuration of the Karaf runtime:

a) I'd like to start multiple run configurations in Eclipse in parallel (to
be able to debug communication across a distributed system). Since this is
not productive use, I assumed that doing that with one Karaf installation
should not be a problem (it's not possible to have two active target
configurations at a time in Eclipse). However, the second configuration
started waits for the lock forever. It starts anyways, so this might only be
some cosmetics in karaf.log. I tried to pass -Dkaraf.lock=false as settings
for the run configuration, but such settings seem to be ngelected by Karaf
EIK. Setting karaf.lock = false in system.properties also didn't work.
Finally I exchanged lock(new Properties()); by lock(System.getProperties());
in the Karaf EIK LockManager.java, which resolved the lock problem since
then it takes the settings from system.properties.

Is there another way to achieve this, and is there a reason why the
LockManager uses a fresh properties object instead of using the ones read
from system.properties by the SystemPropertyLoader?

b) With the default start level set to 80, no bundles in the run
configuration with a start level higher than 80 are started. And they cannot
be started from the Karaf console in Eclipse (start <bundlenumber> just does
nothing). Setting org.osgi.framework.startlevel.beginning to whatever level
higher than 80 via run configuration settings (-D...) or in
config.properties does not help. Eventually, I have changed
equinoxProperties.put(OSGI_START_LEVEL_KEY, defaultStartLevel.toString());
in KarafLaunchConfigurationDelegate.java to
equinoxProperties.put(OSGI_START_LEVEL_KEY, "200"); Looks like this sets the
org.osgi.framework.startlevel.beginning value, and the original code uses
the default start level from the run configuration.

I know that these are "bloody changes", since I'm not really familiar with
the Karaf EIK internals. So also here the question: is there a better way to
achieve this. I also know that start levels are better not used in a clean
OSGi system, but in our project we are not yet fully "dynamized".

c) I'm using a custom Karaf distribution, with a number of bundles in an
additional repository located in the Karaf home folder, parallel to system.
I have added this as additional entry to
org.ops4j.pax.url.mvn.defaultRepositories
(file:${karaf.home}/myrepo@id=myid). Works perfectly when starting Karaf in
the usual way. However, when using this as directory for creation of an
Apache Karaf project in Eclipse with Karaf EIK, all bundles / features in
this repo are just neglected. I have not yet digged into the Karaf EIK code
to find the place where the resolution of the repositories should happen.

Currently I just move all the bundles to the system repo, then Karaf EIK
finds it. But anyways: is there a special trick to make Karaf EIK look for
bundles in additional repos added to
org.ops4j.pax.url.mvn.defaultRepositories?

Some additional facts: I'm using the latest version of Karaf EIK from
github, with Eclipse Luna SR1 and Karaf 3.0.2.

Cheers,
Jochen





--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-EIK-how-to-configure-the-runtime-tp4037931.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf EIK - how to configure the runtime?

Posted by Scott Lewis <sl...@composent.com>.
On 2/8/2015 10:33 PM, Jean-Baptiste Onofré wrote:
> Hi Jochen,
>
> You can create a Jira.
>
> I will take a look (I plan to prepare EIK 0.10.0 release).

Speaking of EIK, any word on the questions below WRT 0.10.0?

Using Karaf 3.0.2, Eclipse Luna SR1, and EIK 0.9.0, I'm experiencing the 
exception reported by this bug:

https://issues.apache.org/jira/browse/KARAF-2668

The bug was apparently resolved, but it's not clear to me from the 
comments whether it was resolved because:

1) EIK works on Karaf 2.x (and not 3.x)
2) EIK has a 0.10.0 snapshot version that fixes
3) Some other change to Karaf, Eclipse, and/or EIK

How can I most easily determine how to use EIK with Karaf 3.x? (and 
eventually 4.x hopefully)

Thanks,

Scott



Re: Karaf EIK - how to configure the runtime?

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Jochen,

You can create a Jira.

I will take a look (I plan to prepare EIK 0.10.0 release).

Regards
JB

On 02/09/2015 06:54 AM, jochenw wrote:
> I have solved problem c) now (ok, kind of): the default repositories are read
> correctly, and also the features are resolved. However, when the list of
> bundles for the target configuration is built, Karaf EIK only reads the
> system and default folders, no additional repositories in Karaf's root
> folder.
>
> Adding something like:
> KarafCorePluginUtils.getJarFileList(
>
> karafPlatformModel.getRootDirectory().append("myrepo").toFile(),
>                  jarFiles,
>                  MAX_DIRECTORY_RECURSE_DEPTH);
>
> in KarafLaunchUtils.java (function getJarDirectories) helps. Of course, this
> is hard coding "myrepo", no generic resolution of repos defined in
> org.ops4j.pax.url.mvn.defaultRepositories or
> org.ops4j.pax.url.mvn.repositories.
>
> Could somebody advice me whether it makes sense to file bug reports for a),
> b) and/or c)? Depends a bit upon how "alive" the Karaf EIK project is (it's
> a great tool, an I wonder why these things haven't turned up earlier).
>
> Kind Regards,
> Jochen
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-EIK-how-to-configure-the-runtime-tp4037931p4038399.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Karaf EIK - how to configure the runtime?

Posted by jochenw <jo...@googlemail.com>.
I have solved problem c) now (ok, kind of): the default repositories are read
correctly, and also the features are resolved. However, when the list of
bundles for the target configuration is built, Karaf EIK only reads the
system and default folders, no additional repositories in Karaf's root
folder.

Adding something like:
KarafCorePluginUtils.getJarFileList(
               
karafPlatformModel.getRootDirectory().append("myrepo").toFile(),
                jarFiles,
                MAX_DIRECTORY_RECURSE_DEPTH);

in KarafLaunchUtils.java (function getJarDirectories) helps. Of course, this
is hard coding "myrepo", no generic resolution of repos defined in
org.ops4j.pax.url.mvn.defaultRepositories or
org.ops4j.pax.url.mvn.repositories.

Could somebody advice me whether it makes sense to file bug reports for a),
b) and/or c)? Depends a bit upon how "alive" the Karaf EIK project is (it's
a great tool, an I wonder why these things haven't turned up earlier).

Kind Regards,
Jochen



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-EIK-how-to-configure-the-runtime-tp4037931p4038399.html
Sent from the Karaf - User mailing list archive at Nabble.com.