>>>>> Steinar Bang <s...@dod.no>:

>> Best to add the feature repository in your own feature and declare a
>> feature dependency to it. [1]
>> [1] - 
>> https://github.com/ANierbeck/Karaf-Vertx/blob/master/Vertx-Microservices/Vertx-Microservices-Features/src/main/feature/feature.xml#L21
>> [2] - https://ops4j1.jira.com/wiki/display/PAXJDBC/Documentation

> Ok, will try.

> But I'm still curious why running karaf in the integration tests is
> different to actually running in karaf..? :-)

I added pax-jdbc feature repository to the feature template file of my
db feature, ie. 
https://github.com/steinarb/ukelonn/blob/using-vaadin/ukelonn.bundle.test.db/src/main/feature/feature.xml

The resulting feature file built by maven looks like this:
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0"; 
name="ukelonn.bundle.test.db">
     
<repository>mvn:org.ops4j.pax.jdbc/pax-jdbc-features/0.9.0/xml/features</repository>
     
<repository>mvn:no.priv.bang.ukelonn/ukelonn.api/1.0.0-SNAPSHOT/xml/features</repository>
     <feature name="ukelonn-db-derby-test" description="Ukelonn webapp derby 
test database OSGi bundle" version="1.0.0.SNAPSHOT">
         <feature prerequisite="false" dependency="false">pax-jdbc</feature>
         <feature prerequisite="false" 
dependency="false">pax-jdbc-derby</feature>
         <feature version="1.0.0.SNAPSHOT" prerequisite="false" 
dependency="false">ukelonn-api</feature>
         <bundle 
start-level="80">mvn:no.priv.bang.ukelonn/ukelonn.bundle.test.db/1.0.0-SNAPSHOT</bundle>
     </feature>
 </features>

However I still get the same error on the pax exam karaf startup:
2017-04-15 11:08:35,327 | ERROR | pool-6-thread-1  | BootFeaturesInstaller      
      | 6 - org.apache.karaf.features.core - 4.0.7 | Error installing boot 
features
org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing 
requirement [root] osgi.identity; osgi.identity=ukelonn-db-derby-test; 
type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; 
filter:="(&(osgi.identity=ukelonn-db-derby-test)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))"
 [caused by: Unable to resolve ukelonn-db-derby-test/1.0.0.SNAPSHOT: missing 
requirement [ukelonn-db-derby-test/1.0.0.SNAPSHOT] osgi.identity; 
osgi.identity=pax-jdbc; type=karaf.feature]
        at 
org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)[6:org.apache.karaf.features.core:4.0.7]
        at 
org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:235)[6:org.apache.karaf.features.core:4.0.7]
        at 
org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:158)[6:org.apache.karaf.features.core:4.0.7]
        at 
org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)[6:org.apache.karaf.features.core:4.0.7]
        at 
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)[6:org.apache.karaf.features.core:4.0.7]
        at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1176)[6:org.apache.karaf.features.core:4.0.7]
        at 
org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1074)[6:org.apache.karaf.features.core:4.0.7]
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_121]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_121]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_121]
        at java.lang.Thread.run(Thread.java:745)[:1.8.0_121]
[SUREFIRE] std/in stream corrupted
java.io.IOException: Command NOOP unexpectedly read Void data with length 4.
        at 
org.apache.maven.surefire.booter.MasterProcessCommand.decode(MasterProcessCommand.java:139)
        at 
org.apache.maven.surefire.booter.CommandReader$CommandRunnable.run(CommandReader.java:360)
        at java.lang.Thread.run(Thread.java:745)

Also there is a java process left running when the test completes with
error, so there is some cleanup missing from the test setup (I have to
kill that process to be allowed to run the test again. If not, windows
file locking prevents "mvn clean" from deleting the target/exam
directory structure).  

I'm studying the examples to try to figure out what I've missed.

Reply via email to