You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stephan Michels <st...@vern.chem.tu-berlin.de> on 2002/02/21 12:07:03 UTC

XMLDBGenerator

Hi,

I try to use cocoon with xindice. I install the current CVS build and
changed the following rows in the sitemap.

<map:generator name="xmldb"
 src="org.apache.cocoon.generation.XMLDBGenerator"
 logger="sitemap.generator.xmldb">

<driver>org.apache.xindice.client.xmldb.DatabaseImpl</driver><base>xmldb:dbxml:///db/</base>

</map:generator>

<map:generator name="xmldbcollection"
 src="org.apache.cocoon.generation.XMLDBCollectionGenerator"
 logger="sitemap.generator.xmldbcollection">

<driver>org.apache.xindice.client.xmldb.DatabaseImpl</driver><base>xmldb:dbxml:///db/</base>

</map:generator>

I also copy the the xindice.jar in the WEB-IF/lib dir.

If I send a request like localhost:8080/cocoon/xmldb/db/
I got the exception:

org.apache.cocoon.ProcessingException: Problem setting up the connection
to XML:DB: org.dbxml.client.xmldb.DatabaseImpl:
java.lang.ClassNotFoundException: org.dbxml.client.xmldb.DatabaseImpl
at
org.apache.cocoon.components.source.XMLDBSource.connect(XMLDBSource.java:206)
at
org.apache.cocoon.components.source.XMLDBSource.toSAX(XMLDBSource.java:223)
at
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:146)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:255)
[...]

xindice.jar and also xmldb-api-20011111.jar doesn't contain this class.

Did I forget anything?

Thanx, Stephan Michels.


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: XMLDBGenerator

Posted by Martin Holz <ho...@fiz-chemie.de>.
Stephan Michels wrote:
> On Thu, 21 Feb 2002, Gianugo Rabellino wrote:
> > Stephan Michels wrote:
> > > I try to use cocoon with xindice.
> >
> > Please avoid, if possible, the XML:DB generators, swith to the Source
> > implementation, which allows you to use straightforward XML:DB URIs in
> > your sitemap. The generators are going to be deprecated and abandoned in
> > a short while.
>
> Okay, thank you.
>
> > Anyway, as for your problem, try to correct this:
> > > <base>xmldb:dbxml:///db/</base>
> >
> > Base should be is xmldb:xindice///db/.
> >
> > Also, you are getting the error from the XML:DB source protocol, not
> > from the generators, please double check your settings:
>
> I also added the the line
> <driver type="xindice"
> class="org.apache.xindice.client.xmldb.DatabaseImpl"/>
> into the cocoon.xconf
>
>
> When I now try the request
> http://vernjava:8080/cocoon/xmldb/addressbook?xpath=//person[lname=%27Cletu
								^^^
>s%27]
>
> I got following exception:
> org.apache.cocoon.ProcessingException: Could not read resource
> xmldb:xindice://vernjava:4080/addressbook:
> java.lang.StringIndexOutOfBoundsException: String index out of range: -11
> at


You must quote the 'equal' sign too. IIRC is it %3D.

Regards
	Martin

--
Martin Holz  <ho...@fiz-chemie.de>  phone: 0049-30-39977 218 
FIZ CHEMIE BERLIN

We do not make software "releases".
Our software escapes, leaving a bloody trail of designers
and quality assurance people in it's wake!

 

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: XMLDBGenerator

Posted by Stephan Michels <st...@vern.chem.tu-berlin.de>.

On Fri, 22 Feb 2002, Vadim Gritsenko wrote:

> > From: Stephan Michels [mailto:stephan@vern.chem.tu-berlin.de]
> >
> > On Thu, 21 Feb 2002, Gianugo Rabellino wrote:
>
>
> <snip/>
>
> > > > <base>xmldb:dbxml:///db/</base>
> > >
> > > Base should be is xmldb:xindice///db/.
> > >
> > > Also, you are getting the error from the XML:DB source protocol, not
> > > from the generators, please double check your settings:
> >
> > I also added the the line
> > <driver type="xindice"
> > class="org.apache.xindice.client.xmldb.DatabaseImpl"/>
> > into the cocoon.xconf
> >
> >
> > When I now try the request
> >
> http://vernjava:8080/cocoon/xmldb/addressbook?xpath=//person[lname=%27Cl
> etus%2
> > 7]
>
> Stack trace of the StringIndexOutOfBoundsException will be of greater
> help. And the version of the Cocoon you are using.


It now works.

I must use
http://vernjava:8080/cocoon/xmldb/addressbook/?xpath=//person[lname%3d%27Cletus%27]

I forgot the last slash after addressbook.

Also the mail from "Perry Molendijk" "Xindice and Cocoon How To" helped.

Thanx, Stephan Michels.


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: XMLDBGenerator

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Stephan Michels [mailto:stephan@vern.chem.tu-berlin.de]
> 
> On Thu, 21 Feb 2002, Gianugo Rabellino wrote:


<snip/>

> > > <base>xmldb:dbxml:///db/</base>
> >
> > Base should be is xmldb:xindice///db/.
> >
> > Also, you are getting the error from the XML:DB source protocol, not
> > from the generators, please double check your settings:
> 
> I also added the the line
> <driver type="xindice"
> class="org.apache.xindice.client.xmldb.DatabaseImpl"/>
> into the cocoon.xconf
> 
> 
> When I now try the request
>
http://vernjava:8080/cocoon/xmldb/addressbook?xpath=//person[lname=%27Cl
etus%2
> 7]
> 
> I got following exception:
> org.apache.cocoon.ProcessingException: Could not read resource
> xmldb:xindice://vernjava:4080/addressbook:
> java.lang.StringIndexOutOfBoundsException: String index out of range:
-11
> at
>
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:1
66)
> at
>
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(Cachi
ngEven
> tPipeline.java:255)
> 

Stack trace of the StringIndexOutOfBoundsException will be of greater
help. And the version of the Cocoon you are using.

Vadim


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: XMLDBGenerator

Posted by Stephan Michels <st...@vern.chem.tu-berlin.de>.

On Thu, 21 Feb 2002, Gianugo Rabellino wrote:

> Stephan Michels wrote:
> > I try to use cocoon with xindice.
>
> Please avoid, if possible, the XML:DB generators, swith to the Source
> implementation, which allows you to use straightforward XML:DB URIs in
> your sitemap. The generators are going to be deprecated and abandoned in
> a short while.

Okay, thank you.

> Anyway, as for your problem, try to correct this:
>
> > <base>xmldb:dbxml:///db/</base>
>
> Base should be is xmldb:xindice///db/.
>
> Also, you are getting the error from the XML:DB source protocol, not
> from the generators, please double check your settings:

I also added the the line
<driver type="xindice"
class="org.apache.xindice.client.xmldb.DatabaseImpl"/>
into the cocoon.xconf


When I now try the request
http://vernjava:8080/cocoon/xmldb/addressbook?xpath=//person[lname=%27Cletus%27]

I got following exception:
org.apache.cocoon.ProcessingException: Could not read resource
xmldb:xindice://vernjava:4080/addressbook:
java.lang.StringIndexOutOfBoundsException: String index out of range: -11
at
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:166)
at
org.apache.cocoon.components.pipeline.CachingEventPipeline.process(CachingEventPipeline.java:255)

If I try this in the cmdline:
>xindice xpath_query -c /db/addressbook -q //person[lname=\'Cletus\']
<?xml version="1.0"?>
<person xmlns:src="http://xml.apache.org/xindice/Query"
src:col="/db/addressbook" src:key="address2">
   <fname>SlackJawedLocal</fname>
   <lname>Cletus</lname>
   <phone type="work">123-456-7890</phone>
   <phone type="home">234-567-8901</phone>
   <phone type="cell">345-678-9012</phone>
   <email type="home">cletus@hotmail.com</email>
   <email type="work">cletus@micrsquish.com</email>
   <address type="home">1234 S. Elm St.</address>
   <address type="work">4567 W. Pine St.</address>
</person>

Have anyone an idea?


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: XMLDBGenerator

Posted by Gianugo Rabellino <gi...@apache.org>.
Stephan Michels wrote:
> I try to use cocoon with xindice. 

Please avoid, if possible, the XML:DB generators, swith to the Source 
implementation, which allows you to use straightforward XML:DB URIs in 
your sitemap. The generators are going to be deprecated and abandoned in 
a short while.

Anyway, as for your problem, try to correct this:

> <base>xmldb:dbxml:///db/</base>

Base should be is xmldb:xindice///db/.

Also, you are getting the error from the XML:DB source protocol, not 
from the generators, please double check your settings:

 > 
org.apache.cocoon.components.source.XMLDBSource.connect(XMLDBSource.java:206)
 > at
 > 
org.apache.cocoon.components.source.XMLDBSource.toSAX(XMLDBSource.java:223)
 > at
 > 
org.apache.cocoon.generation.FileGenerator.generate(FileGenerator.java:146)


Ciao,

-- 
Gianugo Rabellino


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>