データベース対応の JSP を既存の Tomcat 5.5 アプリケーション (役立つ場合は GeoServer 2.0.0) に追加しようとしています。
アプリ自体は Postgres と問題なく通信するため、データベースが稼働していて、ユーザーがアクセスできるなど、すべてが適切であることがわかります。私がやろうとしているのは、追加した JSP のデータベース クエリです。私は、Tomcat データソースの例の設定例をそのまま使用しました。必要な taglib は適切な場所にあります。taglib ref だけがあればエラーは発生しないので、それらの JAR を見つけています。postgres jdbc ドライバー、postgresql-8.4.701.jdbc3.jar は $CATALINA_HOME/common/lib にあります。
JSP の先頭は次のとおりです。
<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<sql:query var="rs" dataSource="jdbc/mmas">
select current_validstart as ValidTime from runoff_forecast_valid_time
</sql:query>
$CATALINA_HOME/conf/server.xml の関連するセクションは、次の内部に<Host>
あります<Engine>
。
<Context path="/gs2" allowLinking="true">
<Resource name="jdbc/mmas" type="javax.sql.Datasource"
auth="Container" driverClassName="org.postgresql.Driver"
maxActive="100" maxIdle="30" maxWait="10000"
username="mmas" password="very_secure_yess_precious!"
url="jdbc:postgresql//localhost:5432/mmas" />
</Context>
これらの行は、webapps/gs2/WEB-INF/web.xml のタグの最後の行です。
<resource-ref>
<description>
The database resource for the MMAS PostGIS database
</description>
<res-ref-name>
jdbc/mmas
</res-ref-name>
<res-type>
javax.sql.DataSource
</res-type>
<res-auth>
Container
</res-auth>
</resource-ref>
最後に、例外:
exception
org.apache.jasper.JasperException: Unable to get connection, DataSource invalid: "java.sql.SQLException: No suitable driver"
[...wads of ensuing goo elided]