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.<init>(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?
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>
---------------------------------------------------------------------
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: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>