GWT Grails插件错误资源.RESOURCEMETA-找不到资源:%nocache.js



我使用GWT-Grails插件遇到了麻烦。我试图准确地遵循此示例,但最终遇到了此错误:

| Error 2012-10-28 00:25:49,567 [http-bio-8080-exec-2] ERROR resource.ResourceMeta  -  Resource not found: /gwt/g3wt.Application/g3wt.Application.nocache.js

输入以下命令后,我会遇到此错误:(我只是在此处遵循本指南)

>grails create-app g3wt
>cd g3wt
>grails install-plugin gwt
>grails create-gwt-module g3wt.Application
>grails create-gwt-page main/index.gsp g3wt.Application
>grails run-app
>grails run-gwt-client

这是index.gsp代码(无论如何是自动化的):

<html>
<head>
  <!-- Integrate with Sitemesh layouts           -->
  <meta name="layout" content="main" />
  <!--                                           -->
  <!-- Any title is fine                         -->
  <!--                                           -->
  <title>Example title (change this!)</title>
  <!--                                           -->
  <!-- This script loads your compiled module.   -->
  <!-- If you add any GWT meta tags, they must   -->
  <!-- be added before this line.                -->
  <!--                                           -->
  <script type="text/javascript" src="${resource(dir: 'gwt/g3wt.Application', file: 'g3wt.Application.nocache.js')}"></script>
</head>
<!--                                           -->
<!-- The body can have arbitrary html, or      -->
<!-- you can leave the body empty if you want  -->
<!-- to create a completely dynamic ui         -->
<!--                                           -->
<body>
  <!-- OPTIONAL: include this if you want history support -->
  <iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>
  <!-- Add the rest of the page here, or leave it -->
  <!-- blank for a completely dynamic interface.  -->
</body>
</html>

我知道找不到nocache.js,所以我想我可以尝试查看它的确切位置。但是,使用Eclipse搜索功能,它表明该文件根本不是创建的。尽管有一个名为application.js的文件。

为什么未创建nocache.js,我该如何修复?我已经有一段时间了,这很令人沮丧。

我使用的是GWT插件0.7.1和Grails 2.1.1,带有Eclipse 4.2和Linux机器。

我有同样的问题,并在这里找到了答案。

buildconfig.groovy在conf文件夹中。只需评论运行时的插件":resouces ..."

好吧,所以我首先运行

会消失错误
grails> compile-gwt-modules

现在发生了不同的问题。我制作的前端GWT代码未显示。

您可以添加confing.groovy:

grails.resources.adhoc.excludes = ['**/gwt/**']

这将解决问题。但是,如果您使用插件版本0.8应该解决此问题。

最新更新