cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Patricia Déchandol <pdechan...@ajlsm.com>
Subject Re: Problem with query in Cocoon
Date Thu, 22 Mar 2012 10:13:47 GMT
Yeah !!!
My problem is resolved… the only problem is that I don't know exactly how !!!
I change the place of my pipeline (another site map), declared many things in my sitemap.
When the error occurred, it seems that the pipeline called whas interacting with another one
provocating the error.
Now I can call the query generated page and get the xml result.

Thanks for your help Robby.

Patricia


Le 22 mars 2012 à 09:50, Patricia Déchandol a écrit :

> 
> Le 22 mars 2012 à 09:44, Robby Pelssers a écrit :
> 
>> Ok.  If you would have dropped that code base on my shoulders I would do following
checks:
>>  
>> 1) Check if that @src for the xquery generator picks up that file correctly. Easiest
way would be to just replace the original pattern with this
>>  
>> <map:match pattern="**/get-children-rubriques.xml">
>>   <map:read src="xq/get-children-rubriques.xq"/>
>> </map:match>
> 
> Yes, I'll try this immediately.
> 
>>  
>> 2) Next I would check if there was any other pattern also using the xquery generator
that actually works.  If it’s in the same sitemap, you already know that the generator is
configured correctly.
> 
> This pattern is the first time in the project I try to use xquery. So I can't check this
point.
> 
>> 3) Definitely try out the query from some XML DB tool   (I know there are a few for
Sedna, so there must be also for Exist probably).  Or you just paste that query in the exist
play ground web app
> 
> The query is OK. I checked it executing it directly on my eXist client server.
> 
>> 4) the logs are of course very important but I don’t see any connectivity issue
or authentication error
> 
> The Tomcat and application logs don't see any trace.
> 
> Thanks Robby. Keep on touch about this.
> 
> Patricia
> 
>>  
>> Robby
>>  
>>  
>> From: Patricia Déchandol [mailto:pdechandol@ajlsm.com] 
>> Sent: Thursday, March 22, 2012 9:31 AM
>> To: users@cocoon.apache.org
>> Subject: Re: Problem with query in Cocoon
>>  
>> Yes, that's exactly what you understood.
>> I tested with a simplified query.
>> I guessed that the resulting xml if malformed, that's why I tested with "<records><records/>"
only response.
>> So I wonder if the problem may be in my sitemap in the called pipeline.
>> But I can't see error.
>>  
>> I go on thinking about it.
>> Will give you news if I have another idea !
>>  
>> Patricia
>>  
>> Le 22 mars 2012 à 09:24, Robby Pelssers a écrit :
>> 
>> 
>> The error message seems obvious although my French is a bit out of date ;-)
>>  
>> The query does not return xml and hence you run into this exception.  I also noticed
you set a parent-id parameter but it’s not used in your query. I guess that’s because
you simplified the xquery.  As I can’t test for you if that xquery does indeed return a
valid XML result it’s a bit hard to pinpoint the exact issue.  The only sensible thing to
do is to first write a
>> parameterless xquery and make sure it returns results.  Next try that same xquery
with the xquery generator.  But from the looks of it you already tried this?!
>>  
>> Robby
>>  
>> From: Patricia Déchandol [mailto:pdechandol@ajlsm.com] 
>> Sent: Thursday, March 22, 2012 9:14 AM
>> To: users@cocoon.apache.org
>> Subject: Re: Problem with query in Cocoon
>>  
>> Thanks Robby
>> I will try it but I have already tried this :
>>  
>> xquery version "1.0";
>> (: $Id: get-children-rubriques.xq 12373 2008-10-15 14:41:34Z pdechandol $ :)
>>  
>> (:     XQuery qui retourne la collection de notices Bmgexporub liée à une notice
parent :)
>>  
>> let $rubriques := fn:collection('Bmgexporub')/record[lien_rubrique_parent='Bmgexporub-0000002']
>> return
>> <records>
>> </records>
>>  
>> and it failed with the same error.
>>  
>> I wonder if it's the .xq which makes problem or something somewhere else in cocoon.
>> My xquery gives results when I execute it from eXist graphic java client.
>>  
>> Patricia
>>  
>>  
>> Le 22 mars 2012 à 09:08, Robby Pelssers a écrit :
>> 
>> 
>> 
>> You might give this a try:
>>  
>> xquery version "1.0";
>> (: $Id: get-children-rubriques.xq 12373 2008-10-15 14:41:34Z pdechandol $ :)
>>  
>> (:     XQuery qui retourne la collection de notices Bmgexporub liée à une notice
parent :)
>>  
>> let $rubriques := fn:collection('Bmgexporub')/record[lien_rubrique_parent='Bmgexporub-0000002']
>> return
>> <records>
>>   {
>>     for $rubrique in $rubriques
>>     return $rubrique
>>   }
>> </records>
>>  
>> Robby
>>  
>>  
>> From: Patricia Déchandol [mailto:pdechandol@ajlsm.com] 
>> Sent: Wednesday, March 21, 2012 12:22 PM
>> To: users@cocoon.apache.org
>> Subject: Problem with query in Cocoon
>>  
>> Hi everybody,
>>  
>> new problem !
>>  
>> I try to execute query from cocoon
>>  
>> I declared a xquery generator in my sitemap :
>>  
>> <map:generator name="xquery" logger="sitemap.generator.xquery" src="org.exist.cocoon.XQueryGenerator"
>>        collection="xmldb:exist://localhost:8899/exist/xmlrpc/db"
>>        user="admin"
>>        password="admin"
>>        create-session="false"
>>        expand-xincludes="false"
>>        authen=""
>>        cache-validity="-1"
>>                      />
>>  
>> I match a pattern corresponding :
>>  
>> <map:match pattern="**/get-children-rubriques.xml">
>>        <map:generate type="xquery" src="xq/get-children-rubriques.xq">
>>               <map:parameter name="parentid" value="{request-param:parentid}"/>
>>        </map:generate>
>>        <map:serialize type="xml"/>
>>        </map:match>
>>  
>> I prepared the following .xq:
>>  
>> xquery version "1.0";
>> (: $Id: get-children-rubriques.xq 12373 2008-10-15 14:41:34Z pdechandol $ :)
>>  
>> (:     XQuery qui retourne la collection de notices Bmgexporub liée à une notice
parent :)
>>  
>> let $rubriques := fn:collection('Bmgexporub')/record[lien_rubrique_parent='Bmgexporub-0000002']
>> <records>
>>        return $rubriques
>> </records>
>>  
>> Executing the following URL : http://localhost:8080/bm-grenoble/Bmgexporub/get-children-rubriques.xml?parentid=Bmgexporub-0000002
>> the response is this one :
>>  
>> Erreur d'analyse XML : aucun élément trouvé
>> Emplacement : http://localhost:8080/bm-grenoble/Bmgexporub/get-children-rubriques.xml?parentid=Bmgexporub-0000002
>> Numéro de ligne 1, Colonne 1 :
>>  
>> with the following logs :
>>  
>> <parsererror>
>> Erreur‌·d'analyse‌·XML&nbsp;:‌·aucun‌·élément‌·trouvé‌¶Emplacement&nbsp;:‌·http://localhost:8080/bm-grenoble/Bmgexporub/get-children-rubriques.xml?parentid=Bmgexporub-0000002‌¶Numéro‌·de‌·ligne‌·1,‌·Colonne‌·1&nbsp;:
>> <sourcetext>‌¶^</sourcetext>
>> </parsererror>
>>  
>> I checked that my query request is correct by testing in the eXist client.
>> I can't understand at which level there's an error… lo log in tomcat !!!
>>  
>> Patricia
>>  
>>  
>>  
>>  
> 


Mime
View raw message