cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominic Reynolds <domi...@lantnern.com>
Subject Re: ESQL erros - cocoon2.0.3
Date Tue, 30 Jul 2002 17:42:31 GMT
Chris,
  I have attached the output (including stack trace).

  I haven't got any esql to work. I even tried not using the datasource 
(even though it works in the actions i've created) and include the esql 
tags for drive, url, username etc. and the reult is the same: the 
compiled java doesn't seem to be supplying an ESQLConnection reference 
(thats intantiated) to the ESQLQuery class.

Thanks for your help,
dominic.

Christian Haul wrote:

>On 29.Jul.2002 -- 01:23 PM, Dominic Reynolds wrote:
>  
>
>> I am trying to use ESQL (basic xsp page modelled on the samples).
>>
>>my problem is that I get the following null pointer exception:
>>
>>Original exception : java.lang.NullPointerException
>>       at 
>>org.apache.cocoon.components.language.markup.xsp.EsqlQuery.&lt;init&gt;(EsqlQuery.java:99)
>>
>>
>>And looking at the source it seems that I'm not passing a connection to 
>>the constructor:
>>Esql.java -
>>
>>public EsqlQuery( EsqlConnection connection, String query ) {
>>   this.connection = connection;
>>   this.limitMethod = connection.getLimitMethod();   << line 99
>>
>>
>>Now looking at the generated java code for my xsp:
>>cocoon-files/org/apache/cocoon/www/upgrades/docs/upgrade_xsp.java
>>is see:
>>
>> private EsqlConnectionCocoon2 _esql_connection = null;
>>// .
>>// . some non-connection related java stuff......
>>// .
>>_esql_query = new EsqlQuery( _esql_connection, String.valueOf(
>>     ""       + "SELECT guid FROM appliances WHERE guid="                +
>>       (request.getHeader("guid"))
>>     ) );
>>
>>
>>So the generated java code is incorrect. I know the datasource i'm using 
>>is ok as I am using it in an action and it works fine.
>>I must be doing something wrong here...but what?
>>    
>>
>
>Everything looks fine. Could you produce a complete stack trace?
>Other XSPs using esql work fine, right?
>
>  
>
>>Below is the xsp that is called:
>>
>><?xml version="1.0"?>
>><xsp:page
>>     language="java"
>>     xmlns:xsp="http://apache.org/xsp"
>>     xmlns:esql="http://apache.org/cocoon/SQL/v2"
>>     xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>>   >
>>   <esql:connection>
>>     <esql:pool>regdata</esql:pool>
>>     <esql:execute-query>
>>       <esql:query>SELECT guid FROM appliances WHERE 
>>guid=<xsp-request:get-header name="guid"/></esql:query>
>>       <esql:results>
>>         <table>
>>           <esql:row-results>
>>             <tr>
>>                <td><esql:get-string column="product"/></td>
>>                <!--
>><xsp:attribute name="value"><esql:get-string column="id"/></xsp:attribute>
>>             </tr>
>>           </esql:row-results>
>>         </table>
>>  </esql:results>
>>       <esql:no-results>
>>          <p>Sorry No record</p>
>>       </esql:no-results>
>>     </esql:execute-query>
>>   </esql:connection>
>></xsp:page>
>>    
>>
>
>	Chris.
>  
>



Mime
View raw message