问题标签 [grails-2.0]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1387 浏览

grails - Grails 2.0:无效的 SHA1

在 Grails 2.0.0.RC1 中执行run-app时,我经常会遇到无效的 SHA1错误,尤其是对我们的 pwn 产品/模块的依赖。

我发现了以下 Jira 案例:http: //jira.grails.org/browse/GRAILS-7313

不幸的是BuildConfig.groovy中的以下行

导致错误:

问候

乔纳斯

0 投票
1 回答
131 浏览

grails - Grails 1.4 与 2.0

我经常在论坛上阅读 Grails 1.4 版,看起来 Grails 从 1.3.7 升级到了 2.0。1.4 是最初的版本控制计划,然后他们决定将其称为 2.0?

只是好奇...

问候

乔纳斯

0 投票
5 回答
11568 浏览

grails - 如何在 Grails 2.0 中运行本地插件?

在 Grails 中,有一个变体如何从源代码中包含本地插件。根据文档,可以输入BuildConfig.groovy

问题是它在 Grails 2.0.RC1 中不起作用。我已经尝试过grails clean安装插件grails install-plugin并将其放置到BuildConfig.groovy. 仍然无法解决。

0 投票
1 回答
4160 浏览

grails - Grails 2.0:找不到名称为 [window] 的模块

我在 Grails 2.0 中使用 jQuery 和 Resources 插件,在我的布局中具有以下内容:

在使用该布局单击视图中的链接时,我在控制台中收到以下错误:

我在这里想念什么?

谢谢

乔纳斯

0 投票
0 回答
100 浏览

grails - 无法安装 grails 2.0.0.RC1

我将 grails 升级到 v 2.0,将 grails_home 设置为新的 grails 位置并更新了路径变量,当我在命令提示符下执行 grails -version 时,出现这样的错误

我尝试从Java中删除所有选项,环境变量(JAVA_OPTS,GRAILS_OPTS)中的grails,它仍然抛出这个错误。

这是 grails 2.0 中的错误吗?

0 投票
1 回答
1016 浏览

unit-testing - Grails 2.0:问题测试 flash.message

我有一个单元测试,UserController但自从升级到 Grails 2.0 后,该flash变量似乎总是返回一个没有消息的空映射。

以下是一些代码片段UserControllerTests

UserController

但我的测试结果如下:

我也尝试过作为集成测试,因为否则它response也是空的,但它没有解决闪存问题。view和也存在同样的问题model

我错过了什么?任何帮助高度赞赏。

问候

乔纳斯

编辑:

这是一个奇怪的场景:

我的控制器具有以下内容:

我的测试看起来像这样:

像这样的输出:

值得一提的是,IntelliJ 中的调试器在 test() 操作中的断点处停止,但在 save() 中没有

这个怎么可能????

问候

乔纳斯

0 投票
1 回答
3481 浏览

grails - Grails 2.0 和 servletContext

我正在尝试像这样在控制器中访问 servletContext,但不断收到空指针异常:

...我最近在邮件列表中遇到过这个问题,但建议的唯一“正确”解决方法是将其设置在 BootStrap.groovy 的 init 闭包中:

……现在还是这样吗?该解决方案对我没有任何影响,仍然有 NPE

提前致谢

0 投票
1 回答
1147 浏览

grails - Grails 2.0、Atmosphere-Plugin 和 WebSockets

我正在尝试在开发模式下使用 jetty 7.5 在 grails 2.0 上运行示例 WebSocket 应用程序。我生成了一个简单的 AtmosphereHandler,但每当我尝试通过 WebSocket 连接时,都会收到以下错误消息:

任何关于可能是什么问题的建议都将受到高度赞赏。最良好的祝愿 Peter, 瑞士

0 投票
1 回答
788 浏览

unit-testing - Grails 2.0:POST 和 flash.message

在您的控制器中有以下内容:

例如,将导致该save()操作设置一个空flash地图。即以下测试将失败,因为 flash 是[:]在操作返回之后并且消息是null

控制器:

测试:

是否有任何原因,或者这是 Grails 2.0 中的错误?

0 投票
0 回答
172 浏览

grails - Grails 2.0: Conditionally instantiate a service

In my Grails application I have a service using a library with the 'provided' scope which is not shipped with the application. In fact, there's no guarantee that is will ever be there because the customer has to buy it and if they decide not to, the app has a fall-back.

When doing run-app I still receive a NoClassDefFoundError for a class of that library even tough no code of the service is executed.

It's seems Grails is trying to compile the class. How can I prevent that?

Kind Regards

Jonas