You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Matthew Cordes <mc...@maine.edu> on 2000/12/18 22:17:44 UTC

esql 1.39 bug?

Hello all,


I'm having a problem with esql 1.39 ( the most recent from cvs ).  
I get a null pointer exception in the following block:

<esql:error-results>
  <xsp:attribute name="fatal-error"><xsp:get-message/></xsp:attribute>
  <stacktrace><esql:get-stacktrace/></stacktrace>
</esql:error-results>


The exception's stacktrace refers to  these lines of generated code:

xspCurrentNode.appendChild(
  xspExpr(_esql_exception_writer.toString(), document)
);
                  

If I comment out <esql:error-results> and children I now get a null pointer 
in this line of generated code:

if (_esql_query.position == _esql_query.skip_rows) {

which seems to be refering to my <esql:no-results> block. After commenting
that out as well the page compiles and runs, but the xml produced contains 
the esql tags word for word from my xsp document except the <esql:results>
tags are removed.

Here is my complete page:

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>

<xsp:page language="java"
  xmlns:esql="http://apache.org/cocoon/SQL/v2"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
>

<page>
  <esql:execute-query>
    <esql:use-connection>myConn</esql:use-connection>

    <esql:query>
      select id, title, expire_time from tableXYZ
        where survey_id = <esql:parameter><xsp:expr>"1"</xsp:expr></esql:parameter>
    </esql:query>

    <esql:results>
      <id><esql:get-string column="id"/></id>
      <title><esql:get-string column="title"/></title>
      <expire><esql:get-string column="expire_time"/></expire>
    </esql:results>

<!--    
    <esql:error-results>
      <xsp:attribute name="fatal-error"><xsp:get-message/></xsp:attribute>
      <stacktrace><esql:get-stacktrace/></stacktrace>
    </esql:error-results>
-->
<!--
    <esql:no-results>
      <xsp:parameter name="no-results">1</xsp:parameter>
    </esql:no-results>
-->
  </esql:execute-query>

</page>
</xsp:page>



And Output:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<page>

<esql:execute-query>
  <esql:use-connection>myConn</esql:use-connection>

  <esql:query>
    select id, title, expire_time from tableXYZ
      where survey_id = &quot;?&quot;
  </esql:query>

  <id><esql:get-string column="id"></esql:get-string></id>
  <title><esql:get-string column="id"></esql:get-string></title>
  <expire><esql:get-string column="id"></esql:get-string></expire>
                     
</esql:execute-query>
</page>


Notice the <esql:results> tags are missing.  Any ideas?  

NOTE:  I am using the newest cvs esql with cocoon 1.8, and the cvs 
version of the turbine connection pool.

-matt

Re: esql 1.39 bug?

Posted by Matthew Cordes <mc...@maine.edu>.
All, 

Please disregard this message.  I did not realize esql had changed 
so much. After reading the logicsheet now everything makes sense.
Sorry for the inconvience.

-matt


On Mon, Dec 18, 2000 at 04:17:44PM -0500, Matthew Cordes wrote:
> Hello all,
> 
> 
> I'm having a problem with esql 1.39 ( the most recent from cvs ).  
> I get a null pointer exception in the following block:
> 
> <esql:error-results>
>   <xsp:attribute name="fatal-error"><xsp:get-message/></xsp:attribute>
>   <stacktrace><esql:get-stacktrace/></stacktrace>
> </esql:error-results>
> 
> 
> The exception's stacktrace refers to  these lines of generated code:
> 
> xspCurrentNode.appendChild(
>   xspExpr(_esql_exception_writer.toString(), document)
> );
>                   
> 
> If I comment out <esql:error-results> and children I now get a null pointer 
> in this line of generated code:
> 
> if (_esql_query.position == _esql_query.skip_rows) {
> 
> which seems to be refering to my <esql:no-results> block. After commenting
> that out as well the page compiles and runs, but the xml produced contains 
> the esql tags word for word from my xsp document except the <esql:results>
> tags are removed.
> 
> Here is my complete page:
> 
> <?xml version="1.0"?>
> <?cocoon-process type="xsp"?>
> 
> <xsp:page language="java"
>   xmlns:esql="http://apache.org/cocoon/SQL/v2"
>   xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> >
> 
> <page>
>   <esql:execute-query>
>     <esql:use-connection>myConn</esql:use-connection>
> 
>     <esql:query>
>       select id, title, expire_time from tableXYZ
>         where survey_id = <esql:parameter><xsp:expr>"1"</xsp:expr></esql:parameter>
>     </esql:query>
> 
>     <esql:results>
>       <id><esql:get-string column="id"/></id>
>       <title><esql:get-string column="title"/></title>
>       <expire><esql:get-string column="expire_time"/></expire>
>     </esql:results>
> 
> <!--    
>     <esql:error-results>
>       <xsp:attribute name="fatal-error"><xsp:get-message/></xsp:attribute>
>       <stacktrace><esql:get-stacktrace/></stacktrace>
>     </esql:error-results>
> -->
> <!--
>     <esql:no-results>
>       <xsp:parameter name="no-results">1</xsp:parameter>
>     </esql:no-results>
> -->
>   </esql:execute-query>
> 
> </page>
> </xsp:page>
> 
> 
> 
> And Output:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
> <page>
> 
> <esql:execute-query>
>   <esql:use-connection>myConn</esql:use-connection>
> 
>   <esql:query>
>     select id, title, expire_time from tableXYZ
>       where survey_id = &quot;?&quot;
>   </esql:query>
> 
>   <id><esql:get-string column="id"></esql:get-string></id>
>   <title><esql:get-string column="id"></esql:get-string></title>
>   <expire><esql:get-string column="id"></esql:get-string></expire>
>                      
> </esql:execute-query>
> </page>
> 
> 
> Notice the <esql:results> tags are missing.  Any ideas?  
> 
> NOTE:  I am using the newest cvs esql with cocoon 1.8, and the cvs 
> version of the turbine connection pool.
> 
> -matt
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>