如何将Grails 2.1迁移到Grails 2.3应用程序 [英] How to migrate Grails 2.1 to Grails 2.3 application

查看:92
本文介绍了如何将Grails 2.1迁移到Grails 2.3应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的应用程序从Grails 2.1迁移到2.3。
迁移后我得到了很多错误 - 我想要一些使用Grails 2.3和Spring集成的示例应用程序。



我做了一些HelloWorld示例应用程序,工作正常。但即使我在我的应用程序中应用相同的东西,甚至在某些地方出现错误。因为我的应用程序非常大(100mb),并且我使用了很多与Spring,hibernate ......以及很多Grails插件的集成。



我没有找到任何代码级别的文档从Grails 2.1迁移到Grails 2.3就是这样。



我无法从Grails或在线找到任何示例应用程序。

Grails官方文档,全部关于提供Grails META信息。



请帮助我.............



在我的主体中。 gsp 229 line:

 < g:include controller =filteraction =tree/> 

导致:org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException:处理GroovyPageView时出错:执行标签时出错< g:include> ;:无法执行include:请求处理失败;嵌套的异常是org.codehaus.groovy.grails.exceptions.GrailsRuntimeException:java.lang.IllegalStateException:在org.codehaus.groovy.grails.web.servlet.view.GroovyPageView中已提交响应
后无法重置缓冲区。 (org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.handleException(GroovyPageView.java:182)
在org.codehaus.groovy.grails中的createGroovyPageException(GroovyPageView.java:205)
。 web.servlet.view.GroovyPageView.renderWithTemplateEngine(GroovyPageView.java:153)
at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderMergedOutputModel(GroovyPageView.java:84)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264)
at org.codehaus.groovy.grails.web.sitemesh.SpringMVCViewDecorator.render(SpringMVCViewDecorator.java:67)
... 51 more
导致:org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException:执行标记< g:include>:Unable执行包括:请求处理失败;嵌套的异常是org.codehaus.groovy.grails.exceptions.GrailsRuntimeException:java.lang.IllegalStateException:响应已提交后无法重置缓冲
在org.codehaus.groovy.grails.web.pages.GroovyPage.throwRootCause( GroovyPage.java:531)
at org.codehaus.groovy.grails.web.pages.GroovyPage.invokeTag(GroovyPage.java:475)
at sun.reflect.GeneratedMethodAccessor379.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springsource.loaded。 ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod。 java:233)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClas s.java:1110)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:989)
at groovy .lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent (PogoMetaClassSite.java:66)
at mycompany_dev_testuserdev_ws3_myapp_grails_app_views_layouts_main_gsp $ _run_closure2.doCall(main.gsp:229)


解决方案

将您的Config.groovy和BuildConfig.groovy文件与空的新Grails 2.3应用程序的默认值进行比较。

最显着的变化是插件依赖不应该在application.properties中描述。您还应该确保您使用的是正确版本的Grails Tomcat,Hibernate和Scaffolding插件。 Tomcat& Hibernate插件版本不再与Grails发布版本相同。在Grails 2.3中已经提取脚手架功能来分离插件。
确保你使用正确的插件范围(为tomcat构建,运行时为休眠)。

还建议开始使用基于新的maven(使用属于maven的以太库)依赖性解析。这是通过在BuildConfig.groovy中设置 grails.project.dependency.resolver =maven来完成的。我在Grails 2.3中遇到了古老的基于ivy的解析器的奇怪类加载问题。



我希望这有助于。


I am migrating my application from Grails 2.1 to 2.3. I am getting lot of errors after migration - I want some sample applications with Grails 2.3 and spring integration.

I did some HelloWorld sample applications, and those are working fine. But even I apply same thing in my application, even some where it is giving error. Because my application is very big(100mb) and i am using lot of integration with Spring, hibernate...... and lot of Grails plugins.

I did not find any code level document for "Migrate from Grails 2.1 to Grails 2.3" like that.

I am not able to find any sample applications from Grails or online.

Grails official documentation, all about providing Grails META information.

Please help me.............

in my main.gsp 229 line:

<g:include controller="filter" action="tree"/>

Caused by: org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Error executing tag <g:include>: Unable to execute include: Request processing failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsRuntimeException: java.lang.IllegalStateException: Cannot reset buffer after response has been committed
    at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.createGroovyPageException(GroovyPageView.java:205)
    at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.handleException(GroovyPageView.java:182)
    at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderWithTemplateEngine(GroovyPageView.java:153)
    at org.codehaus.groovy.grails.web.servlet.view.GroovyPageView.renderMergedOutputModel(GroovyPageView.java:84)
    at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:264)
    at org.codehaus.groovy.grails.web.sitemesh.SpringMVCViewDecorator.render(SpringMVCViewDecorator.java:67)
    ... 51 more
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <g:include>: Unable to execute include: Request processing failed; nested exception is org.codehaus.groovy.grails.exceptions.GrailsRuntimeException: java.lang.IllegalStateException: Cannot reset buffer after response has been committed
    at org.codehaus.groovy.grails.web.pages.GroovyPage.throwRootCause(GroovyPage.java:531)
    at org.codehaus.groovy.grails.web.pages.GroovyPage.invokeTag(GroovyPage.java:475)
    at sun.reflect.GeneratedMethodAccessor379.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.springsource.loaded.ri.ReflectiveInterceptor.jlrMethodInvoke(ReflectiveInterceptor.java:1243)
    at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90)
    at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1085)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:989)
    at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:1110)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:909)
    at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66)
    at mycompany_dev_testuserdev_ws3_myapp_grails_app_views_layouts_main_gsp$_run_closure2.doCall(main.gsp:229)

解决方案

Compare your Config.groovy and BuildConfig.groovy files to the defaults of an empty new Grails 2.3 application.

The most notable change is that plugin dependencies should not be described in application.properties any more. You should also make sure that you are using the correct version of Grails Tomcat, Hibernate and Scaffolding plugins. Tomcat & Hibernate plugin versions no more are the same as the Grails release version. Scaffolding features have been extracted to separate plugin in Grails 2.3 . Make also sure you use correct scope for plugins (build for tomcat, runtime for hibernate).

It's also recommended to start using the new maven based (uses aether library which is part of maven) dependency resolution. This is done with the setting grails.project.dependency.resolver = "maven" in BuildConfig.groovy . I ran in to strange classloading problems with the old ivy based resolver in Grails 2.3 .

I hope this helps.

这篇关于如何将Grails 2.1迁移到Grails 2.3应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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