You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by matt rainer <ma...@email.com> on 2000/11/30 21:21:00 UTC

cocoon postgresql help needed

Please can you help I have got the a postgresql database I would like to
access. I have managed to
get cocoon to output html when XML is requested from the browser. I have
carefully followed the example of "esql.xml" in the samples directory, but
when I try to access the database I keep getting the following message:

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

<message>postgresql.Driver</message><stacktrace>java.lang.ClassNotFoundException:
postgresql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at org.apache.cocoon.processor.xsp.language.java.XSPClassLoader.loadClass
(XSPClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at
_home._apache._htdocs._cocoon_1_8._samples._sql._test._esql_execute_query_N63bbd7
(_test.java:85)
at
_home._apache._htdocs._cocoon_1_8._samples._sql._test.populateDocument(_test.java:273)
at org.apache.cocoon.processor.xsp.XSPPage.getDocument(XSPPage.java:96)
at
org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:494)
at org.apache.cocoon.Engine.handle(Engine.java:359)
at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
at org.apache.jserv.JServConnection.run(JServConnection.java:188)
at java.lang.Thread.run(Thread.java:484)
</stacktrace>

</page>

Here is my XML:

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?xml-logicsheet
href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
<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:driver>postgresql.Driver</esql:driver>
<esql:dburl>jdbc:postgresql://localhost/forms</esql:dburl>
<esql:username>mattr</esql:username>
<esql:password></esql:password>
<esql:query>select * from groups</esql:query>
<esql:results>
<Groups>
<Name><esql:get-string column="Name"/></Name>
<Phone><esql:get-string column="Phone"/></Phone>
</Groups>
</esql:results>
<esql:no-results>
<error>no results were found</error>
</esql:no-results>
<esql:error-results>
<message><esql:get-message/></message>
<stacktrace><esql:get-stacktrace/></stacktrace>
</esql:error-results>
</esql:execute-query>
</page>
</xsp:page>

(I have not set a password on my database, and have tried it without the
<esql:password> line) but I have a feeling that it not finding the database.
I have gone through the instalation and added the necessary lines to the
.properties files.

Please can you tell me what I am doing wrong.


-----------------------------------------------
FREE! The World's Best Email Address @email.com
Reserve your name now at http://www.email.com



Re: cocoon postgresql help needed

Posted by Paul Russell <pa...@luminas.co.uk>.
Hi Matt,

On Thu, Nov 30, 2000 at 03:21:00PM -0500, matt rainer wrote:
> <message>postgresql.Driver</message>
> <stacktrace>java.lang.ClassNotFoundException:

Two possibilities:

 1) You don't have the postgresql driver jar in your classpath
 2) you're using postgresql 7.x. The new name for the driver
    is org.postgresql.Driver in keeping with the Java package
	name conventions.

HTH,


P.
-- 
Paul Russell                               <pa...@luminas.co.uk>
Technical Director,                   http://www.luminas.co.uk
Luminas Ltd.

Re: cocoon postgresql help needed

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 30 Nov 2000, matt rainer wrote:

> Please can you help I have got the a postgresql database I would like to
> access. I have managed to
> get cocoon to output html when XML is requested from the browser. I have
> carefully followed the example of "esql.xml" in the samples directory, but
> when I try to access the database I keep getting the following message:
> 
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
> "http://www.w3.org/TR/REC-html40/strict.dtd">
> <page>
> 
> <message>postgresql.Driver</message><stacktrace>java.lang.ClassNotFoundException:
> postgresql.Driver

add your postgres jar file to your server's CLASSPATH.

- donald


Re: cocoon postgresql help needed

Posted by Laurent <la...@levesinet.net>.
try org.postgresql.Driver instead of postgresql.Driver.
and make sure your CLASSPATH contains the jdbc postgres driver file (.jar file)

laurent


At 15:21 30/11/00 -0500, you wrote:
>Please can you help I have got the a postgresql database I would like to
>access. I have managed to
>get cocoon to output html when XML is requested from the browser. I have
>carefully followed the example of "esql.xml" in the samples directory, but
>when I try to access the database I keep getting the following message:
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
>"http://www.w3.org/TR/REC-html40/strict.dtd">
><page>
>
><message>postgresql.Driver</message><stacktrace>java.lang.ClassNotFoundException:
>postgresql.Driver
>at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>at java.security.AccessController.doPrivileged(Native Method)
>at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
>at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
>at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
>at org.apache.cocoon.processor.xsp.language.java.XSPClassLoader.loadClass
>(XSPClassLoader.java:87)
>at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
>at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
>at java.lang.Class.forName0(Native Method)
>at java.lang.Class.forName(Class.java:120)
>at
>_home._apache._htdocs._cocoon_1_8._samples._sql._test._esql_execute_query_N63bbd7
>(_test.java:85)
>at
>_home._apache._htdocs._cocoon_1_8._samples._sql._test.populateDocument(_test.java:273)
>at org.apache.cocoon.processor.xsp.XSPPage.getDocument(XSPPage.java:96)
>at
>org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:494)
>at org.apache.cocoon.Engine.handle(Engine.java:359)
>at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
>at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
>at org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
>at org.apache.jserv.JServConnection.run(JServConnection.java:188)
>at java.lang.Thread.run(Thread.java:484)
></stacktrace>
>
></page>
>
>Here is my XML:
>
><?xml version="1.0"?>
><?cocoon-process type="xsp"?>
><?xml-logicsheet
>href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
><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:driver>postgresql.Driver</esql:driver>
><esql:dburl>jdbc:postgresql://localhost/forms</esql:dburl>
><esql:username>mattr</esql:username>
><esql:password></esql:password>
><esql:query>select * from groups</esql:query>
><esql:results>
><Groups>
><Name><esql:get-string column="Name"/></Name>
><Phone><esql:get-string column="Phone"/></Phone>
></Groups>
></esql:results>
><esql:no-results>
><error>no results were found</error>
></esql:no-results>
><esql:error-results>
><message><esql:get-message/></message>
><stacktrace><esql:get-stacktrace/></stacktrace>
></esql:error-results>
></esql:execute-query>
></page>
></xsp:page>
>
>(I have not set a password on my database, and have tried it without the
><esql:password> line) but I have a feeling that it not finding the database.
>I have gone through the instalation and added the necessary lines to the
>.properties files.
>
>Please can you tell me what I am doing wrong.
>
>
>-----------------------------------------------
>FREE! The World's Best Email Address @email.com
>Reserve your name now at http://www.email.com
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org


AW: cocoon postgresql help needed

Posted by Simon Wilks <si...@enterprisefusion.com>.
Hi Matt,

"java.lang.ClassNotFoundException" is telling you that it is not finding
your postgresql library. What you need to do is make sure that your
CLASSPATH variable includes the path to your postgresql library.

Example (I'm using InterBase on W2000):

set CLASSPATH=d:\InterBase Corp\InterClient\interclient.jar

Hope this helps,

Simon.


-----Ursprungliche Nachricht-----
Von: matt rainer [mailto:mattrainer@email.com]
Gesendet: Donnerstag, 30. November 2000 21:21
An: cocoon-users@xml.apache.org
Betreff: cocoon postgresql help needed


Please can you help I have got the a postgresql database I would like to
access. I have managed to
get cocoon to output html when XML is requested from the browser. I have
carefully followed the example of "esql.xml" in the samples directory, but
when I try to access the database I keep getting the following message:

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

<message>postgresql.Driver</message><stacktrace>java.lang.ClassNotFoundExcep
tion:
postgresql.Driver
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at org.apache.cocoon.processor.xsp.language.java.XSPClassLoader.loadClass
(XSPClassLoader.java:87)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at
_home._apache._htdocs._cocoon_1_8._samples._sql._test._esql_execute_query_N6
3bbd7
(_test.java:85)
at
_home._apache._htdocs._cocoon_1_8._samples._sql._test.populateDocument(_test
.java:273)
at org.apache.cocoon.processor.xsp.XSPPage.getDocument(XSPPage.java:96)
at
org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:494)
at org.apache.cocoon.Engine.handle(Engine.java:359)
at org.apache.cocoon.Cocoon.service(Cocoon.java:167)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
at org.apache.jserv.JServConnection.run(JServConnection.java:188)
at java.lang.Thread.run(Thread.java:484)
</stacktrace>

</page>

Here is my XML:

<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?xml-logicsheet
href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>
<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:driver>postgresql.Driver</esql:driver>
<esql:dburl>jdbc:postgresql://localhost/forms</esql:dburl>
<esql:username>mattr</esql:username>
<esql:password></esql:password>
<esql:query>select * from groups</esql:query>
<esql:results>
<Groups>
<Name><esql:get-string column="Name"/></Name>
<Phone><esql:get-string column="Phone"/></Phone>
</Groups>
</esql:results>
<esql:no-results>
<error>no results were found</error>
</esql:no-results>
<esql:error-results>
<message><esql:get-message/></message>
<stacktrace><esql:get-stacktrace/></stacktrace>
</esql:error-results>
</esql:execute-query>
</page>
</xsp:page>

(I have not set a password on my database, and have tried it without the
<esql:password> line) but I have a feeling that it not finding the database.
I have gone through the instalation and added the necessary lines to the
.properties files.

Please can you tell me what I am doing wrong.


-----------------------------------------------
FREE! The World's Best Email Address @email.com
Reserve your name now at http://www.email.com



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org