Continuing toward getting xupdate update to work...
I traced to an exception rethrown on the Xindice server side by the
constructor of XUpdateQuery (below), but actually seems to be generated by
the lexus class XUpdateQueryImpl.setQString(String query) on troubles
parsing the query xml.
Adding some logging I was able to see exactly what the server side is trying
to parse.
The exception turned out to be a namespace that didn't transfer to the
xupdate:modifications tag (not due to xindice). I wish the error messages
were more informative, but didn't have time to find a good way to augment
them.
Now I have no exception, but just the same, the modifications xml that works
in xmldbgui, makes no updates -- a success without success!
I feel kind of lost on the oid issue. If I use none, the cocoon pipline
finds a NPE. If I use the name of the document or anything else, I get zero
updates. I suppose this could in some way be related to the difference from
xmldbgui. What am I suppose to use?
Incidentally there is this odd construction in XUpdateImpl for
setNameSpaceMap which leaves the intention in doubt .
/**
* Set the namespace map to be used when resolving queries
*/
public void setNamespaceMap(NamespaceMap nsMap) {
if (nsMap == null)
return;
if (this.nsMap == null) {
this.nsMap = nsMap;
}
else {
this.nsMap.includeNamespaces(nsMap, API_NS_PRECEDENCE);
}
}
Caused by: org.apache.xmlrpc.XmlRpcException: java.lang.Exception:
org.apache.xindice.core.query.CompilationException: Error Compiling XUpdate
Query
at org.apache.xmlrpc.XmlRpcClient$Worker.execute(Unknown Source)
at org.apache.xmlrpc.XmlRpcClient.execute(Unknown Source)
at
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.runRemoteCommand(Colle
ctionImpl.java:180)
at
org.apache.xindice.client.xmldb.xmlrpc.CollectionImpl.query(CollectionImpl.j
ava:551)
at
org.apache.xindice.client.xmldb.services.QueryService.queryResource(QuerySer
vice.java:109)
at
org.apache.xindice.client.xmldb.services.XUpdateQueryServiceImpl.updateResou
rce(XUpdateQueryServiceImpl.java:132)
at
org.apache.cocoon.transformation.XMLDBTransformer.endElement(XMLDBTransforme
r.java:433)
----- Original Message -----
From: "Don Saxton" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Wednesday, April 16, 2003 11:54 AM
Subject: Re: xupdate update in cocoon
> Steven
>
> This is a week ago 'current' cvs checkout. Embarrassingly
> XupdateQueryService is a xmldb interface, so it really should not help.
Also
> I found it in an earlier jar of different name. Still no go. The Impl is
in
> Xindice.
>
> My xindice /lib files are below. Do they match yours? xalan matchs
> tomcat/common/lib. xerces matches tomcat/common/endorsed
>
> 997,276 xalan-2.4.0.jar
> 972,027 xercesImpl-2.1.0.jar
> 113,749 xml-apis-1.1.jar
> 9,248 xmldb-api-20021118.jar
> 29,501 xmldb-api-sdk-20021118.jar
> 11,375 xmldb-common.jar
> 43,235 xmldb-xupdate.jar
> 57,460 xmlrpc-1.1.jar
>
> Later today I will dissect the Impl.
>
> Don
>
> From: "Steven Cummings"
> Well, basically you can get an updated version of xmldb-api.jar at
> xmldb.org, if one exists, but I'm not so sure this will help solve your
> problem. Are you using Xindice-1.1b or current cvs-checkout? With current
> cvs checkout, I can make xupdate work by updating the jars used in tomcat
> and my cocoon webapps to the one that is currently in the Xindice
> repository.
>
> /S
>
> Don Saxton <[EMAIL PROTECTED]> wrote:
>
> >Thanks Steven and Stavros
> >
> >Steven, I should have said that the result xml I showed, is after a
> >XMLDBException which occurs on the call to
> >XUpdateQueryService.updateResource(String key, String document). The
error
> >persists after upgrading to xerces-2.2.1.jar. I think that to know more I
> >need to find the source of that class in xmldb-api.jar. How can I get it
or
> >a more recent version?
> >
> >Stavros, I did have trouble understanding the syntax of the
> >xupdate:modifications. It took the XMLDBGUI and many readings of
> >http://xmldb.org/xupdate/xupdate-wd.html The xupdate:modifications part
of
> >the query below does work in xmldbgui.
> >
> >Also Instructions for using xmldbgui with xindice1.1 are here
>
>http://titanium.dstc.edu.au/viewcvs/viewcvs.cgi/*checkout*/XMLdbGUI/docs/Ho
> w
> >To_Configure_XMLdbGUI_Lite.html?rev=1.1
> >but these may be more help
> >http://marc.theaimsgroup.com/?l=xindice-users&m=103615588828273&w=2
> >(follow the thread)
> >
> >Don
> >
> >----- Original Message -----
> >From: "Stavros Kounis" <[EMAIL PROTECTED]>
> >To: <[email protected]>
> >Sent: Monday, April 14, 2003 1:06 PM
> >Subject: RE: xupdate update in cocoon
> >
> >
> >>
> >> i have try to use XUpdate using all the GUI client they are in xindice
> web
> >> site with out success and without any error message
> >>
> >> a messege in this list is talking about a bug in xindice
> >> but i dont know more details
> >>
> >> if anyone run succesfull a XUpdate guery please post an example in this
> >> list
> >>
> >>
> >> ---stavros
> >>
> >>
> >> On Mon, 14 Apr 2003, Steven Cummings wrote:
> >>
> >> > Don,
> >> >
> >> > What is it exactly that doesn't work? I'm using Xindice and Cocoon
> >together on Tomcat (4.1) and jdk14 and what I've discovered is that you
> need
> >to use the Xerces jar from Xindice (2.2.1 I think) in both Cocoon, and
> >Tomcat underneath (meaning put it in $TOMCAT_HOME/common/endorsed). All
of
> >this is assuming that you're problem is a Java exception being thrown
when
> >you try to execute the update statements.
> >> >
> >> > Sorry if this wasn't what you were looking for.
> >> >
> >> > /S
> >> >
> >> > Don Saxton <[EMAIL PROTECTED]> wrote:
> >> >
> >> > >Hi
> >> > >
> >> > >I have a good start in putting xindice 1.1b together with cocoon
2.04
> >(jdk
> >> > >1.4 tomcat 4.1.18), but I am really stuggling with Xupdate.
> >> > >
> >> > >I got this far by using the experiences of several people on this
> list.
> >> > >Thank you greatly. Frequently I read that others get xupdate to
work,
> >so I
> >> > >am hoping that someone can help me over the last hurdle.
> >> > >
> >> > >Below are xupdate query that I input to the cocoon transformer
> >> > >XMLDBTransformer and the result.
> >> > >With xmldbgui I can successfully xupdate with the modifications node
> >set of
> >> > >the update query below.
> >> > >
> >> > >The query side works well and I am able to snag a fragment from a
> >document
> >> > >or a document from a collection. I can do it through cocoon,
xmldbgui,
> >> > >xincon, and almost with "the ugly debug tool" (can't glue the xpath
> >query
> >> > >onto the http collection request, but it's still a keeper).
> >> > >
> >> > >One suspect is xmldb-api-20021118.jar. I could not find
> >> > >xmldb-api-20021126.jar or how to get to xmldb cvs. My other suspect
is
> >> > >XMLDBTransformer which seems to require an oid attribute eventhough
a
> >query
> >> > >of type="update" is documented as not needed. It doesn't seem to
> matter
> >what
> >> > >the value of oid is. Related to these is that I can't find
documented
> >(well,
> >> > >meaningfully documented) the difference between these two:
> >> > >
> >> > >XUpdateQueryService.update(String document)
> >> > >XUpdateQueryService.updateResource(String key, String document)
> >> > >
> >> > >Thanks for everything
> >> > >
> >> > >Don
> >> > >
> >> > ><!-- _________the query_________ -->
> >> > ><?xml version="1.0" encoding="UTF-8"?>
> >> > ><xindice:query xmlns:xupdate="http://www.xmldb.org/xupdate"
> >> > > xmlns:xindice="http://apache.org/cocoon/xmldb/1.0"
> >> > > type="update" oid="whatever">
> >> > > <xupdate:modifications version="1.0">
> >> > > <xupdate:remove select="//[EMAIL PROTECTED]'p1']"/>
> >> > > <xupdate:append select="//persons">
> >> > > <xupdate:element name="person">
> >> > > <xupdate:attribute name="id">p1</xupdate:attribute>
> >> > > <xupdate:attribute name="name">Don</xupdate:attribute>
> >> > > <parents
> >> > > xmlns:chiba="http://chiba.sourceforge.net/2001/09/xforms"
> >> > > xmlns:xforms="http://www.w3.org/2002/08/xforms/cr"
> >> > > xmlns:xlink="http://www.w3.org/1999/xlink"
> >> > > xmlns:collection="http://apache.org/cocoon/xmldb/1.0"
> >> > > xmlns:src="http://xml.apache.org/xindice/Query">
> >> > > <personref person="p2"/>
> >> > > <personref person="p7"/>
> >> > > </parents>
> >> > > </xupdate:element>
> >> > > </xupdate:append>
> >> > > </xupdate:modifications>
> >> > ></xindice:query>
> >> > ><!-- _________end query_________ -->
> >> > >
> >> > ><!-- _________the result_________ -->
> >> > ><?xml version="1.0" encoding="UTF-8"?>
> >> > ><xindice:query oid="whatever" type="update" result="failure"
> >> > > xmlns:xupdate="http://www.xmldb.org/xupdate"
> >> > > xmlns:xindice="http://apache.org/cocoon/xmldb/1.0">
> >> > > Failed to update resource whatever: 1
> >> > ></xindice:query>
> >> > ><!-- _________end result_________ -->
> >> > >
> >> > >
> >> >
> >> >
> >> >
> >>
> >>
> >
> >
>
>
> --
> Steven Cummings
> Columbia, MO
> Email: [EMAIL PROTECTED]
> AIM: cummingscs
> ICQ: 3330114
> MSN: [EMAIL PROTECTED]
>
>
> __________________________________________________________________
> Try AOL and get 1045 hours FREE for 45 days!
> http://free.aol.com/tryaolfree/index.adp?375380
>
> Get AOL Instant Messenger 5.1 for FREE! Download Now!
> http://aim.aol.com/aimnew/Aim/register.adp?promo=380455
>