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

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

问题描述

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

理论上很多东西都是通过迁移到较新的Spring Boot(即grails 3)来升级的。



我的错误:

 找到了投影312 

#Java运行时环境检测到一个致命错误:

#SIGSEGV(0xb)在pc = 0x000000010e4eee40,pid = 95784,tid = 20739

#JRE版本:Java™SE运行时环境(8.0_45-b14)(build 1.8.0_45-b14)
#Java VM:Java HotSpot™64位服务器虚拟机(25.45-b02)混合模式bsd-amd64压缩oops)
#有问题的帧:
#V [libjvm.dylib + 0xeee40]

#无法写入核心转储。核心转储已被禁用。要启用核心转储,请在再次启动Java之前尝试ulimit -c unlimited

#包含更多信息的错误报告文件另存为:
#/ Users / nathandunn / repositories / Apollo /hs_err_pid95784.log
[线程36867也有错误]

从日志文件:

 内部异常(10个事件):
事件:40.212线程0x00007f8690d2b800异常< a'java / lang / ClassNotFoundException ':org / bbop / apollo / ProjectionService $ _ $ tt__loadTrackJson_closure25BeanInfo> (0
x00000007a09ab690)抛出[/ Users / java_re / workspace / 8-2-build-macosx-x86_64 / jdk8u45 / 3457 / hotspot / src / share / vm / classfile / systemDi
事件:40.212线程0x00007f8690d2b800异常< a'java / lang / ClassNotFoundException':org / bbop / apollo / ProjectionService $ _ $ tt__loadTrackJson_closure25Customizer>
(0x00000007a0a3a9b0)抛出[/ Users / java_re / workspace / 8-2-build-macosx-x86_64 / jdk8u45 / 3457 / hotspot / src / share / vm / classfile / system
事件:40.227线程0x00007f8690d2b800异常< a'java / lang / ClassNotFoundException':org / bbop / apollo / projection / ProjectionSequence $ _toJSONObject_closure1BeanInf
o> (0x00000007a0e2e020)抛出[/ Users / java_re / workspace / 8-2-build-macosx-x86_64 / jdk8u45 / 3457 / hotspot / src / share / vm / classfile / sys
事件:40.228线程0x00007f8690d2b800异常< a'java / lang / ClassNotFoundException':org / bbop / apollo / projection / ProjectionSequence $ _toJSONObject_closure1Customi
zer> (0x00000007a0ec5290)抛出[/ Users / java_re / workspace / 8-2-build-macosx-x86_64 / jdk8u45 / 3457 / hotspot / src / share / vm / classfile / s
事件:40.232线程0x00007f8690d2b800异常< 'java / lang / ClassNotFoundException':org / bbop / apollo / ProjectionService $ _createExonLocations_closure9BeanInfo> (0
x00000007a1048ae0)抛出[/ Users / java_re / workspace / 8-2-build-macosx-x86_64 / jdk8u45 / 3457 / hotspot / src / share / vm / classfile / systemDi
事件:40.233线程0x00007f8690d2b800异常< a'java / lang / ClassNotFoundException':org / bbop / apollo / ProjectionService $ _createExonLocations_closure9Customizer>
(0x00000007a10d7a40)[/ Users / java_re / workspace / 8-2-build-macosx-x86_64 / jdk8u45 / 3457 / hotspot / src / share / vm / classfile / system
事件:40.237线程0x00007f8690d2b800异常< a'java / lang / ClassNotFoundException':org / bbop / apollo / ProjectionService $ _extractHighLevelLocations_closure12BeanI
nfo> (0x00000007a1253d28)抛出[/ Users / java_re / workspace / 8-2-build-macosx-x86_64 / jdk8u45 / 3457 / hotspot / src / share / vm / classfile / s
事件:40.238线程0x00007f8690d2b800异常< 'java / lang / ClassNotFoundException':org / bbop / apollo / ProjectionService $ _extractHighLevelLocations_closure12Custo
mizer> (0x00000001a1edd70)抛出[/ Users / java_re / workspace / 8-2-build-macosx-x86_64 / jdk8u45 / 3457 / hotspot / src / share / vm / classfile
事件:40.243线程0x00007f8690d2b800异常< a' java / lang / ClassNotFoundException':org / bbop / apollo / ProjectionService $ _extractExonArrayLocations_closure13BeanI
nfo> (0x00000007a148f458)抛出[/ Users / java_re / workspace / 8-2-build-macosx-x86_64 / jdk8u45 / 3457 / hotspot / src / share / vm / classfile / s
事件:40.244线程0x00007f8690d2b800异常< 'java / lang / ClassNotFoundException':org / bbop / apollo / ProjectionService $ _extractExonArrayLocations_closure13Custo
mizer> (0x00000007a152a408)[/ Users / java_re / workspace / 8-2-build-macosx-x86_64 / jdk8u45 / 3457 / hotspot / src / share / vm / classfile



为什么。
我们于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上的水流越来越稀薄和干燥。它受到伤害,我认为你现在必须经历这个。

如何。
您最大的(如果不是唯一的)问题就是您的BuildConfig文件 - 插件。在这个体面的升级页面中,几乎所有其他功能都可以盲目追随, a>但是 BuildConfig.groovy build.gradle 步骤。例如,处理Spring安全和Web服务的插件必须进行更改,如果您在视图中嵌入了ajax组件(如submitToRemote和remoteFunction),则需要考虑重新构建纯jQuery和Ajax调用中的所有组件,或者只需为所有这些组件添加ajax插件即可运行。



步骤。


  1. 了解一点Gradle并且非常依赖 sdkman

  2. IDE的IntelliJ 15

  3. 创建一个Grails 3项目

  4. 如果spring security是你的插件之一,请勿复制旧项目中的代码,使用在本地合并插件机制quickstart

  5. 对于旧的ajax UI组件,您可以将以下行添加到 build.gradle 以及所有肩尽管GG团队建议反对这种做法。 编译'org.grails.plugins:ajax-tags:1.0.0.RC1'

  6. 使用的Web服务?按照这篇文章中的步骤,看看你应该如何制定插件包含以及使用服务

  7. 是的,现在按照上面提到的升级页面中的步骤,但
    关注每一个插件。支持的版本位于此页面

其他重要步骤?作为评论或直接添加到此列表中,让G2'ers在这方面变得更容易和轻松。我会继续编辑这个。


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?

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

My errors:

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]

From the log file:

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.

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.

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.

The Steps.

  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.

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天全站免登陆