Thanks,

But actually i already digged in, as far as i could, in the  
"org.xml.sax.SAXParseException: Content is not allowed in prolog." issue 
without results.

I explored the file using an hex-editor to search for bad character without 
success.

I also tried just copying your features file: 
apache-felix-karaf-1.6.0-features.xml instead of mine and i got the same result.

Also, as i said, i was able to correctly load my features.xml (exactly the 
same, just copied from a folder to another) file putting it in the deploy 
folder. That shouldn't mean the file is OK ?

In your forum link http://forums.sun.com/thread.jspa?threadID=465472 i also 
found: 

"Problem could be with file encoding OR the way file is read. Make sure you are 
specifying uncoding while reading file contents."

Do you know for sure that loading features using a features repository 
specified using the "file:" descriptor in the 
org.apache.felix.karaf.features.cfg file is working for karaf 1.6.0 ?

Thank you for any help !

Giacomo Coletta

-----Original Message-----
From: Charles Moulliard [mailto:[email protected]] 
Sent: Thursday, July 01, 2010 16:35
To: [email protected]
Subject: Re: Loading features to karaf using the file:C:/etc/etc URL mechanism

Hi,

You have a typo error or an undesired character appearing in the
header of the xml feature file :
http://forums.sun.com/thread.jspa?threadID=465472

Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.

KR,

Charles Moulliard

Senior Enterprise Architect (J2EE, .NET, SOA)
Apache Camel - ServiceMix Committer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Blog : http://cmoulliard.blogspot.com |  Twitter : http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype: cmoulliard



On Thu, Jul 1, 2010 at 4:27 PM, Coletta Giacomo, IT
<[email protected]> wrote:
>
> 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


Reply via email to