Grails Java 8 开发模式支持 [英] Grails Java 8 dev-mode Support

查看:25
本文介绍了Grails Java 8 开发模式支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于 Java 7 现在不再公开维护,并且 Grails 2.4.X 对 Java 8 的支持在开发模式下重新加载时微不足道(它会崩溃).我想知道在我迁移之前是否有人在 Java 8 开发模式 Grails 2.5 或 Grails 3 上有更好的运气?

As Java 7 is now no longer being publicly maintained and Grails 2.4.X support for Java 8 is marginal (it crashes) in dev-mode when reloading. I was wondering if anyone had a better luck with Java 8 dev-mode Grails 2.5 or Grails 3 before I migrate?

理论上,很多东西都通过迁移到更新的 Spring Boot(即 grails 3)进行了升级.

In theory a lot of things were upgraded by migrating to the newer Spring Boot (i.e., grails 3).

我的错误:

found a projection 312
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000010e4eee40, pid=95784, tid=20739
#
# JRE version: Java(TM) SE Runtime Environment (8.0_45-b14) (build 1.8.0_45-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.45-b02 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# V  [libjvm.dylib+0xeee40]
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/nathandunn/repositories/Apollo/hs_err_pid95784.log
[thread 36867 also had an error]

来自日志文件:

Internal exceptions (10 events):
Event: 40.212 Thread 0x00007f8690d2b800 Exception <a 'java/lang/ClassNotFoundException': org/bbop/apollo/ProjectionService$_$tt__loadTrackJson_closure25BeanInfo> (0
x00000007a09ab690) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u45/3457/hotspot/src/share/vm/classfile/systemDi
Event: 40.212 Thread 0x00007f8690d2b800 Exception <a 'java/lang/ClassNotFoundException': org/bbop/apollo/ProjectionService$_$tt__loadTrackJson_closure25Customizer> 
(0x00000007a0a3a9b0) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u45/3457/hotspot/src/share/vm/classfile/system
Event: 40.227 Thread 0x00007f8690d2b800 Exception <a 'java/lang/ClassNotFoundException': org/bbop/apollo/projection/ProjectionSequence$_toJSONObject_closure1BeanInf
o> (0x00000007a0e2e020) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u45/3457/hotspot/src/share/vm/classfile/sys
Event: 40.228 Thread 0x00007f8690d2b800 Exception <a 'java/lang/ClassNotFoundException': org/bbop/apollo/projection/ProjectionSequence$_toJSONObject_closure1Customi
zer> (0x00000007a0ec5290) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u45/3457/hotspot/src/share/vm/classfile/s
Event: 40.232 Thread 0x00007f8690d2b800 Exception <a 'java/lang/ClassNotFoundException': org/bbop/apollo/ProjectionService$_createExonLocations_closure9BeanInfo> (0
x00000007a1048ae0) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u45/3457/hotspot/src/share/vm/classfile/systemDi
Event: 40.233 Thread 0x00007f8690d2b800 Exception <a 'java/lang/ClassNotFoundException': org/bbop/apollo/ProjectionService$_createExonLocations_closure9Customizer> 
(0x00000007a10d7a40) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u45/3457/hotspot/src/share/vm/classfile/system
Event: 40.237 Thread 0x00007f8690d2b800 Exception <a 'java/lang/ClassNotFoundException': org/bbop/apollo/ProjectionService$_extractHighLevelLocations_closure12BeanI
nfo> (0x00000007a1253d28) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u45/3457/hotspot/src/share/vm/classfile/s
Event: 40.238 Thread 0x00007f8690d2b800 Exception <a 'java/lang/ClassNotFoundException': org/bbop/apollo/ProjectionService$_extractHighLevelLocations_closure12Custo
mizer> (0x00000007a12edd70) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u45/3457/hotspot/src/share/vm/classfile
Event: 40.243 Thread 0x00007f8690d2b800 Exception <a 'java/lang/ClassNotFoundException': org/bbop/apollo/ProjectionService$_extractExonArrayLocations_closure13BeanI
nfo> (0x00000007a148f458) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u45/3457/hotspot/src/share/vm/classfile/s
Event: 40.244 Thread 0x00007f8690d2b800 Exception <a 'java/lang/ClassNotFoundException': org/bbop/apollo/ProjectionService$_extractExonArrayLocations_closure13Custo
mizer> (0x00000007a152a408) thrown at [/Users/java_re/workspace/8-2-build-macosx-x86_64/jdk8u45/3457/hotspot/src/share/vm/classfile

推荐答案

我的建议,简单、加载和清晰:迁移(或真正升级),不要回头.

My advice, simple, load and clear: migrate (or upgrade really), and don't look back.

原因.我们在 2014 年 10 月开始了一个使用 Grails 2.3 和 JDK7 的 GG 项目,并一直升级到 2.5.1 和 Java 8.然后我们开始看到随着 Grails 3 和 Gradle 出现在我们脚下,而我们停滞不前.Grails 3.1, .2, .3, .4, .5...而我们站在玻璃后面看.Stackoverflow 因新功能和问题而嗡嗡作响,而 Grails 2 上的水流变得越来越稀薄和干燥.这很痛苦,我认为您现在必须经历这些.

The Why. We started a GG project in Oct 2014 with Grails 2.3 and JDK7, and went all the way up to 2.5.1 and Java 8. Then we started seeing the grounds shift under our feet with Grails 3 and Gradle out there while we stagnated. Grails 3.1, .2, .3, .4, .5... while we stood behind glass looking. Stackoverflow was buzzing with the new features and problems while water streams were getting thinner and drier on Grails 2. It hurt and I think you must be going through this now.

方法.您最大的(如果不是也是唯一)问题是您在 BuildConfig 文件中遇到的问题 - 插件.在这个不错的升级页面 但是 BuildConfig.groovybuild.gradle 步骤.例如,处理 spring 安全和 Web 服务的插件必须更改,如果您在视图中嵌入了 ajax 组件(如 submitToRemote 和 remoteFunction),那么您需要考虑在纯 jQuery 和 ajax 调用中重建所有这些组件或只需为所有此类组件添加 ajax 插件即可正常工作.

The How. Your biggest (if not and only) problem is what you got into your BuildConfig file - the plugins. Almost everything else you can follow blindly in this decent Upgrade page but the BuildConfig.groovy to build.gradle step. For example, plugins that dealt with spring security and web services had to be changed, and if you have embedded ajax components (like submitToRemote and remoteFunction) in your views, then you need to think about rebuilding all those in pure jQuery and ajax calls or just add the ajax plugin for all such components to work as they did.

步骤.

  1. 稍微了解 Gradle 并严重依赖 sdkman
  2. 用于 IDE 的 IntelliJ 15
  3. 创建一个 Grails 3 项目
  4. 如果 spring security 是您的插件之一,请不要从旧项目复制代码,使用 快速入门
  5. 对于较旧的 ajax UI 组件,您可以将以下行添加到您的 build.gradle 中,并且所有内容都应该像它们一样工作,尽管 GG 团队建议不要这样做.编译'org.grails.plugins:ajax-tags:1.0.0.RC1'
  6. 使用了网络服务?按照 本文中的步骤 了解您应该如何制作插件包含以及如何使用服务
  7. 是的,现在按照上面提到的升级页面中的步骤进行操作,但是密切关注每个插件.支持的在这个页面.
  1. Get to know Gradle a little bit and depend heavily on sdkman
  2. IntelliJ 15 for an IDE
  3. Create a Grails 3 project
  4. If spring security is one of your plugins, don't copy code from your older project, incorporate the plugin mechanics locally using quickstart
  5. For your older ajax UI components, you could add the following line to your build.gradle and all should work as they did, although the GG team advises against that. compile 'org.grails.plugins:ajax-tags:1.0.0.RC1'
  6. Web services used? Follow the steps in this post to see how you should craft the plugin inclusion as well as using the services
  7. Yes, now follow the steps in the upgrade page mentioned above, but keep an eye on each and every plugin. The supported ones are in this page.

其他重要步骤?添加评论或直接添加到此列表中,以使 G2 的人可以更轻松地完成此类任务.我会继续编辑这个.

Others vital steps? Add as comments or straight to this list to make such a task easier and easier for the G2'ers out there. I will keep editing this.

这篇关于Grails Java 8 开发模式支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆