You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by "Coletta Giacomo, IT" <gi...@prysmian.com> on 2010/07/01 16:27:05 UTC

Loading features to karaf using the file:C:/etc/etc URL mechanism

> 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
> 

Re: Loading features to karaf using the file:C:/etc/etc URL mechanism

Posted by Charles Moulliard <cm...@gmail.com>.
Have you tried to copy paste / paste the content of the file in a new
file create using another editor tool ?
Sometimes that help.

Kind regards,

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 5:30 PM, Coletta Giacomo, IT
<gi...@prysmian.com> wrote:
> 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:cmoulliard@gmail.com]
> Sent: Thursday, July 01, 2010 16:35
> To: user@karaf.apache.org
> 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
> <gi...@prysmian.com> 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
>
>
>

RE: Loading features to karaf using the file:C:/etc/etc URL mechanism

Posted by "Coletta Giacomo, IT" <gi...@prysmian.com>.
The repository is added pointing to the directory, for bundles instead i point the .jar directly. I don't have a folder for any bundle like in Karaf system directory, just a few folders grouping several bundles.

Anyway pointing to the jars works if i put the features.xml in the deploy folder.

Thank you for your help !

Giacomo 

-----Original Message-----
From: Guillaume Nodet [mailto:gnodet@gmail.com] 
Sent: Thursday, July 01, 2010 19:12
To: user
Subject: Re: Loading features to karaf using the file:C:/etc/etc URL mechanism

Does your file url point to the file directly and not to the directory ?
I haven't tried to reproduce the issue, but i'll try tomorrow.

On Thu, Jul 1, 2010 at 18:00, Coletta Giacomo, IT
<gi...@prysmian.com> wrote:
> The encoding is UTF-8,
>
> I also tried writing a new file from scratch using eclipse, here is the file (see also attachement):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <features name="newfeatures" version="1.0.0">
>        <feature name="feature" version="1.0.0">
>                 <bundle>file:./base/bundles/third-party/com.springsource.javax.el-2.1.0.jar</bundle>
>        </feature>
> </features>
>
> The org.apache.felix.karaf.features.cfg entry is:
>
>  featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.6.0/xml/features,file:C:/DEV/karaf/base/features
>
> Unfortunatly the exception i get is always the same.
> I don't know what to do next with this.
>
> Giacomo
>
>
> -----Original Message-----
> From: Guillaume Nodet [mailto:gnodet@gmail.com]
> Sent: Thursday, July 01, 2010 17:33
> To: user
> Subject: Re: Loading features to karaf using the file:C:/etc/etc URL mechanism
>
> What is the encoding of your file ? Maybe if it is UTF-16 that could
> be a problem, not sure ...
>
> On Thu, Jul 1, 2010 at 17:30, Coletta Giacomo, IT
> <gi...@prysmian.com> wrote:
>> 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:cmoulliard@gmail.com]
>> Sent: Thursday, July 01, 2010 16:35
>> To: user@karaf.apache.org
>> 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
>> <gi...@prysmian.com> 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
>>
>>
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>
>
> ___________________________________________________________________________________
>
> AVVISO DI RISERVATEZZA
>
> Le informazioni contenute nella comunicazione che precede possono essere riservate e confidenziali e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La confidenzialità, sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Prysmian potrebbe avere nozione di tutti i messaggi di risposta e/o tutti gli allegati, alla/dalla stessa trasmessi e/o ricevuti. Qualora Lei non fosse la persona alla quale il presente messaggio è destinato, la invitiamo a non procedere ad alcun uso, distribuzione, copiatura od azione ad esso conseguente. Se avete ricevuto questo messaggio per errore La invitiamo ad eliminarlo dandocene gentilmente comunicazione rispondendo a questo messaggio oppure attraverso il "contact us" sul sito web http://www.prysmian.com/.
>
> ___________________________________________________________________________________
>
> CONFIDENTIALITY NOTICE
>
> This message and any attachment is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, confidential, legally privileged or otherwise exempt from disclosure. The security and integrity of e-mails can not be guaranteed. Any reply to this e-mail and any attachment received may be subject to Prysmian monitoring.
> If you are not the named addressee, you are not authorized to use, distribute, copy or take any action in reliance on this message. The unauthorized use, disclosure, or copying of this communication, or any attachment, is strictly prohibited and may be unlawful. No waiver of confidentiality or any applicable privilege is intended by any mistransmission. If you have received this message in error, please notify the sender immediately by replying to this e-mail or by going to our web-site http://www.prysmian.com/ on “contact us” and delete all copies of this message and any attachments.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

 
___________________________________________________________________________________
 
AVVISO DI RISERVATEZZA
 
Le informazioni contenute nella comunicazione che precede possono essere riservate e confidenziali e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La confidenzialità, sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Prysmian potrebbe avere nozione di tutti i messaggi di risposta e/o tutti gli allegati, alla/dalla stessa trasmessi e/o ricevuti. Qualora Lei non fosse la persona alla quale il presente messaggio è destinato, la invitiamo a non procedere ad alcun uso, distribuzione, copiatura od azione ad esso conseguente. Se avete ricevuto questo messaggio per errore La invitiamo ad eliminarlo dandocene gentilmente comunicazione rispondendo a questo messaggio oppure attraverso il “contact us” sul sito web http://www.prysmian.com/.

___________________________________________________________________________________
 
CONFIDENTIALITY NOTICE
 
This message and any attachment is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, confidential, legally privileged or otherwise exempt from disclosure. The security and integrity of e-mails can not be guaranteed. Any reply to this e-mail and any attachment received may be subject to Prysmian monitoring.
If you are not the named addressee, you are not authorized to use, distribute, copy or take any action in reliance on this message. The unauthorized use, disclosure, or copying of this communication, or any attachment, is strictly prohibited and may be unlawful. No waiver of confidentiality or any applicable privilege is intended by any mistransmission. If you have received this message in error, please notify the sender immediately by replying to this e-mail or by going to our web-site http://www.prysmian.com/ on “contact us” and delete all copies of this message and any attachments.


Re: Loading features to karaf using the file:C:/etc/etc URL mechanism

Posted by Guillaume Nodet <gn...@gmail.com>.
Does your file url point to the file directly and not to the directory ?
I haven't tried to reproduce the issue, but i'll try tomorrow.

On Thu, Jul 1, 2010 at 18:00, Coletta Giacomo, IT
<gi...@prysmian.com> wrote:
> The encoding is UTF-8,
>
> I also tried writing a new file from scratch using eclipse, here is the file (see also attachement):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <features name="newfeatures" version="1.0.0">
>        <feature name="feature" version="1.0.0">
>                 <bundle>file:./base/bundles/third-party/com.springsource.javax.el-2.1.0.jar</bundle>
>        </feature>
> </features>
>
> The org.apache.felix.karaf.features.cfg entry is:
>
>  featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.6.0/xml/features,file:C:/DEV/karaf/base/features
>
> Unfortunatly the exception i get is always the same.
> I don't know what to do next with this.
>
> Giacomo
>
>
> -----Original Message-----
> From: Guillaume Nodet [mailto:gnodet@gmail.com]
> Sent: Thursday, July 01, 2010 17:33
> To: user
> Subject: Re: Loading features to karaf using the file:C:/etc/etc URL mechanism
>
> What is the encoding of your file ? Maybe if it is UTF-16 that could
> be a problem, not sure ...
>
> On Thu, Jul 1, 2010 at 17:30, Coletta Giacomo, IT
> <gi...@prysmian.com> wrote:
>> 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:cmoulliard@gmail.com]
>> Sent: Thursday, July 01, 2010 16:35
>> To: user@karaf.apache.org
>> 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
>> <gi...@prysmian.com> 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
>>
>>
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>
>
> ___________________________________________________________________________________
>
> AVVISO DI RISERVATEZZA
>
> Le informazioni contenute nella comunicazione che precede possono essere riservate e confidenziali e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La confidenzialità, sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Prysmian potrebbe avere nozione di tutti i messaggi di risposta e/o tutti gli allegati, alla/dalla stessa trasmessi e/o ricevuti. Qualora Lei non fosse la persona alla quale il presente messaggio è destinato, la invitiamo a non procedere ad alcun uso, distribuzione, copiatura od azione ad esso conseguente. Se avete ricevuto questo messaggio per errore La invitiamo ad eliminarlo dandocene gentilmente comunicazione rispondendo a questo messaggio oppure attraverso il "contact us" sul sito web http://www.prysmian.com/.
>
> ___________________________________________________________________________________
>
> CONFIDENTIALITY NOTICE
>
> This message and any attachment is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, confidential, legally privileged or otherwise exempt from disclosure. The security and integrity of e-mails can not be guaranteed. Any reply to this e-mail and any attachment received may be subject to Prysmian monitoring.
> If you are not the named addressee, you are not authorized to use, distribute, copy or take any action in reliance on this message. The unauthorized use, disclosure, or copying of this communication, or any attachment, is strictly prohibited and may be unlawful. No waiver of confidentiality or any applicable privilege is intended by any mistransmission. If you have received this message in error, please notify the sender immediately by replying to this e-mail or by going to our web-site http://www.prysmian.com/ on “contact us” and delete all copies of this message and any attachments.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

RE: Loading features to karaf using the file:C:/etc/etc URL mechanism

Posted by "Coletta Giacomo, IT" <gi...@prysmian.com>.
Hi,

Yesssss!!

, you are right, now it's working also for me.

What seems to make the difference is specifying the features.xml file or not. 

featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.6.0/xml/features,file:./base/features/features.xml

Works, while

featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.6.0/xml/features,file:./base/features

Doesn't work and gives the "org.xml.sax.SAXParseException: Content is not allowed in prolog" exception.

And, by the way, on windows xp the first "." in file:./base/features/features.xml is necessary.

Many thanks !

Giacomo

-----Original Message-----
From: Charles Moulliard [mailto:cmoulliard@gmail.com] 
Sent: Friday, July 02, 2010 08:44
To: user@karaf.apache.org
Subject: Re: Loading features to karaf using the file:C:/etc/etc URL mechanism

Hi Coletta,

I have made a simple test with a config similar to your. And it works.

Here is my config file

1) features.file

<?xml version="1.0" encoding="UTF-8"?>
<features>
    <feature name="spring-web" version="2.5.6.SEC01">
       <bundle>file:base/bundles/spring-web-2.5.6.SEC01.jar</bundle>
    </feature>
</features>

2) org.apache.felix.karaf.features.cfg

featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.4.0/xml/features,mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.2.0/xml/features,mvn:org.apache.servicemix/apache-servicemix/4.2.0/xml/features,mvn:org.apache.camel.karaf/apache-camel/2.3.0/xml/features,file:base/features/features.xml

Here is what I have on the console


karaf@root> features:listUrl
mvn:org.apache.camel.karaf/apache-camel/2.2.0/xml/features
mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.2.0/xml/features
file:base/features/features.xml
mvn:org.apache.felix.karaf/apache-felix-karaf/1.4.0/xml/features
mvn:org.apache.servicemix/apache-servicemix/4.2.0/xml/features
mvn:org.apache.camel.karaf/apache-camel/2.3.0/xml/features

and I can install the feature

karaf@root> features:install spring-web

Remark base/features and base/bundles folders have created in the root
folder of apache-servicemix-4.2

Kind regards,

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 6:00 PM, Coletta Giacomo, IT
<gi...@prysmian.com> wrote:
> The encoding is UTF-8,
>
> I also tried writing a new file from scratch using eclipse, here is the file (see also attachement):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <features name="newfeatures" version="1.0.0">
>        <feature name="feature" version="1.0.0">
>                 <bundle>file:./base/bundles/third-party/com.springsource.javax.el-2.1.0.jar</bundle>
>        </feature>
> </features>
>
> The org.apache.felix.karaf.features.cfg entry is:
>
>  featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.6.0/xml/features,file:C:/DEV/karaf/base/features
>
> Unfortunatly the exception i get is always the same.
> I don't know what to do next with this.
>
> Giacomo
>
>
> -----Original Message-----
> From: Guillaume Nodet [mailto:gnodet@gmail.com]
> Sent: Thursday, July 01, 2010 17:33
> To: user
> Subject: Re: Loading features to karaf using the file:C:/etc/etc URL mechanism
>
> What is the encoding of your file ? Maybe if it is UTF-16 that could
> be a problem, not sure ...
>
> On Thu, Jul 1, 2010 at 17:30, Coletta Giacomo, IT
> <gi...@prysmian.com> wrote:
>> 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:cmoulliard@gmail.com]
>> Sent: Thursday, July 01, 2010 16:35
>> To: user@karaf.apache.org
>> 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
>> <gi...@prysmian.com> 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
>>
>>
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>
>
> ___________________________________________________________________________________
>
> AVVISO DI RISERVATEZZA
>
> Le informazioni contenute nella comunicazione che precede possono essere riservate e confidenziali e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La confidenzialità, sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Prysmian potrebbe avere nozione di tutti i messaggi di risposta e/o tutti gli allegati, alla/dalla stessa trasmessi e/o ricevuti. Qualora Lei non fosse la persona alla quale il presente messaggio è destinato, la invitiamo a non procedere ad alcun uso, distribuzione, copiatura od azione ad esso conseguente. Se avete ricevuto questo messaggio per errore La invitiamo ad eliminarlo dandocene gentilmente comunicazione rispondendo a questo messaggio oppure attraverso il "contact us" sul sito web http://www.prysmian.com/.
>
> ___________________________________________________________________________________
>
> CONFIDENTIALITY NOTICE
>
> This message and any attachment is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, confidential, legally privileged or otherwise exempt from disclosure. The security and integrity of e-mails can not be guaranteed. Any reply to this e-mail and any attachment received may be subject to Prysmian monitoring.
> If you are not the named addressee, you are not authorized to use, distribute, copy or take any action in reliance on this message. The unauthorized use, disclosure, or copying of this communication, or any attachment, is strictly prohibited and may be unlawful. No waiver of confidentiality or any applicable privilege is intended by any mistransmission. If you have received this message in error, please notify the sender immediately by replying to this e-mail or by going to our web-site http://www.prysmian.com/ on “contact us” and delete all copies of this message and any attachments.
>

 
___________________________________________________________________________________
 
AVVISO DI RISERVATEZZA
 
Le informazioni contenute nella comunicazione che precede possono essere riservate e confidenziali e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La confidenzialità, sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Prysmian potrebbe avere nozione di tutti i messaggi di risposta e/o tutti gli allegati, alla/dalla stessa trasmessi e/o ricevuti. Qualora Lei non fosse la persona alla quale il presente messaggio è destinato, la invitiamo a non procedere ad alcun uso, distribuzione, copiatura od azione ad esso conseguente. Se avete ricevuto questo messaggio per errore La invitiamo ad eliminarlo dandocene gentilmente comunicazione rispondendo a questo messaggio oppure attraverso il “contact us” sul sito web http://www.prysmian.com/.

___________________________________________________________________________________
 
CONFIDENTIALITY NOTICE
 
This message and any attachment is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, confidential, legally privileged or otherwise exempt from disclosure. The security and integrity of e-mails can not be guaranteed. Any reply to this e-mail and any attachment received may be subject to Prysmian monitoring.
If you are not the named addressee, you are not authorized to use, distribute, copy or take any action in reliance on this message. The unauthorized use, disclosure, or copying of this communication, or any attachment, is strictly prohibited and may be unlawful. No waiver of confidentiality or any applicable privilege is intended by any mistransmission. If you have received this message in error, please notify the sender immediately by replying to this e-mail or by going to our web-site http://www.prysmian.com/ on “contact us” and delete all copies of this message and any attachments.


Re: Loading features to karaf using the file:C:/etc/etc URL mechanism

Posted by Charles Moulliard <cm...@gmail.com>.
Hi Coletta,

I have made a simple test with a config similar to your. And it works.

Here is my config file

1) features.file

<?xml version="1.0" encoding="UTF-8"?>
<features>
    <feature name="spring-web" version="2.5.6.SEC01">
       <bundle>file:base/bundles/spring-web-2.5.6.SEC01.jar</bundle>
    </feature>
</features>

2) org.apache.felix.karaf.features.cfg

featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.4.0/xml/features,mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.2.0/xml/features,mvn:org.apache.servicemix/apache-servicemix/4.2.0/xml/features,mvn:org.apache.camel.karaf/apache-camel/2.3.0/xml/features,file:base/features/features.xml

Here is what I have on the console


karaf@root> features:listUrl
mvn:org.apache.camel.karaf/apache-camel/2.2.0/xml/features
mvn:org.apache.servicemix.nmr/apache-servicemix-nmr/1.2.0/xml/features
file:base/features/features.xml
mvn:org.apache.felix.karaf/apache-felix-karaf/1.4.0/xml/features
mvn:org.apache.servicemix/apache-servicemix/4.2.0/xml/features
mvn:org.apache.camel.karaf/apache-camel/2.3.0/xml/features

and I can install the feature

karaf@root> features:install spring-web

Remark base/features and base/bundles folders have created in the root
folder of apache-servicemix-4.2

Kind regards,

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 6:00 PM, Coletta Giacomo, IT
<gi...@prysmian.com> wrote:
> The encoding is UTF-8,
>
> I also tried writing a new file from scratch using eclipse, here is the file (see also attachement):
>
> <?xml version="1.0" encoding="UTF-8"?>
> <features name="newfeatures" version="1.0.0">
>        <feature name="feature" version="1.0.0">
>                 <bundle>file:./base/bundles/third-party/com.springsource.javax.el-2.1.0.jar</bundle>
>        </feature>
> </features>
>
> The org.apache.felix.karaf.features.cfg entry is:
>
>  featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.6.0/xml/features,file:C:/DEV/karaf/base/features
>
> Unfortunatly the exception i get is always the same.
> I don't know what to do next with this.
>
> Giacomo
>
>
> -----Original Message-----
> From: Guillaume Nodet [mailto:gnodet@gmail.com]
> Sent: Thursday, July 01, 2010 17:33
> To: user
> Subject: Re: Loading features to karaf using the file:C:/etc/etc URL mechanism
>
> What is the encoding of your file ? Maybe if it is UTF-16 that could
> be a problem, not sure ...
>
> On Thu, Jul 1, 2010 at 17:30, Coletta Giacomo, IT
> <gi...@prysmian.com> wrote:
>> 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:cmoulliard@gmail.com]
>> Sent: Thursday, July 01, 2010 16:35
>> To: user@karaf.apache.org
>> 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
>> <gi...@prysmian.com> 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
>>
>>
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>
>
> ___________________________________________________________________________________
>
> AVVISO DI RISERVATEZZA
>
> Le informazioni contenute nella comunicazione che precede possono essere riservate e confidenziali e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La confidenzialità, sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Prysmian potrebbe avere nozione di tutti i messaggi di risposta e/o tutti gli allegati, alla/dalla stessa trasmessi e/o ricevuti. Qualora Lei non fosse la persona alla quale il presente messaggio è destinato, la invitiamo a non procedere ad alcun uso, distribuzione, copiatura od azione ad esso conseguente. Se avete ricevuto questo messaggio per errore La invitiamo ad eliminarlo dandocene gentilmente comunicazione rispondendo a questo messaggio oppure attraverso il "contact us" sul sito web http://www.prysmian.com/.
>
> ___________________________________________________________________________________
>
> CONFIDENTIALITY NOTICE
>
> This message and any attachment is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, confidential, legally privileged or otherwise exempt from disclosure. The security and integrity of e-mails can not be guaranteed. Any reply to this e-mail and any attachment received may be subject to Prysmian monitoring.
> If you are not the named addressee, you are not authorized to use, distribute, copy or take any action in reliance on this message. The unauthorized use, disclosure, or copying of this communication, or any attachment, is strictly prohibited and may be unlawful. No waiver of confidentiality or any applicable privilege is intended by any mistransmission. If you have received this message in error, please notify the sender immediately by replying to this e-mail or by going to our web-site http://www.prysmian.com/ on “contact us” and delete all copies of this message and any attachments.
>

RE: Loading features to karaf using the file:C:/etc/etc URL mechanism

Posted by "Coletta Giacomo, IT" <gi...@prysmian.com>.
The encoding is UTF-8,

I also tried writing a new file from scratch using eclipse, here is the file (see also attachement):

<?xml version="1.0" encoding="UTF-8"?>
<features name="newfeatures" version="1.0.0">
	<feature name="feature" version="1.0.0">
		 <bundle>file:./base/bundles/third-party/com.springsource.javax.el-2.1.0.jar</bundle>
	</feature>
</features>

The org.apache.felix.karaf.features.cfg entry is:

  featuresRepositories=mvn:org.apache.felix.karaf/apache-felix-karaf/1.6.0/xml/features,file:C:/DEV/karaf/base/features

Unfortunatly the exception i get is always the same.
I don't know what to do next with this.

Giacomo


-----Original Message-----
From: Guillaume Nodet [mailto:gnodet@gmail.com] 
Sent: Thursday, July 01, 2010 17:33
To: user
Subject: Re: Loading features to karaf using the file:C:/etc/etc URL mechanism

What is the encoding of your file ? Maybe if it is UTF-16 that could
be a problem, not sure ...

On Thu, Jul 1, 2010 at 17:30, Coletta Giacomo, IT
<gi...@prysmian.com> wrote:
> 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:cmoulliard@gmail.com]
> Sent: Thursday, July 01, 2010 16:35
> To: user@karaf.apache.org
> 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
> <gi...@prysmian.com> 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
>
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

 
___________________________________________________________________________________
 
AVVISO DI RISERVATEZZA
 
Le informazioni contenute nella comunicazione che precede possono essere riservate e confidenziali e sono, comunque, destinate esclusivamente alla persona o all'ente sopraindicati. La confidenzialità, sicurezza e la correttezza dei messaggi di posta elettronica non possono essere garantite. Prysmian potrebbe avere nozione di tutti i messaggi di risposta e/o tutti gli allegati, alla/dalla stessa trasmessi e/o ricevuti. Qualora Lei non fosse la persona alla quale il presente messaggio è destinato, la invitiamo a non procedere ad alcun uso, distribuzione, copiatura od azione ad esso conseguente. Se avete ricevuto questo messaggio per errore La invitiamo ad eliminarlo dandocene gentilmente comunicazione rispondendo a questo messaggio oppure attraverso il "contact us" sul sito web http://www.prysmian.com/.

___________________________________________________________________________________
 
CONFIDENTIALITY NOTICE
 
This message and any attachment is intended exclusively for the individual or entity to which it is addressed. This communication may contain information that is proprietary, confidential, legally privileged or otherwise exempt from disclosure. The security and integrity of e-mails can not be guaranteed. Any reply to this e-mail and any attachment received may be subject to Prysmian monitoring.
If you are not the named addressee, you are not authorized to use, distribute, copy or take any action in reliance on this message. The unauthorized use, disclosure, or copying of this communication, or any attachment, is strictly prohibited and may be unlawful. No waiver of confidentiality or any applicable privilege is intended by any mistransmission. If you have received this message in error, please notify the sender immediately by replying to this e-mail or by going to our web-site http://www.prysmian.com/ on “contact us” and delete all copies of this message and any attachments.

Re: Loading features to karaf using the file:C:/etc/etc URL mechanism

Posted by Guillaume Nodet <gn...@gmail.com>.
What is the encoding of your file ? Maybe if it is UTF-16 that could
be a problem, not sure ...

On Thu, Jul 1, 2010 at 17:30, Coletta Giacomo, IT
<gi...@prysmian.com> wrote:
> 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:cmoulliard@gmail.com]
> Sent: Thursday, July 01, 2010 16:35
> To: user@karaf.apache.org
> 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
> <gi...@prysmian.com> 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
>
>
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

RE: Loading features to karaf using the file:C:/etc/etc URL mechanism

Posted by "Coletta Giacomo, IT" <gi...@prysmian.com>.
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:cmoulliard@gmail.com] 
Sent: Thursday, July 01, 2010 16:35
To: user@karaf.apache.org
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
<gi...@prysmian.com> 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



Re: Loading features to karaf using the file:C:/etc/etc URL mechanism

Posted by Charles Moulliard <cm...@gmail.com>.
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
<gi...@prysmian.com> 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