You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Tobias Luikard <t....@exxcellent.de> on 2001/09/21 13:10:36 UTC

Cocoon and dbXML

Hi out there,

I try to use Cocoon2 (b2) with dbXML. Has anyone done this before?

For tests I wrote a Cocoon Action. The problem is, that when I try to
add a document to the db everything works fine until I want to receive
the collection. When I try the example by the main class everything
works fine (the code is nearly identical). But in the map act() method
the code is executed until line 49, then comes the "finally" code
without any Exception thrown. Its a miracle to me.

Is it possible that Cocoon resticts here something that dbXML has to
use?

Has anyone any hints?

Thanks for your help

Tobias



Re: Cocoon and dbXML

Posted by Tobias Luikard <t....@exxcellent.de>.
Hi Gianugo,

now i works. I only added the jar to the
jakarta-tomcat-3.2.3\webapps\cocoon\WEB-INF\lib directory with doesn't work. In
the
jakarta-tomcat-3.2.3\lib\ directory they were better treated .-)

I'm so happy .-)

By

Tobi

Tobias Luikard wrote:

> Hi Gianugo,
>
> this Classes work? Cool, then there is hope :-)
>
> What *.jar did you copy and where? Only the driver-jar (xmldb.jar) or
> something else too? (I copied all jars into $cocoon$/lib and made a new build)
>
> Thanks a lot
>
> Tobias
> - the man with no idea why it dosn't work -
>
> Gianugo Rabellino wrote:
>
> > Tobias,
> >
> > > I try to use Cocoon2 (b2) with dbXML. Has anyone done this before?
> >
> > In the CVS version of Cocoon there are a couple of generators that I wrote
> > for dbXML: I had no problem at all in making dbXML work with Cocoon, you
> > might want to start investigating from there. Let me know if you need any
> > assistance.
> >
> > 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>
>
> --
> Tobias Luikard
>
> ____ |X________________________
>     X|
>
>  eXXcellent solutions gmbh
>  In der Wanne 55
>
>  D-89075 Ulm
>
>  e | T.Luikard@eXXcellent.de
>  t | +49 [0]731-55026-22
>  f | +49 [0]731-55026-99
>  i | www.eXXcellent.de
>
> ---------------------------------------------------------------------
> 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>

--
Tobias Luikard

____ |X________________________
    X|

 eXXcellent solutions gmbh
 In der Wanne 55

 D-89075 Ulm

 e | T.Luikard@eXXcellent.de
 t | +49 [0]731-55026-22
 f | +49 [0]731-55026-99
 i | www.eXXcellent.de



---------------------------------------------------------------------
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: Cocoon and dbXML

Posted by Tobias Luikard <t....@exxcellent.de>.
Hi Gianugo,

this Classes work? Cool, then there is hope :-)

What *.jar did you copy and where? Only the driver-jar (xmldb.jar) or
something else too? (I copied all jars into $cocoon$/lib and made a new build)

Thanks a lot

Tobias
- the man with no idea why it dosn't work -


Gianugo Rabellino wrote:

> Tobias,
>
> > I try to use Cocoon2 (b2) with dbXML. Has anyone done this before?
>
> In the CVS version of Cocoon there are a couple of generators that I wrote
> for dbXML: I had no problem at all in making dbXML work with Cocoon, you
> might want to start investigating from there. Let me know if you need any
> assistance.
>
> 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>

--
Tobias Luikard

____ |X________________________
    X|

 eXXcellent solutions gmbh
 In der Wanne 55

 D-89075 Ulm

 e | T.Luikard@eXXcellent.de
 t | +49 [0]731-55026-22
 f | +49 [0]731-55026-99
 i | www.eXXcellent.de



---------------------------------------------------------------------
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: Cocoon and dbXML

Posted by Gianugo Rabellino <g....@bibop.it>.
Tobias,

> I try to use Cocoon2 (b2) with dbXML. Has anyone done this before?

In the CVS version of Cocoon there are a couple of generators that I wrote
for dbXML: I had no problem at all in making dbXML work with Cocoon, you
might want to start investigating from there. Let me know if you need any
assistance.

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>


Re: Cocoon and dbXML

Posted by Tobias Luikard <t....@exxcellent.de>.
Thanks a lot. It works fine.

Tobi

Gianugo Rabellino wrote:

> Tobias,
>
> > dbXML sends a startdocument() and a stopdocument() althought the XSP
> has
> > done this already. I pached the code so the dbXML doen't anymore.
> Until now
> > no side effect are detected (The db server runs with the old
> (unpached)
> > *.jar).
>
> nice to know that you solved the problem. I might suggest you, though,
> what I think is a better solution: instead of patching dbXML you may
> just use a consumer that ignores the start and endDocument events. There
> is an utility class which does exactly so, look in
> org.apache.cocoon.xml.IncludeXMLConsumer, which takes an XMLConsumer as
> a parameter in the constructor to forward events to. Basically this
> should be enough for you:
>
> document.getContentAsSAX(new IncludeXMLConsumer(xmlConsumer));
>
> Let me know if you are willing to try it and if it works: this would
> save you from having to continuously patch dbXML whenever a new version
> comes out.
>
> Ciao,
>
> --
> Gianugo
>
> ---------------------------------------------------------------------
> 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>

--
Tobias Luikard

____ |X________________________
    X|

 eXXcellent solutions gmbh
 In der Wanne 55

 D-89075 Ulm

 e | T.Luikard@eXXcellent.de
 t | +49 [0]731-55026-22
 f | +49 [0]731-55026-99
 i | www.eXXcellent.de



---------------------------------------------------------------------
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: Cocoon and dbXML

Posted by Gianugo Rabellino <gi...@rabellino.it>.
Tobias,

> dbXML sends a startdocument() and a stopdocument() althought the XSP
has
> done this already. I pached the code so the dbXML doen't anymore.
Until now
> no side effect are detected (The db server runs with the old
(unpached)
> *.jar).

nice to know that you solved the problem. I might suggest you, though,
what I think is a better solution: instead of patching dbXML you may
just use a consumer that ignores the start and endDocument events. There
is an utility class which does exactly so, look in
org.apache.cocoon.xml.IncludeXMLConsumer, which takes an XMLConsumer as
a parameter in the constructor to forward events to. Basically this
should be enough for you:

document.getContentAsSAX(new IncludeXMLConsumer(xmlConsumer));

Let me know if you are willing to try it and if it works: this would
save you from having to continuously patch dbXML whenever a new version
comes out.

Ciao,

--
Gianugo


---------------------------------------------------------------------
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: Cocoon and dbXML

Posted by Tobias Luikard <t....@exxcellent.de>.
Hi Gianugo,

I solved the problem.

dbXML sends a startdocument() and a stopdocument() althought the XSP has
done this already. I pached the code so the dbXML doen't anymore. Until now
no side effect are detected (The db server runs with the old (unpached)
*.jar).

Now everything works fine. .-)

By

Tobi

Gianugo Rabellino wrote:

> Tobias,
>
> > But a last question bevor the weekend I got left. Maybe Gianugo can
> help. The
> > adding of the XML to the XMLdb works fine. But the reading is a little
> bit
> > tricky. I don't wont to use a Generator for this. I'd like to have it
> in a XSP
> > side. For this I capsuled the required functionality in a class (this
> makes
> > the XSP easier)
>
> I'm sorry for the delay in this reply, I had to catch up with some stuff
> before I was able to read my past email :/. I read your code and it
> looks just fine. I must confess, however, that I'm almost totally
> ignorant when it comes to XSP, so I cannot see the whole picture. Is it
> legal/advised/good thing to stream sax events directly to the
> xmlConsumer in an XSP page? It makes sense it is, but it's the only
> possible point of failure that I see.
>
> Let me know if the problem is solved, I'm interested in it. I hope to
> find some time to write the XMLDB part as a protocol so that doing
> operations like the one you need might become just a matter of
> (X|C)Include.
>
> Ciao,
>
> --
> Gianugo
>
> ---------------------------------------------------------------------
> 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>

--
Tobias Luikard

____ |X________________________
    X|

 eXXcellent solutions gmbh
 In der Wanne 55

 D-89075 Ulm

 e | T.Luikard@eXXcellent.de
 t | +49 [0]731-55026-22
 f | +49 [0]731-55026-99
 i | www.eXXcellent.de



---------------------------------------------------------------------
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: Cocoon and dbXML

Posted by Gianugo Rabellino <gi...@rabellino.it>.
Tobias,

> But a last question bevor the weekend I got left. Maybe Gianugo can
help. The
> adding of the XML to the XMLdb works fine. But the reading is a little
bit
> tricky. I don't wont to use a Generator for this. I'd like to have it
in a XSP
> side. For this I capsuled the required functionality in a class (this
makes
> the XSP easier)

I'm sorry for the delay in this reply, I had to catch up with some stuff
before I was able to read my past email :/. I read your code and it
looks just fine. I must confess, however, that I'm almost totally
ignorant when it comes to XSP, so I cannot see the whole picture. Is it
legal/advised/good thing to stream sax events directly to the
xmlConsumer in an XSP page? It makes sense it is, but it's the only
possible point of failure that I see.

Let me know if the problem is solved, I'm interested in it. I hope to
find some time to write the XMLDB part as a protocol so that doing
operations like the one you need might become just a matter of
(X|C)Include.

Ciao,

--
Gianugo


---------------------------------------------------------------------
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: Cocoon and dbXML

Posted by Tobias Luikard <t....@exxcellent.de>.
Hi,

thank god it's friday .-)

But a last question bevor the weekend I got left. Maybe Gianugo can help. The
adding of the XML to the XMLdb works fine. But the reading is a little bit
tricky. I don't wont to use a Generator for this. I'd like to have it in a XSP
side. For this I capsuled the required functionality in a class (this makes
the XSP easier)

But somehow the data from the db wont be added to the pipeline. I tried
different ways. The data were correct read (the System.out.println ()  works),
but in the pipeline they were not.

Has anyone any hints??

Thanks a lot

Tobias

Attached:

test.xsp - the XSP Site using the DBContainer
DBContainer.java - the Container Class encasuling the functionality

Tobias Luikard wrote:

> Hi out there,
>
> I try to use Cocoon2 (b2) with dbXML. Has anyone done this before?
>
> For tests I wrote a Cocoon Action. The problem is, that when I try to
> add a document to the db everything works fine until I want to receive
> the collection. When I try the example by the main class everything
> works fine (the code is nearly identical). But in the map act() method
> the code is executed until line 49, then comes the "finally" code
> without any Exception thrown. Its a miracle to me.
>
> Is it possible that Cocoon resticts here something that dbXML has to
> use?
>
> Has anyone any hints?
>
> Thanks for your help
>
> Tobias
>
>   ------------------------------------------------------------------------
>                        Name: DBAdderTest.java
>    DBAdderTest.java    Type: JavaScript Program (application/x-javascript)
>                    Encoding: 8bit
>
>   ------------------------------------------------------------------------
> ---------------------------------------------------------------------
> 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>

--
Tobias Luikard

____ |X________________________
    X|

 eXXcellent solutions gmbh
 In der Wanne 55

 D-89075 Ulm

 e | T.Luikard@eXXcellent.de
 t | +49 [0]731-55026-22
 f | +49 [0]731-55026-99
 i | www.eXXcellent.de


RE: Cocoon and dbXML

Posted by Vadim Gritsenko <va...@verizon.net>.
Tobias,

Please add catch statement for throwable and try again:

      catch (Exception e) {
        System.out.println(e.toString() );
      }
      catch (Throwable e) {
        e.printStackTrace();
      }
      finally {

I am sure that there are no miracles of this kind in Java.

Vadim

> -----Original Message-----
> From: Tobias Luikard [mailto:t.luikard@exxcellent.de]
> Sent: Friday, September 21, 2001 7:11 AM
> To: cocoon-users@xml.apache.org
> Subject: Cocoon and dbXML
> 
> 
> Hi out there,
> 
> I try to use Cocoon2 (b2) with dbXML. Has anyone done this before?
> 
> For tests I wrote a Cocoon Action. The problem is, that when I try to
> add a document to the db everything works fine until I want to receive
> the collection. When I try the example by the main class everything
> works fine (the code is nearly identical). But in the map act() method
> the code is executed until line 49, then comes the "finally" code
> without any Exception thrown. Its a miracle to me.
> 
> Is it possible that Cocoon resticts here something that dbXML has to
> use?
> 
> Has anyone any hints?
> 
> Thanks for your help
> 
> Tobias
> 
> 
> 

---------------------------------------------------------------------
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>