oracle - grails tomcat 7部署

标签 oracle tomcat grails driver classnotfoundexception

所以我有一个 grails 2.0.4 应用程序,它完全按照我想要的方式工作。我创建了 war 文件并将其部署到 Tomcat 7。我收到一条错误消息,指出应用程序找不到我用来连接到 oracle 的 jar (ojdbc6.jar)。该 jar 列在 mywebapp/WEB-INF/lib 下。为什么找不到??任何帮助将不胜感激!

最佳答案

  1. jar 文件应该在项目的顶层 lib 目录中(或指定为存储库中的依赖项),而不是 webapp/WEB-INF/lib。 jar 文件实际上在 warfile 中吗?您可以通过将 war 作为 zip 文件打开或通过运行 jar tf target/mywebapp*.war 并查找 ojdbc6.jar 来测试这一点。如果是,它应该被部署,您应该在 tomcat7/webapps/mywebapp/WEB-INF/lib 中看到它。

  2. grails war 的默认环境是production 而不是development。确保您已在 grails-app/conf/DataSource.groovy

  3. 中正确配置了 production 数据源

关于oracle - grails tomcat 7部署,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11886896/

相关文章:

java - Grails Mail 插件异常处理

oracle - 需要使用legacy PLSQL with DBLink call,在XA事务中,不能使用共享连接

tomcat - 为 Grails 应用程序设置家庭网络服务器

javascript - 在 Oracle Apex 中通过 JavaScript 分配字段值

tomcat - 如何配置 tomcat 7 为每个应用程序使用不同的 css/js 文件

tomcat - Tomcat 7 中的虚拟主机

grails - 我应该在 Grails 中使用复合主键吗?

grails - Grails 中不区分大小写的唯一约束

php - 迪尔德 : lazy symbol binding failed for php oic8 on Apple M1

java - 如何使用Where子句从多个表中删除多行?