Hi,
I'm trying to integrate my OSGI application with Karaf 1.6.0 (windows xp
environment) and tryng to find a way to create a custom distribution.
I don't use Maven.
I was able to succesfully use the features mechanism putting my features.xml
file in the deploy directory. In the features.xml file bundles are retrieved
using relative file:./xxx/yyy paths. In this way features are automatically
installed.
Then i tried putting the features.xml file in a different folder and to add a
features repository in org.apache.felix.karaf.features.cfg, here is how the
addition loooks:
featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.6.0/xml/features,file:./base/features
or
featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.6.0/xml/features,file:C:/DEV/karaf/base/features
And all possible variations( file:///C:/, file:///C|/ etc.)
When the file path seem to be correct i get the following exception:
14:34:51,203 | WARN | rint Extender: 3 | FeaturesServiceImpl |
res.internal.FeaturesServiceImpl 654 | 23 -
org.apache.felix.karaf.features.core - 1.6.0 | Unable to add features
repository file:./base/features at startup
java.io.IOException
at
org.apache.felix.karaf.features.internal.RepositoryImpl.load(RepositoryImpl.java:164)
at
org.apache.felix.karaf.features.internal.FeaturesServiceImpl.internalAddRepository(FeaturesServiceImpl.java:172)
at
org.apache.felix.karaf.features.internal.FeaturesServiceImpl.start(FeaturesServiceImpl.java:652)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:230)
at
org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:803)
at
org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:580)
at
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:693)
at
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
at
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)
at
org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:147)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:624)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:315)
at
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:213)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:207)
at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:239)
at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
at
org.apache.felix.karaf.features.internal.RepositoryImpl.load(RepositoryImpl.java:93)
... 24 more
It seem like if the file path is correct but there is something wrong with the
file. The fact is that the file is exactly the same that was before succesfully
loaded by putting it in the deploy folder (tried several times).
Does anybody succesfully loaded features adding a local features repository
using the file: mechanism ? The Karaf manual says it is possible.
Many thanks for any help
Giacomo Coletta