You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "John R. Daily" <jd...@progeny.com> on 2002/12/23 02:09:25 UTC

ESQL taglib missing in action

I'm trying to convert a simple XSP application from AxKit to
Cocoon, and ESQL isn't being interpreted.

In my original application, the uninterpreted XML shows up in my
output documents.  To simplify my testing, I tried two things:

1) Running a simple example from the request taglib to make sure
   taglibs in general were working.  They were.

2) Running the sample ESQL from the Cocoon documentation, hoping
   I would get some sort of error to indicate that the sample
   database configuration wasn't present, but that the esql
   taglib was being invoked.  No such luck.

For the 2nd test, I used the following XSP page:

---
<xsp:page
      language="java"
      xmlns:xsp="http://apache.org/xsp"
      xmlns:esql="http://apache.org/cocoon/SQL/v2"
>
<esql:connection>
  <esql:pool>myConnection</esql:pool>
  <esql:execute-query>
    <esql:query>SELECT content FROM xml_document where id = 1</esql:query>
    <esql:results>
      <table>
        <esql:row-results>
          <tr>
             <td><esql:get-string column="content"/></td>
          </tr>
        </esql:row-results>
      </table>
    </esql:results>
    <esql:no-results>
       <p>Sorry, no results!</p>
    </esql:no-results>
  </esql:execute-query>
</esql:connection>
</xsp:page>
---


The entire contents of the resulting "HTML" page:
---
<esql:connection
xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:xsp="http://apache.org/xsp">
---

Note that my original application includes all the ESQL tags and
their contents; I don't know why I'm getting just the connection
tag from the sample app.


My pipeline from sitemap:
---
  <map:pipeline>
    <map:match pattern="db.html">
      <map:generate src="newsletter/xsp/db.xsp" type="serverpages"/>
      <map:serialize type="html"/>
    </map:match>
  </map:pipeline>
---


>From cocoon.xconf:
---
        <builtin-logicsheet>
          <parameter name="prefix" value="esql"/>
          <parameter name="uri" value="http://apache.org/cocoon/SQL/v2"/>
          <parameter name="href" value="resource://org/apache/cocoon/components/language/markup/xsp/java/esql.xsl"/>
        </builtin-logicsheet>
---

I'm using Postgres, and it's entirely possible that my JDBC
driver is not set up properly, but this doesn't strike me as a
database configuration problem if the esql tags are showing up in
the output.

Relevant software versions:
Java:   1.4.1 (beta, Blackdown release)
Tomcat: 4.1.18
Cocoon: 2.0.4

Many thanks for any assistance.  I started working with Cocoon
this weekend, so it's entirely possible I am overlooking
something obvious.

<tangent>
Incidentally, while experimenting with the JDBC connectivity, I
noticed that the JDBC example in the Cocoon documentation refers
to a class that doesn't exist: org.apache.cocoon.Roles.  Is this
a recent change that has not yet been documented?

On the topic of documentation, I also noticed that the API docs
don't link to the org.apache.avalon docs; that would seem to be a
particularly relevant API for cross-referencing.
</tangent>

--
John R. Daily                                        jdaily@progeny.com
Director of Technology                            Progeny Linux Systems
                    Master of the ephemeral epiphany

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

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


Re: ESQL taglib missing in action

Posted by "John R. Daily" <jd...@progeny.com>.
I'm trying a different approach, and now I'm getting Java
exceptions in Tomcat's logs.

Here is my XSP.  Switching to dbpool doesn't change the
exception.

----
<?xml version="1.0"?>

<xsp:page
      xmlns:xsp="http://apache.org/xsp"
      xmlns:esql="http://apache.org/cocoon/SQL/v2"
>
<esql:connection>

  <esql:execute-query>
      <esql:driver>org.postgresql.Driver</esql:driver>
      <esql:dburl>dbname=kb2</esql:dburl>
      <esql:username>jdaily</esql:username>
    <esql:query>SELECT id from xml_document</esql:query>
    <esql:results>
      <table>
        <esql:row-results>
          <esql:get-int column="title"/>
        </esql:row-results>
    </esql:results>
    <esql:no-results>
       Sorry, no results!
    </esql:no-results>
    <esql:error-results><esql:get-message /></esql:error-results>
  </esql:execute-query>
</esql:connection>
</xsp:page>
----

Clearly, now the ESQL XSL file is being invoked, because the
generated .java file includes SQL functionality.

However, I'm getting this from Tomcat's log:

----
2003-01-03 16:19:47 StandardWrapperValve[Cocoon2]: Servlet.service() for servlet Cocoon2 threw exception
java.lang.IllegalStateException
        at org.apache.coyote.tomcat4.CoyoteResponseFacade.reset(CoyoteResponseFacade.java:251)
        at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1115)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
        at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
        at java.lang.Thread.run(Thread.java:536)
----

Again, this is Cocoon 2.0.4, Tomcat 4.1.18, and Java 1.4.1-beta.

The postgresql driver exists in web.xml.

Thanks.

--
John R. Daily                                        jdaily@progeny.com
Director of Technology                            Progeny Linux Systems
                    Master of the ephemeral epiphany

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

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


Re: ESQL taglib missing in action

Posted by "John R. Daily" <jd...@progeny.com>.
Now that I have a small bit of time to return to this...

Correct me if I'm wrong, but assuming ESQL is being invoked, the
following XSP page should return either an error, or no output at
all:

---
<?xml version="1.0"?>

<xsp:page
	xmlns:xsp="http://apache.org/xsp"
        xmlns:esql="http://apache.org/xsp/SQL/v2"
>

    <esql:connection>
    </esql:connection>

</xsp:page>
---

Unfortunately, the content generated from the above:

---
<esql:connection xmlns:xsp="http://apache.org/xsp" xmlns:esql="http://apache.org/xsp/SQL/v2">
    </esql:connection>
---

The ESQL XSL page should transform that into something else.  The
.java file generated for the XSP page does not pull in any of the
imports that the XSL specifies.

I can't see any alternative other than Cocoon isn't invoking the
XSL for the ESQL taglib.

--
John R. Daily                                        jdaily@progeny.com
Director of Technology                            Progeny Linux Systems
                    Master of the ephemeral epiphany

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

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


RE: ESQL taglib missing in action

Posted by Geoff Howard <co...@leverageweb.com>.
Do the esql examples work?

> -----Original Message-----
> From: jdaily@progeny.com [mailto:jdaily@progeny.com]
> Sent: Sunday, December 22, 2002 8:09 PM
> To: cocoon-users@xml.apache.org
> Subject: ESQL taglib missing in action
>
>
> I'm trying to convert a simple XSP application from AxKit to
> Cocoon, and ESQL isn't being interpreted.
>
> In my original application, the uninterpreted XML shows up in my
> output documents.  To simplify my testing, I tried two things:
>
> 1) Running a simple example from the request taglib to make sure
>    taglibs in general were working.  They were.
>
> 2) Running the sample ESQL from the Cocoon documentation, hoping
>    I would get some sort of error to indicate that the sample
>    database configuration wasn't present, but that the esql
>    taglib was being invoked.  No such luck.
>
> For the 2nd test, I used the following XSP page:
>
> ---
> <xsp:page
>       language="java"
>       xmlns:xsp="http://apache.org/xsp"
>       xmlns:esql="http://apache.org/cocoon/SQL/v2"
> >
> <esql:connection>
>   <esql:pool>myConnection</esql:pool>
>   <esql:execute-query>
>     <esql:query>SELECT content FROM xml_document where id = 1</esql:query>
>     <esql:results>
>       <table>
>         <esql:row-results>
>           <tr>
>              <td><esql:get-string column="content"/></td>
>           </tr>
>         </esql:row-results>
>       </table>
>     </esql:results>
>     <esql:no-results>
>        <p>Sorry, no results!</p>
>     </esql:no-results>
>   </esql:execute-query>
> </esql:connection>
> </xsp:page>
> ---
>
>
> The entire contents of the resulting "HTML" page:
> ---
> <esql:connection
> xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1"
> xmlns:esql="http://apache.org/cocoon/SQL/v2"
> xmlns:xsp="http://apache.org/xsp">
> ---
>
> Note that my original application includes all the ESQL tags and
> their contents; I don't know why I'm getting just the connection
> tag from the sample app.
>
>
> My pipeline from sitemap:
> ---
>   <map:pipeline>
>     <map:match pattern="db.html">
>       <map:generate src="newsletter/xsp/db.xsp" type="serverpages"/>
>       <map:serialize type="html"/>
>     </map:match>
>   </map:pipeline>
> ---
>
>
> >From cocoon.xconf:
> ---
>         <builtin-logicsheet>
>           <parameter name="prefix" value="esql"/>
>           <parameter name="uri" value="http://apache.org/cocoon/SQL/v2"/>
>           <parameter name="href"
> value="resource://org/apache/cocoon/components/language/markup/xsp
> /java/esql.xsl"/>
>         </builtin-logicsheet>
> ---
>
> I'm using Postgres, and it's entirely possible that my JDBC
> driver is not set up properly, but this doesn't strike me as a
> database configuration problem if the esql tags are showing up in
> the output.
>
> Relevant software versions:
> Java:   1.4.1 (beta, Blackdown release)
> Tomcat: 4.1.18
> Cocoon: 2.0.4
>
> Many thanks for any assistance.  I started working with Cocoon
> this weekend, so it's entirely possible I am overlooking
> something obvious.
>
> <tangent>
> Incidentally, while experimenting with the JDBC connectivity, I
> noticed that the JDBC example in the Cocoon documentation refers
> to a class that doesn't exist: org.apache.cocoon.Roles.  Is this
> a recent change that has not yet been documented?
>
> On the topic of documentation, I also noticed that the API docs
> don't link to the org.apache.avalon docs; that would seem to be a
> particularly relevant API for cross-referencing.
> </tangent>
>
> --
> John R. Daily                                        jdaily@progeny.com
> Director of Technology                            Progeny Linux Systems
>                     Master of the ephemeral epiphany
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>
>
>


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

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


AW: ESQL taglib missing in action

Posted by Nils Leßmann <ni...@students.uni-mannheim.de>.
hi john,

just a few things to try out:

it seems to me that an exception is thrown from esql (that's why the
result stops after the opening tag). either have a look into the logs
for the exception or include something like

<esql:error-results><esql:get-message /></esql:error-results>

into your connection tag. this might help you track down the error.

possible sources:

you should be sure that the jdbc settings for your pool are correct.
test with a small java program (like Class.forName("org.postgres...");
DriverManager.getConnection("jdbc://postgres...","user","passwd");) and
check if that works.

check that your db driver gets loaded at startup (did you put it in
web.xml?). you'll find a log entry stating that.

bye, nils



________________________________________________
Nils Leßmann
Stockacher Str. 38
68239 Mannheim
 
0175 - 814 899 8
 
 

-----Ursprüngliche Nachricht-----
Von: jdaily@progeny.com [mailto:jdaily@progeny.com] 
Gesendet: Montag, 23. Dezember 2002 02:09
An: cocoon-users@xml.apache.org
Betreff: ESQL taglib missing in action

I'm trying to convert a simple XSP application from AxKit to
Cocoon, and ESQL isn't being interpreted.

In my original application, the uninterpreted XML shows up in my
output documents.  To simplify my testing, I tried two things:

1) Running a simple example from the request taglib to make sure
   taglibs in general were working.  They were.

2) Running the sample ESQL from the Cocoon documentation, hoping
   I would get some sort of error to indicate that the sample
   database configuration wasn't present, but that the esql
   taglib was being invoked.  No such luck.

For the 2nd test, I used the following XSP page:

---
<xsp:page
      language="java"
      xmlns:xsp="http://apache.org/xsp"
      xmlns:esql="http://apache.org/cocoon/SQL/v2"
>
<esql:connection>
  <esql:pool>myConnection</esql:pool>
  <esql:execute-query>
    <esql:query>SELECT content FROM xml_document where id =
1</esql:query>
    <esql:results>
      <table>
        <esql:row-results>
          <tr>
             <td><esql:get-string column="content"/></td>
          </tr>
        </esql:row-results>
      </table>
    </esql:results>
    <esql:no-results>
       <p>Sorry, no results!</p>
    </esql:no-results>
  </esql:execute-query>
</esql:connection>
</xsp:page>
---


The entire contents of the resulting "HTML" page:
---
<esql:connection
xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:xsp="http://apache.org/xsp">
---

Note that my original application includes all the ESQL tags and
their contents; I don't know why I'm getting just the connection
tag from the sample app.


My pipeline from sitemap:
---
  <map:pipeline>
    <map:match pattern="db.html">
      <map:generate src="newsletter/xsp/db.xsp" type="serverpages"/>
      <map:serialize type="html"/>
    </map:match>
  </map:pipeline>
---


>>From cocoon.xconf:
---
        <builtin-logicsheet>
          <parameter name="prefix" value="esql"/>
          <parameter name="uri"
value="http://apache.org/cocoon/SQL/v2"/>
          <parameter name="href"
value="resource://org/apache/cocoon/components/language/markup/xsp/java/
esql.xsl"/>
        </builtin-logicsheet>
---

I'm using Postgres, and it's entirely possible that my JDBC
driver is not set up properly, but this doesn't strike me as a
database configuration problem if the esql tags are showing up in
the output.

Relevant software versions:
Java:   1.4.1 (beta, Blackdown release)
Tomcat: 4.1.18
Cocoon: 2.0.4

Many thanks for any assistance.  I started working with Cocoon
this weekend, so it's entirely possible I am overlooking
something obvious.

<tangent>
Incidentally, while experimenting with the JDBC connectivity, I
noticed that the JDBC example in the Cocoon documentation refers
to a class that doesn't exist: org.apache.cocoon.Roles.  Is this
a recent change that has not yet been documented?

On the topic of documentation, I also noticed that the API docs
don't link to the org.apache.avalon docs; that would seem to be a
particularly relevant API for cross-referencing.
</tangent>

--
John R. Daily                                        jdaily@progeny.com
Director of Technology                            Progeny Linux Systems
                    Master of the ephemeral epiphany

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

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


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

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