ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | oscar List | April 2005 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [oscar] Get a ressource from another bundle


Now, I believe, you need to refer to the message thread that Michel pointed out...

More than likely, the XML parser is converting the URL into a string, then back into a URL. This is a problem, since only Oscar can create URLs with the protocol "bundle:". Thus, you will need to use the URL Hanlders service.

As an aside for everyone else, I believe that the way "bundle:" URLs will be handled is going to change in the next verion of the OSGi spec. Then, it will be mandated that these URLs can be constructed from a string (I think), so this issue may go away once and for all.

-> richard

Brahim Ait elhaj wrote:

Ok
here is the issue of the problem in fact it works fine but i have another problem

BundleA contains method :
public URL getXmlFileUrl(){ return context.getBundle().getResource(XML_FILE);
    }

BundleB  calls this method to get the url :
URL xmlTaskDescriptionFileUrl = taskSetSvc.getXmlFileUrl();
System.out.println("[Boss] xmlTaskDescriptionFileUrl = "+xmlTaskDescriptionFileUrl);

Here is the output :
[Boss] xmlTaskDescriptionFileUrl   = bundle://15.0/pitask.xml

Then this url is passed to another bundle Dom4jService (a simple dom4j wrapper) TaskDescription [] descs = dom4jSvc.createDescriptions(xmlTaskDescriptionFileUrl); //this methode parse the xml file ....

Here is the output :
org.dom4j.DocumentException: /home/smac/aitelhab/Doom/Oscar/bundle:/15.0/pitask.xml (No such file or directory) Nested exception: /home/smac/aitelhab/Doom/Oscar/bundle:/15.0/pitask.xml (No such file or directory) //The problem is here
        at org.dom4j.io.SAXReader.read(SAXReader.java:353)
        at org.dom4j.io.SAXReader.read(SAXReader.java:236)
        at doom.dom4jservice.Dom4jImpl.parse(Dom4jImpl.java:78)
at doom.dom4jservice.Dom4jImpl.createDescriptions(Dom4jImpl.java:89)
        .....................................

In fact the url was not null but how can i give to my "Dom4jService" to be correctly interpreted ...
Thanks




<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.