Resource doesn't exist… but it does
Monday, 22 October 2012 · 5 messages · last reply 24 Oct 2012
IL
Quoted text · France Baril · 11 lines
On 2012-10-22 22:05, France Baril wrote: > Hi, > > I get this error on a db:retrieve: > > Stopped at line 175, column 119 in > /Users/archie/BaseXHTTP/How2_StaticHTML.xqm: > [FODC0002] Resource > 'http:/localhost:8984/rest/ImagesAndGlobalContent/global/i_app_available.png' > does not exist. >
Noticing that there is only one slash after 'http:' in the purported URI.
FB
France Baril23 Oct 2012 00:05 #
Hi,
I get this error on a db:retrieve:
Stopped at line 175, column 119 in
Quoted text · 4 lines
> /Users/archie/BaseXHTTP/How2_StaticHTML.xqm: > [FODC0002] Resource > 'http:/localhost:8984/rest/ImagesAndGlobalContent/global/i_app_available.png' > does not exist.
If I copy and paste the path to the .png from the error message into the browser's address, the image is displayed. So the path is correct, and the image seems retrievable.
What could possibly cause this error? Note that this used to work… I have not changed line 175 in many weeks.
--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
(514) 572-0341
FB
Interesting, but my line leaves no control over the double //: *
*
*let* *$db-image* := *db:retrieve*('ImagesAndGlobalContent', * substring-after*(*$x*/*text*(), 'images/'))
Other detail:
- Database correctly has all images as raw content.
Quoted text · le-tex · 25 lines
On Mon, Oct 22, 2012 at 5:32 PM, Imsieke, Gerrit, le-tex < gerrit.imsieke at le-tex.de> wrote: > > > On 2012-10-22 22:05, France Baril wrote: > >> Hi, >> >> I get this error on a db:retrieve: >> >> Stopped at line 175, column 119 in >> /Users/archie/BaseXHTTP/How2_**StaticHTML.xqm: >> [FODC0002] Resource >> 'http:/localhost:8984/rest/**ImagesAndGlobalContent/global/** >> i_app_available.png' >> does not exist. >> >> > Noticing that there is only one slash after 'http:' in the purported URI. > > ______________________________**_________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-**konstanz.de <BaseX-Talk at mailman.uni-konstanz.de> > https://mailman.uni-konstanz.**de/mailman/listinfo/basex-talk<https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk> >
--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
(514) 572-0341
CG
Christian Grün24 Oct 2012 13:04 #
Dear France,
some questions:
– you mentioned that your code used to work before; have you done any updates, or do you have any other indication that caused the potential bug?
– have you tried to restart the server/services?
– how does your full XQuery (or, better, the snippet that builds the request) look like?
– what do you get when adding a trace()? E.g. like this..
trace(substring-after($x/text(), 'images/'), "")
Looking at the error feedback, I'm wondering that "http..." and "rest" is contained in the retrieved URI; I would have expected a simple relative location, such as
"/ImagesAndGlobalContent/global/i_app_available.png" (but I guess I need to know more about how the query string is built).
Christian
Quoted text · France Baril · 50 lines
> Interesting, but my line leaves no control over the double //: > > let $db-image := db:retrieve('ImagesAndGlobalContent', > substring-after($x/text(), 'images/')) > > Other detail: > > Database correctly has all images as raw content. > > > On Mon, Oct 22, 2012 at 5:32 PM, Imsieke, Gerrit, le-tex > <gerrit.imsieke at le-tex.de> wrote: >> >> >> >> On 2012-10-22 22:05, France Baril wrote: >>> >>> Hi, >>> >>> I get this error on a db:retrieve: >>> >>> Stopped at line 175, column 119 in >>> /Users/archie/BaseXHTTP/How2_StaticHTML.xqm: >>> [FODC0002] Resource >>> >>> 'http:/localhost:8984/rest/ImagesAndGlobalContent/global/i_app_available.png' >>> does not exist. >>> >> >> Noticing that there is only one slash after 'http:' in the purported URI. >> >> _______________________________________________ >> BaseX-Talk mailing list >> BaseX-Talk at mailman.uni-konstanz.de >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > > > > -- > France Baril > Architecte documentaire / Documentation architect > france.baril at architextus.com > (514) 572-0341 > > _______________________________________________ > BaseX-Talk mailing list > BaseX-Talk at mailman.uni-konstanz.de > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk >
FB
France Baril24 Oct 2012 22:23 #
Hi,
The db:retrieve function was in fact being past a full rest query. At first, I didn't think of looking for this error because the value passed in the error message was getting me result when copied in the browser's address bar. I kept thinking: Dear BaseX, if you can resolve the address properly, why can't you just grab the image at the given address? Oh well, now that I am feeding it proper paths, it does grad the image.
Thank you!
On Wed, Oct 24, 2012 at 7:04 AM, Christian Grün
<christian.gruen at gmail.com>wrote:
Quoted text · Christian Grün · 78 lines
> Dear France, > > some questions: > > – you mentioned that your code used to work before; have you done any > updates, or do you have any other indication that caused the potential > bug? > > – have you tried to restart the server/services? > > – how does your full XQuery (or, better, the snippet that builds the > request) look like? > > – what do you get when adding a trace()? E.g. like this.. > trace(substring-after($x/text(), 'images/'), "") > > Looking at the error feedback, I'm wondering that "http..." and "rest" > is contained in the retrieved URI; I would have expected a simple > relative location, such as > "/ImagesAndGlobalContent/global/i_app_available.png" (but I guess I > need to know more about how the query string is built). > > Christian > ___________________________ > > > Interesting, but my line leaves no control over the double //: > > > > let $db-image := db:retrieve('ImagesAndGlobalContent', > > substring-after($x/text(), 'images/')) > > > > Other detail: > > > > Database correctly has all images as raw content. > > > > > > On Mon, Oct 22, 2012 at 5:32 PM, Imsieke, Gerrit, le-tex > > <gerrit.imsieke at le-tex.de> wrote: > >> > >> > >> > >> On 2012-10-22 22:05, France Baril wrote: > >>> > >>> Hi, > >>> > >>> I get this error on a db:retrieve: > >>> > >>> Stopped at line 175, column 119 in > >>> /Users/archie/BaseXHTTP/How2_StaticHTML.xqm: > >>> [FODC0002] Resource > >>> > >>> > 'http:/localhost:8984/rest/ImagesAndGlobalContent/global/i_app_available.png' > >>> does not exist. > >>> > >> > >> Noticing that there is only one slash after 'http:' in the purported > URI. > >> > >> _______________________________________________ > >> BaseX-Talk mailing list > >> BaseX-Talk at mailman.uni-konstanz.de > >> https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > > > > > > > > > -- > > France Baril > > Architecte documentaire / Documentation architect > > france.baril at architextus.com > > (514) 572-0341 > > > > _______________________________________________ > > BaseX-Talk mailing list > > BaseX-Talk at mailman.uni-konstanz.de > > https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk > > >
--
France Baril
Architecte documentaire / Documentation architect
france.baril at architextus.com
(514) 572-0341
Written for BaseX 7.3. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery