You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chuck Amadi <ch...@breconbeacons.org> on 2001/06/12 16:04:26 UTC

problems with dbtags any suggestions!!

 Hi , can anyone desiphon this error message i have explored all the
config's ie tld's,<taglib> xml and declartions.Any suggestions .The jsp
in questions as below not that i have exstablished a connection but the
package was beaneath my tomcat container /WEB-INF.as opposed to my
struts-bbnpa (web app).  Cheers Chuck



Error: 500
Location: /struts-bbnpa/dbtest.jsp
Internal Servlet Error:
javax.servlet.ServletException: Driver class 'org.postgresql.Driver' not
found

<%@ taglib uri="http://jakarta.apache.org/taglibs/dbtags" prefix="sql"
%>
<html>
<head><title>dbtest</title></head>
<body>

<P><B>Opening connection to PostgreSql </B></P>
<%-- open database connction--%>
<table>
<sql:connection id="conn1">
  <sql:url>jdbc:postgresql://172.16.1.15/test1</sql:url>
  <sql:driver>org.postgresql.Driver</sql:driver>
  <sql:userId>chucka</sql:userId>
  <sql:password></sql:password>
</sql:connection>

<sql:statement id="stmt1" conn="conn1">
<sql:query>
    select firstname, lastname, department from employee_1 order by 1
    </sql:query>
<%-- loop through the rows of your query--%>
<sql:resultSet id="rset1">
<br><sql:getColumn position="1"/>
<br><sql:getColumn position="2"/>
<br><sql:getColumn position="3"/><sql:wasNull>[no
description]</sql:wasNull>
</sql:resultSet>
</sql:statement>
<%-- close a database connection --%>
<sql:closeConnection conn="conn1"/>
</table>
</body>
</html>

--
The views expressed by the sender of this message don't
necessarily represent those of Brecon Beacons National Park
Authority. This message is intended for the addressee(s) only
and is sent in confidence; if you receive it in error, please can you
let us know (at it@breconbeacons.org) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
mewn camgymeriad, a fyddech gystal â rhoi gwybod i
ni (yn it@breconbeacons.org) ac yna dilëwch bob copi.


Re: problems with dbtags any suggestions!!

Posted by Chuck Amadi <ch...@breconbeacons.org>.
Cheers Darryl .

Darryl Pentz wrote:

>    Part 1.1    Type: Plain Text (text/plain)
>            Encoding: 8bit

--
The views expressed by the sender of this message don't
necessarily represent those of Brecon Beacons National Park
Authority. This message is intended for the addressee(s) only
and is sent in confidence; if you receive it in error, please can you
let us know (at it@breconbeacons.org) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
mewn camgymeriad, a fyddech gystal â rhoi gwybod i
ni (yn it@breconbeacons.org) ac yna dilëwch bob copi.



Re: problems with dbtags any suggestions!!

Posted by Chuck Amadi <ch...@breconbeacons.org>.
Hey this so called struts.jar or dbtags.jar  should be copied into the
/WEB-INF/lib dir of my web applicatio but what if im hosting a few
struts based app's on to same tomcat (servlet) container i have read
this can cause the ClassNotFoundException problem unless all my
application classes are stored in a shared repository wish i believe
they are within -

/webapps/struts-bbnpa/WEB-INF/classes/packages
/webapps/struts-bbnpa/WEB-INF/lib/dbtags.jar
/webapps/struts-bbnpa/WEB-INF/lib/struts.jar

Thus i think your stating that all jar's should be directed to
webapps/Web-INF/lib.
about to try.

webapps is my tomcat servlet container
Darryl Pentz wrote:

>    Part 1.1    Type: Plain Text (text/plain)
>            Encoding: 8bit

--
The views expressed by the sender of this message don't
necessarily represent those of Brecon Beacons National Park
Authority. This message is intended for the addressee(s) only
and is sent in confidence; if you receive it in error, please can you
let us know (at it@breconbeacons.org) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
mewn camgymeriad, a fyddech gystal â rhoi gwybod i
ni (yn it@breconbeacons.org) ac yna dilëwch bob copi.


Re: problems with dbtags any suggestions!!

Posted by Chuck Amadi <ch...@breconbeacons.org>.
Hi , my original attempt i placed the dbtags.jar in the /WEB-INF/lib of
tomcat containers webapps(application server) and this worked fine
albiet my struts-bbnpa is my working web application that is beneath web
apps as described and i have all my prototype's jsp's , css etc and is
getting to the desired look and feel. below is my classpath- I have
asked countless times is this correct and was advised accordingly .
because as i see it how else could you work with struts framework if you
utilise the web apps of tomacat (application server) unless i still
haven't digested the config of web apps UH OH as i have scripted a fair
bit under struts-bbnpa.

C:\jakarta-tomcat-3.2.1\webapps\struts-bbnpa\     (struts-bbnpa was the
struts-blank renamed).
webapp is what i term the application server.


Darryl Pentz wrote:

>    Part 1.1    Type: Plain Text (text/plain)
>            Encoding: 8bit

--
The views expressed by the sender of this message don't
necessarily represent those of Brecon Beacons National Park
Authority. This message is intended for the addressee(s) only
and is sent in confidence; if you receive it in error, please can you
let us know (at it@breconbeacons.org) and then destroy all copies.
Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
mewn camgymeriad, a fyddech gystal â rhoi gwybod i
ni (yn it@breconbeacons.org) ac yna dilëwch bob copi.


RE: problems with dbtags any suggestions!!

Posted by Darryl Pentz <da...@vardus.co.za>.
It looks like your driver class file isn't in the CLASSPATH for your
application server. Check that the JAR file for the PostgreSQL drivers is in
the app server classpath.

- Darryl
  -----Original Message-----
  From: Chuck Amadi [mailto:chuck.amadi@breconbeacons.org]
  Sent: 12 June 2001 16:04
  To: struts-user@jakarta.apache.org
  Subject: problems with dbtags any suggestions!!


   Hi , can anyone desiphon this error message i have explored all the
config's ie tld's,<taglib> xml and declartions.Any suggestions .The jsp in
questions as below not that i have exstablished a connection but the package
was beaneath my tomcat container /WEB-INF.as opposed to my struts-bbnpa (web
app).  Cheers Chuck


  Error: 500
  Location: /struts-bbnpa/dbtest.jsp
  Internal Servlet Error:
  javax.servlet.ServletException: Driver class 'org.postgresql.Driver' not
found

  <%@ taglib uri="http://jakarta.apache.org/taglibs/dbtags" prefix="sql" %>
  <html>
  <head><title>dbtest</title></head>
  <body>

  <P><B>Opening connection to PostgreSql </B></P>
  <%-- open database connction--%>
  <table>
  <sql:connection id="conn1">
    <sql:url>jdbc:postgresql://172.16.1.15/test1</sql:url>
    <sql:driver>org.postgresql.Driver</sql:driver>
    <sql:userId>chucka</sql:userId>
    <sql:password></sql:password>
  </sql:connection>

  <sql:statement id="stmt1" conn="conn1">
  <sql:query>
      select firstname, lastname, department from employee_1 order by 1
      </sql:query>
  <%-- loop through the rows of your query--%>
  <sql:resultSet id="rset1">
  <br><sql:getColumn position="1"/>
  <br><sql:getColumn position="2"/>
  <br><sql:getColumn position="3"/><sql:wasNull>[no
description]</sql:wasNull>
  </sql:resultSet>
  </sql:statement>
  <%-- close a database connection --%>
  <sql:closeConnection conn="conn1"/>
  </table>
  </body>
  </html>

  --
  The views expressed by the sender of this message don't
  necessarily represent those of Brecon Beacons National Park
  Authority. This message is intended for the addressee(s) only
  and is sent in confidence; if you receive it in error, please can you
  let us know (at it@breconbeacons.org) and then destroy all copies.
  Nid yw'r farn a fynegir gan anfonwr y neges hon o anghenraid yn
  adlewyrchu barn Awdurdod Parc Cenedlaethol Bannau Brycheiniog.
  Neges yw hon a fwriadwyd ar gyfer y derbynnydd/derbynyddion
  yn unig ac fe'i hanfonir yn gyfrinachol; os ydych yn ei dderbyn
  mewn camgymeriad, a fyddech gystal â rhoi gwybod i
  ni (yn it@breconbeacons.org) ac yna dilëwch bob copi.