You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-users@xml.apache.org by Barzilai Spinak <ba...@internet.com.uy> on 2003/04/05 00:23:43 UTC

Xindice 1.1b, Cocoon, etc.

Hi, I just subscribed to the list after spending hours looking into the 
archives and not finding a definite answer.

This mail may be a little messy but that's because I'm very confused 
since the 1.1 dist's are all messed up. I was a minute away of
moving everything to eXist!

I don't intend this message as a flame!! I know it's in beta, but I want 
some help understanding what's going on and what I should fix where.

I'm doing a project with a friend using Cocoon 2.0.4 and Xindice 1.0.
We were doing our first tests, where we have a collection with 3 
documents and wanted to return the 3 of them with a simple query.
We found that we sometimes got the 3 of them, sometimes 2, etc.. very 
inconsistent.

Searching into the archives of the list we did some tests by looking at 
Tomcat's debug log and found a NullPointerException in the cases when 
the output would be incomplete.

By the way, we're using Tomcat 4.1.18 and J2SE 1.4.1

So we were baffled.. and thought about trying Xindice 1.1b.
Since the documentation is not clear and incomplete we downloaded the
3 distributions: namely, src, jar, and war.
But there are files missing fmor the 3 of them, for example the 
config/*.xml  files

This will make the building to fail saying "Could not find file 
/devel/xindice-1.1b1/config/xindice.xml to copy."

Some of the .xml files can be downloaded from cvs...

Then there's the question about making 1.1b actually work within Cocoon.
We copied the war file form the war distribution into Tomcat's webapps 
dir.  Tomcat opened it and deployed it fine. But we coudlnt make it work
with our old pipelines which used an url of the type:
xmldb:xindice://localhost:4080/db....

There's no process listening on port 4080 anymore!!
I guess now everything works through Tomcat but we're not 100% sure how.
(We kinda made it work in the end but we still ahve so many doubts!)

There's also the question about the command line tool. It's in the jar 
distribution but it doesnt work out of the box. The script looks for
$XINDICE_HOME/dist/xindice*.jar  to add to the classpath
but the only distribution with a "dist" directory is the "war" 
distribution which only has the .war file and not anything like xindice*.jar
It's also missing the config/*.xml files like commands.xml and such
so it won't start!!  The only way I found to get a copy of those files 
was through CVS.

We also replaced Cocoon's libs with the equivalent versions that came 
with xindice 1.1b.. still wouldnt work, plus we still didnt know what to 
make of our xmldb:xindice URL...
We tried xindice-embed versions of the URL, previously fixing 
cocoon.xconf to resolve the resource to the new URL..

No luck there...

We found in the archives of the mailing list, one message stating that
the war file should be renamed to Xindice since xindice expects it to be 
that way.

Finally after all these changes we made it work with an URL of the type
xmldb:xindice://localhost:8080/db....  and changing the servlet name to 
Xindice

I think that's what we did because it was 5am and I didnt understand 
much anymore.

So, in sum: There no single packaging of the many versions of xindice 
that really works. You have to solve the puzzle of getting some files 
from the war dist, some files from the jar dist, some files from the src 
  dist, some files form cvs, etc..
Which defeats the purpose of having packaged tar.gz's in the first place!

On the happy side of the story, 1.1b didn't have 1.0's problems and we
got the full set of results on our queries!! Yes!!! :-)

Anyone else has had these problems?  Anyone wanting to share their 
stories of Cocoon+Xindice?  Did I miss or not understand anything and 
that's why I got into all this trouble?


Re: Xindice 1.1b, Cocoon, etc.

Posted by "Vladimir R. Bossicard" <vl...@bossicard.com>.
1. CVS checkout
2. build xindice
3. fix the release so that every file is included
4. open a bug report with your the patch of your build.xml file

-Vladimir

-- 
Vladimir R. Bossicard
www.bossicard.com

Re: Xpath query not working, me confused...!

Posted by Suzan Foster <su...@islief.nl>.
Paul Brown:

> I'm using the query:
> 	"//enaml/header/date/text()"
> To try and retrieve all the text() nodes of the 'date' element from
> within a collection of 'enaml' documents, where <enaml> is the root
> element of each document.
>
> However the query returns no values into:
>
> 	ResourceSet resultSet = service.query(xpathValue);
>
> i.e. resultSet.getSize() == 0.
>
> But the query:
> 	"//enaml/header/date/."
> works, but returns a <date> node instead of the text() sub-node of that
> <date>.
>
> Where am I going wrong?

The query results returned by xindice have to be valid xml, so it can't
return only the text nodes. Neither can it return individual attribute
nodes. You need to extract the text from the returned date element.

Regards,
Suzan Foster.

Re: Xindice 1.1b, Cocoon, etc.

Posted by Richard Light <ri...@light.demon.co.uk>.
In message <3E...@internet.com.uy>, Barzilai Spinak 
<ba...@internet.com.uy> writes

>Yes, as Vladimir said, I needed to checkout the complete CVS tree and 
>make some
>adjustments to Cocoon's library. It looks really simple now that I've 
>done it but, boy,
>did it take a lot of guessing!!!!!

Barzilai,

It sounds like now would be a good time for you to write down and share 
what you did - while it still looks simple to you ...

Richard Light
-- 
Richard Light
SGML/XML and Museum Information Consultancy
richard@light.demon.co.uk


Re: NEW Xindice 1.1b and Cocoon 2 HowTo

Posted by "Vladimir R. Bossicard" <vl...@bossicard.com>.
> Since I had so many people asking me to explain what I did, and 
> following Vladimir's suggestion, I wrote a little "How To"
> which you can enjoy here:
> 
> http://nagoya.apache.org/wiki/apachewiki.cgi?XindiceProjectPages

Thanks for the document.  Here are some remarks:

- start from the hypothesis that the Xindice release is valid.  The user 
shouldn't be required to retrieve Xindice from CVS in order to make it work

- how to build Xindice should be described in another document.  One 
task per how-to, otherwise there's too many repetitions.

- "The reason for this is that, as of this writing, none of the 3 
pre-built .zip or .tar.gz [distributions] (jar, war, src) are complete. 
In particular, you won't be able to build Xindice from the src 
distribution because it's missing the config directory and maybe other 
stuff..."
   The goal is not to state that there is a problem, but to fix it.  I 
know it takes much more time to fix a problem but that's how you can 
improve things.  Anyway we know that the release doesn't work.  If 
someone wants to take the next step and fix the release, he's welcome.

> It's also my first "how to" so it may be very confusing and difficult to 
> understand. I tried to be as clear as possible.

It's a good start.  Just be more focused and take the opportunity to fix 
things.  Xindice has so many problems, it's very likely that you are 
right when you find something's broken :-)

> I spent the last 4 hours writing the "how to" as a humble way to 
> contribute to this project which I think is very cool and useful
> and has a great future.

if everyone just invested an afternoon to improve the project I'm sure 
we will be much further than we are now.  So thanks for showing the way.

-Vladimir

-- 
Vladimir R. Bossicard
www.bossicard.com


Re: NEW Xindice 1.1b and Cocoon 2 HowTo

Posted by Andrew Savory <an...@luminas.co.uk>.
Hi,

On Sun, 6 Apr 2003, Barzilai Spinak wrote:

> Thing, is... I don't know why you need that tomcat.home property when
> building. As I explained, I just set it to /var/tomcat4
> but it's not clear to me what it does. I tried to rephrase it a little
> so I don't mention /var/tomcat4

$TOMCAT_HOME is used by the "tomcat-deploy" build target, which basically
builds XIndice and then copies it into $TOMCAT_HOME/webapps/ so it is
ready to run.

tomcat.home in the build.properties is supposed to allow you to override
the directory XIndice will be copied to, or to specify it instead of
setting $TOMCAT_HOME.

The rewording looks fine to me ...

> I made it compile just by making those two methods public. I know it's
> not what Vladimir intended, I just wanted to make the build successful.

Ditto. I see Vladimir's done the same.


Andrew.

-- 
Andrew Savory                                Email: andrew@luminas.co.uk
Managing Director                              Tel:  +44 (0)870 741 6658
Luminas Internet Applications                  Fax:  +44 (0)700 598 1135
This is not an official statement or order.    Web:    www.luminas.co.uk

Re: NEW Xindice 1.1b and Cocoon 2 HowTo

Posted by Barzilai Spinak <ba...@internet.com.uy>.
Andrew Savory wrote:

>You don't need to talk about /var/tomcat4 for the same reason that you
>don't mention the directory java is installed in - because when JAVA_HOME
>and $TOMCAT_HOME are set, it doesn't matter.
>
>This means that step 1 in the build process should be modified to
>something like "if you don't want to use TOMCAT_HOME, ..."
>  
>
Thing, is... I don't know why you need that tomcat.home property when 
building. As I explained, I just set it to /var/tomcat4
but it's not clear to me what it does. I tried to rephrase it a little 
so I don't mention /var/tomcat4

>You also have typos: <source-hanlder> should be <source-handler>.
>  
>
Fixed it.

>Vladimir, your recent integration tests stop CVS from building -- any
>chance you could either roll them back until the problems are fixed, or
>commit the fixes?
>
>    [javac] /home/savs/cvs-apache/xml-xindice/java/tests/src/org/apache/xindice/integration/client/services/XUpdateQueryTest.java:74: setUp() in org.apache.xindice.integration.client.services.XUpdateQueryTest cannot override setUp() in org.apache.xindice.integration.client.AbstractXmlDbClientTest; attempting to assign weaker access privileges; was public
>    [javac]     protected void setUp()
>
>  
>
It looks like Vladimir was working on it at about the same time I was 
writing the howto.
I made it compile just by making those two methods public. I know it's 
not what Vladimir intended, I just wanted to make the build successful. 
I don't know wether it has some
side effects because I haven't tested.

Bye all..

BarZ


Re: NEW Xindice 1.1b and Cocoon 2 HowTo

Posted by Andrew Savory <an...@luminas.co.uk>.
On Sun, 6 Apr 2003, Vladimir R. Bossicard wrote:

> It's fixed in CVS now.  I didn't know that this could break the build.  I'm
> currenlty changing the tests so that they can be executed independently.  For
> the integration tests I'll try to introduce a new JUnit TestRunner.  I'll do
> this this week so hopefully we'll have better tests next week-end.

Cool, thanks. I quite like the fact that the integration tests are run as
part of the standard build - it's a good way of ensuring all code is
tested and many eyes see the need for fixes!


Andrew.

-- 
Andrew Savory                                Email: andrew@luminas.co.uk
Managing Director                              Tel:  +44 (0)870 741 6658
Luminas Internet Applications                  Fax:  +44 (0)700 598 1135
This is not an official statement or order.    Web:    www.luminas.co.uk

Re: NEW Xindice 1.1b and Cocoon 2 HowTo

Posted by "Vladimir R. Bossicard" <vl...@bossicard.com>.
> Vladimir, your recent integration tests stop CVS from building -- any
> chance you could either roll them back until the problems are fixed, or
> commit the fixes?

Mea culpa, mea culpa, mea maxima culpa.

It's fixed in CVS now.  I didn't know that this could break the build.  I'm
currenlty changing the tests so that they can be executed independently.  For
the integration tests I'll try to introduce a new JUnit TestRunner.  I'll do
this this week so hopefully we'll have better tests next week-end.

-Vladimir

-- 
Vladimir R. Bossicard
www.bossicard.com

Re: NEW Xindice 1.1b and Cocoon 2 HowTo

Posted by Andrew Savory <an...@luminas.co.uk>.
On Sun, 6 Apr 2003, Barzilai Spinak wrote:

> As I explain in the disclaimer, I'm very new to both Xindice and Cocoon,
> so I may have done a lot of conceptual mistakes.

The only comment I'd have is:

  You have installed Tomcat 4 and it is installed under /var/tomcat4 and
  have exported the TOMCAT_HOME variable.  (It normally starts on port
  8080, so if you go to http://yourhost:8080 you will get your local
  Tomcat page)

You don't need to talk about /var/tomcat4 for the same reason that you
don't mention the directory java is installed in - because when JAVA_HOME
and $TOMCAT_HOME are set, it doesn't matter.

This means that step 1 in the build process should be modified to
something like "if you don't want to use TOMCAT_HOME, ..."

You also have typos: <source-hanlder> should be <source-handler>.

Other than that, looks pretty good to me, so far! Can't wait to try it out
on a Cocoon site :-)

Vladimir, your recent integration tests stop CVS from building -- any
chance you could either roll them back until the problems are fixed, or
commit the fixes?

    [javac] /home/savs/cvs-apache/xml-xindice/java/tests/src/org/apache/xindice/integration/client/services/XUpdateQueryTest.java:74: setUp() in org.apache.xindice.integration.client.services.XUpdateQueryTest cannot override setUp() in org.apache.xindice.integration.client.AbstractXmlDbClientTest; attempting to assign weaker access privileges; was public
    [javac]     protected void setUp()

Cheers,

Andrew.

-- 
Andrew Savory                                Email: andrew@luminas.co.uk
Managing Director                              Tel:  +44 (0)870 741 6658
Luminas Internet Applications                  Fax:  +44 (0)700 598 1135
This is not an official statement or order.    Web:    www.luminas.co.uk

NEW Xindice 1.1b and Cocoon 2 HowTo

Posted by Barzilai Spinak <ba...@internet.com.uy>.
Dear boys and girls:

Since I had so many people asking me to explain what I did, and 
following Vladimir's suggestion, I wrote a little "How To"
which you can enjoy here:

http://nagoya.apache.org/wiki/apachewiki.cgi?XindiceProjectPages

As I explain in the disclaimer, I'm very new to both Xindice and Cocoon, 
so I may have done a lot of conceptual mistakes.
It's also my first "how to" so it may be very confusing and difficult to 
understand. I tried to be as clear as possible.

If you find any mistakes or want to clear up some concepts for me that 
you find I didn't get it, please tell me.
But first try to see if there's not something wrong with your installation.
I don't have much time to answer how to install your JDK or how to fix 
the always-changing CVS sources so they will compile.

I spent the last 4 hours writing the "how to" as a humble way to 
contribute to this project which I think is very cool and useful
and has a great future.

Thanks!

BarZ


Re: Xindice 1.1b, Cocoon, etc.

Posted by "Vladimir R. Bossicard" <vl...@bossicard.com>.
> Thanks to Vladimir's short answer and Mark's longer one :-)

I'm sometimes a little bit too direct but I'm glad that you found my (very)
short answer useful.

It would be great if you could write your discoveries on the Xindice Wiki pages

<http://nagoya.apache.org/wiki/apachewiki.cgi?XindiceProjectPages>

feel free to add a new page for Cocoon.

If you have made modifications to the build.xml file, feel free to send the diff
to me.

No username/password is needed to create/update a new page on Wiki and you don't
even need to know HTML to write a new page!  Now noone has any excuse for not
writing/updating the Xindice documentation.

Thanks for your contribution

-Vladimir

-- 
Vladimir R. Bossicard
www.bossicard.com

Re: Xindice 1.1b, Cocoon, etc.

Posted by Tarun Aggarwal <tb...@stern.nyu.edu>.
Hi,

It would be great if you could please write a detailed installation 
process to get Xindie 1.1b working. I am currently using Xindice 1.0, 
but would like to migrate to 1.1b if its not too much of a hassle.

Thanks,
Tarun

Barzilai Spinak wrote:

> Thanks to Vladimir's short answer and Mark's longer one :-)
> I finally succeeded in integrating  Xindice 1.1b with Cocoon 2.
> Since during my research I found several questionsrelating to this buy 
> virtually
> no definite answer I will tell my "solution" to anyone who asks.
>
> Yes, as Vladimir said, I needed to checkout the complete CVS tree and 
> make some
> adjustments to Cocoon's library. It looks really simple now that I've 
> done it but, boy,
> did it take a lot of guessing!!!!!
>
> thanks all
>
> BarZ
>


RE: Xpath query not working, me confused...!

Posted by Trevor Leung <tr...@cuhk.edu.hk>.
Hi Andrew, 

Thanks in advance, it works.
I have tried to use contains without single quote, and there will give out error.


Trevor.


-----Original Message-----
From: Andrew Savory [mailto:savs@luminas.co.uk]On Behalf Of Andrew Savory
Sent: Tuesday, April 08, 2003 4:25 PM
To: xindice-users@xml.apache.org
Subject: RE: Xpath query not working, me confused...!



Hi Trevor,

On Tue, 8 Apr 2003, Trevor Leung wrote:

> xindice xpath -v -c /db/test -q /person[fname="Paul"]
>
> it return nothing, is there any wrong with me???

No, nothing wrong with you, I see exactly the same behaviour.

Modifying the query to:
 xindice xpath -v -c /db/test -q '/person[contains(fname,"Paul")]'
... gets the result you are after.

I suspect there's some bug in your xpath, although it looks sane to me.


Andrew.

-- 
Andrew Savory                                Email: andrew@luminas.co.uk
Managing Director                              Tel:  +44 (0)870 741 6658
Luminas Internet Applications                  Fax:  +44 (0)700 598 1135
This is not an official statement or order.    Web:    www.luminas.co.uk

RE: Xpath query not working, me confused...!

Posted by Andrew Savory <an...@luminas.co.uk>.
Hi Trevor,

On Tue, 8 Apr 2003, Trevor Leung wrote:

> xindice xpath -v -c /db/test -q /person[fname="Paul"]
>
> it return nothing, is there any wrong with me???

No, nothing wrong with you, I see exactly the same behaviour.

Modifying the query to:
 xindice xpath -v -c /db/test -q '/person[contains(fname,"Paul")]'
... gets the result you are after.

I suspect there's some bug in your xpath, although it looks sane to me.


Andrew.

-- 
Andrew Savory                                Email: andrew@luminas.co.uk
Managing Director                              Tel:  +44 (0)870 741 6658
Luminas Internet Applications                  Fax:  +44 (0)700 598 1135
This is not an official statement or order.    Web:    www.luminas.co.uk

RE: Xpath query not working, me confused...!

Posted by Trevor Leung <tr...@cuhk.edu.hk>.
Hi All,

I tried to use Xpath to query the database but with no result output, my case is:

-CVS of Xindice with Tomcat  http://localhost:8080/Xindice with debug tools works
-Linux
-command line can add or list collection with "xindice lc -c /db"

With subcollection test in db such that /db/test
and documents test1.xml and test2.xml

test1.xml

<?xml version="1.0"?>
<person>
   <fname>John</fname>
   <lname>Smith</lname>   
   <age>30</age>
</person>

test2.xml

<?xml version="1.0"?>
<person>
   <fname>Paul</fname>
   <lname>Tokon</lname>   
   <age>30</age>
</person>


When I run xpath as follows

xindice xpath -v -c /db/test -q /person[fname="*"]

it returns the follows

<person xmlns:src="http://xml.apache.org/xindice/Query" src:col="/db/test" src:key="test1">
   <fname xmlns:src="http://xml.apache.org/xindice/Query">John</fname>
   <lname xmlns:src="http://xml.apache.org/xindice/Query">Smith</lname>
   <age xmlns:src="http://xml.apache.org/xindice/Query">30</age>
</person>
<person xmlns:src="http://xml.apache.org/xindice/Query" src:col="/db/test" src:key="test2">
   <fname xmlns:src="http://xml.apache.org/xindice/Query">Paul</fname>
   <lname xmlns:src="http://xml.apache.org/xindice/Query">Tokon</lname>
   <age xmlns:src="http://xml.apache.org/xindice/Query">30</age>
</person>


However, when I run 
xindice xpath -v -c /db/test -q /person[fname="Paul"]

it return nothing, is there any wrong with me???

Thanks for any help.


Regards,

Trevor





-----Original Message-----
From: Paul Brown [mailto:pjb00u@cs.nott.ac.uk]
Sent: Tuesday, April 08, 2003 7:05 AM
To: xindice-users@xml.apache.org
Subject: Xpath query not working, me confused...!



I'm using the query:
	"//enaml/header/date/text()"
To try and retrieve all the text() nodes of the 'date' element from
within a collection of 'enaml' documents, where <enaml> is the root
element of each document.

However the query returns no values into:

	ResourceSet resultSet = service.query(xpathValue);

i.e. resultSet.getSize() == 0.

But the query:
	"//enaml/header/date/." 
works, but returns a <date> node instead of the text() sub-node of that
<date>.

Where am I going wrong?

Cheers

Paul


Xpath query not working, me confused...!

Posted by Paul Brown <pj...@cs.nott.ac.uk>.
I'm using the query:
	"//enaml/header/date/text()"
To try and retrieve all the text() nodes of the 'date' element from
within a collection of 'enaml' documents, where <enaml> is the root
element of each document.

However the query returns no values into:

	ResourceSet resultSet = service.query(xpathValue);

i.e. resultSet.getSize() == 0.

But the query:
	"//enaml/header/date/." 
works, but returns a <date> node instead of the text() sub-node of that
<date>.

Where am I going wrong?

Cheers

Paul


Re: Xindice 1.1b, Cocoon, etc.

Posted by Barzilai Spinak <ba...@internet.com.uy>.
Thanks to Vladimir's short answer and Mark's longer one :-)
I finally succeeded in integrating  Xindice 1.1b with Cocoon 2.
Since during my research I found several questionsrelating to this buy 
virtually
no definite answer I will tell my "solution" to anyone who asks.

Yes, as Vladimir said, I needed to checkout the complete CVS tree and 
make some
adjustments to Cocoon's library. It looks really simple now that I've 
done it but, boy,
did it take a lot of guessing!!!!!

thanks all

BarZ


Re: Xindice 1.1b, Cocoon, etc.

Posted by Mark Szpakowski <sz...@hfx.andara.com>.
A few responses/points:

- the distribution files at http://xml.apache.org/dist/xindice/ are 
incomplete (missing xindice.jar, for example). As Vladimir Bossicard 
suggests, you need to do a CVS checkout and build xindice to get the 
jar file and also Xindice.war (must be named exactly that).

- the 4080 port applies only to Xindice 1.0. Xindice 1.1 uses Tomcat's 
8080 default, so the servlet URL is
   http://localhost:8080/Xindice, which will bring up the "ugly debug 
tool".

- for XML-RPC, also use http://localhost:8080/Xindice. The RPC syntax 
for 1.1 is different from 1.0. Look in CollectionImpl.java for examples 
of how XML-RPC is used there to implement the XML:DB Collection 
interface. A Hashtable instance is used to package up messages 
("message", "ListCollections", for example). This is then stuffed into 
a Vector for the xml-rpc call.

I'm writing this up for my own sanity, and will post it for general use 
in a few days, complementing Tom Dyson's "Getting Started with Xindice 
1.1" (at http://torchbox.com/xml/xindice/xindice.html).

Cheers,
Mark

On Friday, April 4, 2003, at 06:23  PM, Barzilai Spinak wrote:

> We copied the war file form the war distribution into Tomcat's webapps 
> dir.  Tomcat opened it and deployed it fine. But we coudlnt make it 
> work
> with our old pipelines which used an url of the type:
> xmldb:xindice://localhost:4080/db....
>
> [..]
> We found in the archives of the mailing list, one message stating that
> the war file should be renamed to Xindice since xindice expects it to 
> be that way.
>
> Finally after all these changes we made it work with an URL of the type
> xmldb:xindice://localhost:8080/db....  and changing the servlet name 
> to Xindice