相关疑难解决方法(0)

臭名昭着的java.sql.SQLException:找不到合适的驱动程序

我正在尝试将已启用数据库的JSP添加到现有的Tomcat 5.5应用程序(GeoServer 2.0.0,如果有帮助的话).

该应用程序本身与Postgres谈话很好,所以我知道数据库已启动,用户可以访问它,所有这些好东西.我想要做的是在我添加的JSP中的数据库查询.我已经在Tomcat数据源示例中使用了配置示例,非常开箱即用.必要的taglibs位于正确的位置 - 如果我只有taglib refs就不会发生错误,因此它会找到那些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>
Run Code Online (Sandbox Code Playgroud)

来自$ 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>
Run Code Online (Sandbox Code Playgroud)

这些行是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>
Run Code Online (Sandbox Code Playgroud)

最后,例外:

   exception
    org.apache.jasper.JasperException: Unable …
Run Code Online (Sandbox Code Playgroud)

postgresql tomcat jdbc geoserver

72
推荐指数
4
解决办法
12万
查看次数

如何在Eclipse中的类路径上放置文件?

正如本文档所述,"例如,如果将此jndi.properties文件放在类路径上",但如果我使用Eclipse,如何将.properties文件放在我的类路径上?

eclipse classpath

53
推荐指数
3
解决办法
19万
查看次数

如何在Netbeans中设置类路径?

有人能告诉我在Netbeans中设置类路径的位置和方式吗?我想添加一个.jar文件.

java netbeans classpath

39
推荐指数
2
解决办法
12万
查看次数

标签 统计

classpath ×2

eclipse ×1

geoserver ×1

java ×1

jdbc ×1

netbeans ×1

postgresql ×1

tomcat ×1