首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Grails 2.4.3,部署的war中“资源不可用”

Grails 2.4.3,部署的war中“资源不可用”
EN

Stack Overflow用户
提问于 2014-11-27 17:25:02
回答 2查看 765关注 0票数 0

当我们通过“grails”运行它时,我们有一个运行良好的应用程序。但是,当我们构建并部署war时,任何请求的URL都会出现404错误(例如,"/index.gsp“未找到)。

可能是什么原因?

代码语言:javascript
复制
grails run-app 

好的

代码语言:javascript
复制
grails war 

404错误,资源不可用

代码语言:javascript
复制
grails test run-war 

404错误,资源不可用

下面是插件配置:

代码语言:javascript
复制
plugins {
    // plugins for the build system only
    build ":tomcat:7.0.55"

    // plugins for the compile step
    compile ":scaffolding:2.1.2"
    compile ':cache:1.1.7'
    compile ":asset-pipeline:1.9.9"

    // plugins needed at runtime but not for compilation
    runtime ":hibernate4:4.3.5.5" // or ":hibernate:3.6.10.17"
    runtime ":database-migration:1.4.0"
    runtime ":jquery:1.11.1"

    // Uncomment these to enable additional asset-pipeline capabilities
    //compile ":sass-asset-pipeline:1.9.0"
    //compile ":less-asset-pipeline:1.10.0"
    //compile ":coffee-asset-pipeline:1.8.0"
    //compile ":handlebars-asset-pipeline:1.3.0.3"
}
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-11-28 10:05:38

通过将过滤器从包中移出解决。

票数 0
EN

Stack Overflow用户

发布于 2014-11-27 22:36:32

您的开发环境(Windows)是什么?您的目标环境是什么(Unix,Linux?)。我不得不在目标环境(Linux)上重新编译WAR文件,因为我在Windows创建的WAR文件中没有找到类似的资源问题。

幸运的是,我为Windows下载的Grails也在Unix上工作(都需要一个JVM才能运行)。因此,尝试将Grails复制到目标环境,并遵循以下步骤:

  1. grails create-app your-project-name
  2. 将grails目录下的所有原始项目文件复制到目标环境中,至少包括以下内容:
    • 资产
    • 会议
    • 控制器
    • 域名
    • i18n
    • 迁徙
    • 服务
    • 塔格利布
    • 实用程序
    • 视图

  1. grails clean-all
  2. grails refresh-dependencies
  3. grails compile
  4. grails prod war

我怀疑其中一个库(比如Oracle的ojdbc6.jar)依赖于本地系统调用,这些调用在迁移到不同的操作系统时需要重新编译。

希望这能有所帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/27176125

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档