You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "von Schwerdtner, Thomas (GXS, FPI)" <Th...@gxs.ge.com> on 2002/03/20 19:21:37 UTC
jdbc or xsp or esql problem
Hey folks,
Setup:
cocoon-2.0.2dev (can give snapshot date if needed, it's from about a week
ago)
tomcat 4.0.3-LE
jdk1.4
linux
java2/1.2/1.3/1.4 postgresql jdbc driver is in classpath (downloaded bianry
from jdbc.postgresql.org which specified that it would work with 1.4 (but it
also specified it could not be compiled with it).
Problem:
I'm trying to get esql/postgresql setup here, and with a small xsp page I am
getting the following errors:
Fancypants error page reports:
========================================================================
org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
test_xsp:
Line 315, column 5: ')' expected
Line 431, column 20: not a statement
Line 460, column 20: not a statement
Line 460, column 28: ';' expected
Line 310, column 36: 'void' type not allowed here
Line 354, column 84: unreported exception: java.sql.SQLException; must be
caught or declared to be thrown
Line 378, column 84: unreported exception: java.sql.SQLException; must be
caught or declared to be thrown
Line 405, column 51: unreported exception: java.sql.SQLException; must be
caught or declared to be thrown
Line 414, column 27: unreported exception: java.sql.SQLException; must be
caught or declared to be thrown
Line 0, column 0:
9 errors
========================================================================
sitemap contains:
========================================================================
<map:generator name="serverpages"
src="org.apache.cocoon.generation.ServerPagesGenerator"
label="content,data"
logger="sitemap.generator.serverpages"
pool-max="32" pool-min="4" pool-grow="2"/>
<!-- and later in the file -->
<map:match pattern="test-esql">
<map:generate type="serverpages"
src="documents/test.xsp"/>
<map:transform
src="stylesheets/databases/view.xsl"/>
<map:serialize/>
</map:match>
========================================================================
cocoon.xconf contains:
========================================================================
<datasources>
<jdbc logger="core.datasources.gesupply" name="gesupply">
<pool-controller max="10" min="5"/>
<dburl>jdbc:postgresql://localhost:5432/gesupply</dburl>
<user>myUname</user>
<password>myPassword</password>
</jdbc>
</datasources>
========================================================================
web.xml contains:
========================================================================
<init-param>
<param-name>load-class</param-name>
<param-value>org.postgresql.Driver</param-value>
</init-param>
========================================================================
the stylesheet for test.xsp is a copy of the xsp stylesheet(s) from the
cocoon samples.
test.xsp contains:
========================================================================
<xsp:page
xmlns:xsp="http://apache.org/xsp"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
language="java">
<esql:connection>
<esql:pool>gesupply</esql:pool>
<esql:execute-query>
<esql:query>SELECT
Id,SupportClassId,Type,Description FROM supporttype<esql:results>
<table>
<esql:row-results>
<tr>
<td>
<esql:get-string column="Id"/></td><td>
<esql:get-string column="Type"/></td>
</tr>
</esql:row-results>
</table>
</esql:results>
<esql:no-results>
<p>Sorry, no results!</p>
</esql:no-results>
</esql:query>
</esql:execute-query>
</esql:connection>
</xsp:page>
========================================================================
Re: jdbc or xsp or esql problem
Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 20.Mar.2002 -- 01:21 PM, von Schwerdtner, Thomas (GXS, FPI) wrote:
> test.xsp contains:
> ========================================================================
> <xsp:page
> xmlns:xsp="http://apache.org/xsp"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xmlns:esql="http://apache.org/cocoon/SQL/v2"
> language="java">
>
> <esql:connection>
> <esql:pool>gesupply</esql:pool>
> <esql:execute-query>
> <esql:query>SELECT
> Id,SupportClassId,Type,Description FROM supporttype<esql:results>
> <table>
> <esql:row-results>
> <tr>
> <td>
>
> <esql:get-string column="Id"/></td><td>
>
> <esql:get-string column="Type"/></td>
> </tr>
> </esql:row-results>
> </table>
> </esql:results>
> <esql:no-results>
> <p>Sorry, no results!</p>
> </esql:no-results>
> </esql:query>
> </esql:execute-query>
> </esql:connection>
> </xsp:page>
This is wrong esql syntax. You need to end your query tag at the end
of the query, it does not span the results.
Try
<esql:connection>
<esql:pool>gesupply</esql:pool>
<esql:execute-query>
<esql:query>SELECT Id,SupportClassId,Type,Description FROM supporttype</esql:query>
<esql:results>
<table>
<esql:row-results>
<tr>
<td><esql:get-string column="Id"/></td>
<td><esql:get-string column="Type"/></td>
</tr>
</esql:row-results>
</table>
</esql:results>
<esql:no-results>
<p>Sorry, no results!</p>
</esql:no-results>
</esql:execute-query>
</esql:connection>
Chris.
--
C h r i s t i a n H a u l
haul@informatik.tu-darmstadt.de
fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08
---------------------------------------------------------------------
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: jdbc or xsp or esql problem
Posted by Ivan Rubin <ia...@mcsla.com.ar>.
von Schwerdtner, Thomas (GXS, FPI) wrote:
> Hey folks,
>
> Setup:
> cocoon-2.0.2dev (can give snapshot date if needed, it's from about a
> week ago)
> tomcat 4.0.3-LE
> jdk1.4
> linux
> java2/1.2/1.3/1.4 postgresql jdbc driver is in classpath (downloaded
> bianry from jdbc.postgresql.org which specified that it would work with
> 1.4 (but it also specified it could not be compiled with it).
>
> Problem:
> I'm trying to get esql/postgresql setup here, and with a small xsp page
> I am getting the following errors:
>
>
> Fancypants error page reports:
> ========================================================================
> org.apache.cocoon.ProcessingException: Language Exception:
> org.apache.cocoon.components.language.LanguageException: Error compiling
> test_xsp:
>
> Line 315, column 5: ')' expected
> Line 431, column 20: not a statement
> Line 460, column 20: not a statement
> Line 460, column 28: ';' expected
> Line 310, column 36: 'void' type not allowed here
> Line 354, column 84: unreported exception: java.sql.SQLException; must
> be caught or declared to be thrown
> Line 378, column 84: unreported exception: java.sql.SQLException; must
> be caught or declared to be thrown
> Line 405, column 51: unreported exception: java.sql.SQLException; must
> be caught or declared to be thrown
> Line 414, column 27: unreported exception: java.sql.SQLException; must
> be caught or declared to be thrown
> Line 0, column 0:
> 9 errors
> ========================================================================
Under the work directory you'll find the generated .java for your xsp page.
I think you should enclose your content in between <xsp:content> tags.
>
>
> sitemap contains:
> ========================================================================
> <map:generator name="serverpages"
>
> src="org.apache.cocoon.generation.ServerPagesGenerator"
> label="content,data"
> logger="sitemap.generator.serverpages"
> pool-max="32" pool-min="4" pool-grow="2"/>
>
> <!-- and later in the file -->
>
> <map:match pattern="test-esql">
> <map:generate type="serverpages"
> src="documents/test.xsp"/>
> <map:transform
> src="stylesheets/databases/view.xsl"/>
> <map:serialize/>
> </map:match>
> ========================================================================
>
> cocoon.xconf contains:
> ========================================================================
> <datasources>
> <jdbc logger="core.datasources.gesupply" name="gesupply">
> <pool-controller max="10" min="5"/>
>
> <dburl>jdbc:postgresql://localhost:5432/gesupply</dburl>
> <user>myUname</user>
> <password>myPassword</password>
> </jdbc>
> </datasources>
> ========================================================================
>
> web.xml contains:
> ========================================================================
> <init-param>
> <param-name>load-class</param-name>
> <param-value>org.postgresql.Driver</param-value>
> </init-param>
> ========================================================================
>
> the stylesheet for test.xsp is a copy of the xsp stylesheet(s) from the
> cocoon samples.
> test.xsp contains:
> ========================================================================
> <xsp:page
> xmlns:xsp="http://apache.org/xsp"
> xmlns:xlink="http://www.w3.org/1999/xlink"
> xmlns:esql="http://apache.org/cocoon/SQL/v2"
> language="java">
>
> <esql:connection>
> <esql:pool>gesupply</esql:pool>
> <esql:execute-query>
> <esql:query>SELECT
> Id,SupportClassId,Type,Description FROM supporttype<esql:results>
> <table>
> <esql:row-results>
> <tr>
> <td>
>
> <esql:get-string column="Id"/></td><td>
>
> <esql:get-string column="Type"/></td>
> </tr>
> </esql:row-results>
> </table>
> </esql:results>
> <esql:no-results>
> <p>Sorry, no results!</p>
> </esql:no-results>
> </esql:query>
> </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/faqs.html>
To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: jdbc or xsp or esql problem
Posted by tv...@etria.org.
Keeping in mind I do not know a hell of a lot about java or jdbc, does it
make any sense that I can write a little test program in java, and have it
connect to the database just fine with the jdbc driver, but when used in
cocoon, I get a slew of errors?
The java program only goes up to "DriverManager.getConnection" and if that
dosent throw an exception, it assumes that all went well. Is this at all a
reasonable test to expect Cocoon to then at least show that it makes a
connection for the pool?
I'm just wondering if I'm not causing myself grief when my real problem is
in my Cocoon settings (which were included at the beginning of this
thread).
-Tom
On Wed, Mar 20, 2002, tvon@etria.org wrote:
> On Wed, Mar 20, 2002, leo leonid wrote:
> > do the e?sql-samples work that come with the distribution using the
> > hsqldb-server?
> > I bet they don't.
>
> You are correct. I just built a recent (past few days) CVS snapshot and
> the ESQL samples spit that same NoValidConnectionException.
>
> This is lame.....I suppose thats what I get for using 1.4 fresh off of the
> factory floor...but I really didnt like the X/Xvfb/VNC-server options too
> much for working with Batik in 1.3.....
>
> Well, I found some whispers of some patches for the postgresql jdbc driver
> that allow it to be built with 1.4, maybe I'll give those a shot if I can
> figure a way to cram the patches from a few months ago into the current
> postgresql CVS...
>
> I'd appriciate any comments from anyone working with jdbc and 1.4....if you
> feel they are worthwhile (the comments I mean)
>
> Thanks,
> -Tom
>
>
> >
> > On Wednesday, March 20, 2002, at 07:21 Uhr, von Schwerdtner, Thomas
> > (GXS, FPI) wrote:
> >
> > >Hey folks,
> > >
> > >Setup:
> > >?cocoon-2.0.2dev (can give snapshot date if needed, it's from about a
> > >week ago)
> > >?tomcat 4.0.3-LE
> > >?jdk1.4
> > >?linux
> > >?java2/1.2/1.3/1.4 postgresql jdbc driver is in classpath (downloaded
> > >bianry from jdbc.postgresql.org which specified that it would work with
> > >1.4 (but it also specified it could not be compiled with it).
> > >
> > >Problem:
> > >I'm trying to get esql/postgresql setup here, and with a small xsp page
> > >I am getting the following errors:
> >
> >
> > ---------------------------------------------------------------------
> > 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>
> >
> >
>
> --
> --
>
> ---------------------------------------------------------------------
> 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>
>
>
--
--
---------------------------------------------------------------------
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: jdbc or xsp or esql problem
Posted by tv...@etria.org.
On Wed, Mar 20, 2002, leo leonid wrote:
> do the e?sql-samples work that come with the distribution using the
> hsqldb-server?
> I bet they don't.
You are correct. I just built a recent (past few days) CVS snapshot and
the ESQL samples spit that same NoValidConnectionException.
This is lame.....I suppose thats what I get for using 1.4 fresh off of the
factory floor...but I really didnt like the X/Xvfb/VNC-server options too
much for working with Batik in 1.3.....
Well, I found some whispers of some patches for the postgresql jdbc driver
that allow it to be built with 1.4, maybe I'll give those a shot if I can
figure a way to cram the patches from a few months ago into the current
postgresql CVS...
I'd appriciate any comments from anyone working with jdbc and 1.4....if you
feel they are worthwhile (the comments I mean)
Thanks,
-Tom
>
> On Wednesday, March 20, 2002, at 07:21 Uhr, von Schwerdtner, Thomas
> (GXS, FPI) wrote:
>
> >Hey folks,
> >
> >Setup:
> >?cocoon-2.0.2dev (can give snapshot date if needed, it's from about a
> >week ago)
> >?tomcat 4.0.3-LE
> >?jdk1.4
> >?linux
> >?java2/1.2/1.3/1.4 postgresql jdbc driver is in classpath (downloaded
> >bianry from jdbc.postgresql.org which specified that it would work with
> >1.4 (but it also specified it could not be compiled with it).
> >
> >Problem:
> >I'm trying to get esql/postgresql setup here, and with a small xsp page
> >I am getting the following errors:
>
>
> ---------------------------------------------------------------------
> 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>
>
>
--
--
---------------------------------------------------------------------
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: jdbc or xsp or esql problem
Posted by leo leonid <te...@leonid.de>.
do the e?sql-samples work that come with the distribution using the
hsqldb-server?
I bet they don't.
On Wednesday, March 20, 2002, at 07:21 Uhr, von Schwerdtner, Thomas
(GXS, FPI) wrote:
> Hey folks,
>
> Setup:
> cocoon-2.0.2dev (can give snapshot date if needed, it's from about a
> week ago)
> tomcat 4.0.3-LE
> jdk1.4
> linux
> java2/1.2/1.3/1.4 postgresql jdbc driver is in classpath (downloaded
> bianry from jdbc.postgresql.org which specified that it would work with
> 1.4 (but it also specified it could not be compiled with it).
>
> Problem:
> I'm trying to get esql/postgresql setup here, and with a small xsp page
> I am getting the following errors:
---------------------------------------------------------------------
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>