Hi Andreas
What seems happening is that when one provisions a feature file
usingscanFeatures() then this gets added the "featuresBoot"
in etc/org.apache.karaf.features.cfg
On the other hand, when one provisions a bundle using mavenBundle()
the jar simply getsthrown into the "deploy" folder. As this is done early on,
these bundles are picked up by DirectoryWatcher and resolving starts, way
before anything these bundles need (required packages) gets installed.
This results in tons of
"org.osgi.framework.BundleException: Unresolved constraint in bundle"
exceptions printed to the console (a bit surprising this exception
is not caught and sanitized).
A solution I found is to configure useDeployFolder(false)
Then the bundles get added to the examfeatures.xml file mentioned earlier
and Karaf startup suddenly becomes much saner, the exceptions are gone,
and generally a warm and fuzzy feeling pervades.
Martin
>________________________________
> From: Andreas Pieber <anpie...@gmail.com>
>To: Martin Lichtin <lich...@yahoo.com>; General OPS4J
><general@lists.ops4j.org>
>Sent: Tuesday, August 7, 2012 3:31 PM
>Subject: Re: Bundle vs features installation order
>
>Hey Martin,
>
>Basically it's not really possible to add an order to those additions
>(features & bundles). Only option I have is to basically add ALL
>bundles first and then the features or start all features first; not
>sure if you can say which is the better solution. Independently you
>still have quite an effective option to gurantee that all your
>features are installed first: use the
>KarafDistributionConfigurationFileExtendOption [1] to add your
>features.xml and the feature to the startup features. If the
>documentation is not sufficient for your needs there's almost for
>every feature an integration test available showing it's usage in code
>[2].
>
>I hope this helps; If not feel free to ping again on this list :-)
>
>Kind regards,
>Andreas
>
>[1] https://github.com/openengsb/labs-paxexam-karaf/wiki/Commands
>[2]
>https://github.com/openengsb/labs-paxexam-karaf/tree/master/regression/src/test/java/org/openengsb/labs/paxexam/karaf/regression
>
>On Tue, Aug 7, 2012 at 10:43 AM, Martin Lichtin <lich...@yahoo.com> wrote:
>> Hi
>> I'm a first-time user of Pax-Exam (in fact paxexam-karaf-container), so bear
>> with me..
>> The problem I have with a configuration like
>>
>> karafDistributionConfiguration().frameworkUrl(
>>
>> maven().groupId("org.apache.karaf").artifactId("apache-karaf").type("zip").versionAsInProject()).
>> karafVersion("2.2.8").name("Apache Karaf").unpackDirectory(new
>> File("target/paxexam/")),
>> logLevel(LogLevel.INFO), keepRuntimeFolder(),
>> configureConsole().startRemoteShell(),
>> provision(
>> scanFeatures("file:../../classes/features.xml",
>> "tx-ref-itests"),
>> mavenBundle("ch.bbp.fmp.sandbox.tx-reference",
>> "tx-ref-xa"),
>> mavenBundle("ch.bbp.fmp.sandbox.tx-reference",
>> "tx-ref-consume"),
>> mavenBundle("ch.bbp.fmp.sandbox.tx-reference",
>> "tx-ref-work"),
>> mavenBundle("ch.bbp.fmp.sandbox.tx-reference",
>> "tx-ref-produce")
>> )
>>
>> is that the features file is always loaded last, regardless of its position
>> in the provision() list.
>> I also tried setting a high startlevel (99 or so) for the bundles, but it
>> had no effect.
>> (The features file should be installed first, it contains a lot of
>> prerequisite bundles).
>>
>> Any hints on how the provisioning is done under the hoods of Pax-Exam?
>>
>>
>> _______________________________________________
>> general mailing list
>> general@lists.ops4j.org
>> http://lists.ops4j.org/mailman/listinfo/general
>>
>
>
>
_______________________________________________
general mailing list
general@lists.ops4j.org
http://lists.ops4j.org/mailman/listinfo/general