“方法在Grails应用程序之外使用”升级到grails 2.4.0之后 - 解决方案是什么? [英] "Method was used outside of a Grails application" after upgrade to grails 2.4.0 - What's the solution?

查看:109
本文介绍了“方法在Grails应用程序之外使用”升级到grails 2.4.0之后 - 解决方案是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将我的grails 2.3.8项目中的一个升级到grails 2.4.0。仅供参考:此项目非常复杂,取决于很多插件,因此它有很多依赖项。

I just upgraded one of my grails 2.3.8 projects to grails 2.4.0. Just for your information: This project ist very complex and depends on many plugins, so it has many dependencies.

到现在为止,我认为一切正常,但我无法启动我的因为这个例外,grails应用程序使用run-app:

Until now i think everything works but i can't start my grails app with "run-app" because of this exception:

| Error 2014-06-02 18:13:00,560 [localhost-startStop-1] ERROR plugins.DefaultGrailsPluginManager  - Error configuring dynamic methods for plugin [taxonomy:1.2]: Method on class [com.grailsrocks.taxonomy.Taxonomy] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly.
Message: Method on class [com.grailsrocks.taxonomy.Taxonomy] was used outside of a Grails application. If running in the context of a test using the mocking API or bootstrap Grails correctly.
    Line | Method
->>   -1 | currentGormStaticApi           in com.grailsrocks.taxonomy.Taxonomy
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|     -2 | invoke0                        in sun.reflect.NativeMethodAccessorImpl
|     57 | invoke . . . . . . . . . . . . in     ''
|     43 | invoke                         in sun.reflect.DelegatingMethodAccessorImpl
|    606 | invoke . . . . . . . . . . . . in java.lang.reflect.Method
|   1270 | jlrMethodInvoke                in org.springsource.loaded.ri.ReflectiveInterceptor
|     90 | invoke . . . . . . . . . . . . in org.codehaus.groovy.reflection.CachedMethod
|   1371 | invokeStaticMissingMethod      in groovy.lang.MetaClassImpl
|   1359 | invokeStaticMethod . . . . . . in     ''
|   1123 | invokeStaticMethod             in groovy.lang.ExpandoMetaClass
|     50 | call . . . . . . . . . . . . . in org.codehaus.groovy.runtime.callsite.StaticMetaClassSite
|     45 | defaultCall                    in org.codehaus.groovy.runtime.callsite.CallSiteArray
|    108 | call . . . . . . . . . . . . . in org.codehaus.groovy.runtime.callsite.AbstractCallSite
|    116 | call                           in     ''
|     14 | init . . . . . . . . . . . . . in com.grailsrocks.taxonomy.TaxonomyService
|     -1 | invoke                         in com.grailsrocks.taxonomy.TaxonomyService$$FastClassBySpringCGLIB$$f377ff8e
|    204 | invoke . . . . . . . . . . . . in org.springframework.cglib.proxy.MethodProxy
|    708 | invokeJoinpoint                in org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation
|    157 | proceed . . . . . . . . . . .  in org.springframework.aop.framework.ReflectiveMethodInvocation
|     98 | proceedWithInvocation          in org.springframework.transaction.interceptor.TransactionInterceptor$1
|    262 | invokeWithinTransaction . . .  in org.springframework.transaction.interceptor.TransactionAspectSupport
|     95 | invoke                         in org.springframework.transaction.interceptor.TransactionInterceptor
|    179 | proceed . . . . . . . . . . .  in org.springframework.aop.framework.ReflectiveMethodInvocation
|    644 | intercept                      in org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor
|     -1 | init . . . . . . . . . . . . . in com.grailsrocks.taxonomy.TaxonomyService$$EnhancerBySpringCGLIB$$ddb414ec
|     45 | defaultCall                    in org.codehaus.groovy.runtime.callsite.CallSiteArray
|    108 | call . . . . . . . . . . . . . in org.codehaus.groovy.runtime.callsite.AbstractCallSite
|    112 | call                           in     ''
|     43 | doCall . . . . . . . . . . . . in TaxonomyGrailsPlugin$_closure3
|     -2 | invoke0                        in sun.reflect.NativeMethodAccessorImpl
|     57 | invoke . . . . . . . . . . . . in     ''
|     43 | invoke                         in sun.reflect.DelegatingMethodAccessorImpl
|    606 | invoke . . . . . . . . . . . . in java.lang.reflect.Method
|   1270 | jlrMethodInvoke                in org.springsource.loaded.ri.ReflectiveInterceptor
|     90 | invoke . . . . . . . . . . . . in org.codehaus.groovy.reflection.CachedMethod
|    233 | doMethodInvoke                 in groovy.lang.MetaMethod
|   1085 | invokeMethod . . . . . . . . . in groovy.lang.MetaClassImpl
|   1110 | invokeMethod                   in groovy.lang.ExpandoMetaClass
|    909 | invokeMethod . . . . . . . . . in groovy.lang.MetaClassImpl
|    423 | call                           in groovy.lang.Closure
|     -1 | call . . . . . . . . . . . . . in TaxonomyGrailsPlugin$_closure3
|    702 | doWithDynamicMethods           in org.codehaus.groovy.grails.plugins.DefaultGrailsPlugin
|    783 | doDynamicMethods . . . . . . . in org.codehaus.groovy.grails.plugins.DefaultGrailsPluginManager
|    172 | configure                      in org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator
|    127 | configure . . . . . . . . . .  in     ''
|    126 | configureWebApplicationContext in org.codehaus.groovy.grails.web.context.GrailsConfigUtils
|    109 | initWebApplicationContext . .  in org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
|    106 | contextInitialized             in org.springframework.web.context.ContextLoaderListener
|   4973 | listenerStart . . . . . . . .  in org.apache.catalina.core.StandardContext
|   5467 | startInternal                  in     ''
|    150 | start . . . . . . . . . . . .  in org.apache.catalina.util.LifecycleBase
|   1559 | call                           in org.apache.catalina.core.ContainerBase$StartChild
|   1549 | call . . . . . . . . . . . . . in     ''
|    262 | run                            in java.util.concurrent.FutureTask
|   1145 | runWorker . . . . . . . . . .  in java.util.concurrent.ThreadPoolExecutor
|    615 | run                            in java.util.concurrent.ThreadPoolExecutor$Worker
^    744 | run . . . . . . . . . . . . .  in java.lang.Thread

我在我的分类插件中使用了一些动态方法BootStrap.groovy在应用程序启动时。我不明白为什么它不起作用,因为我迄今没有更改代码。
也许有人知道一个解决方案?

I'm using some of the dynamic methods of the taxonomy plugin in my BootStrap.groovy at application startup. I can't figure out why it doesn't work because i didn't change code so far. Maybe someone knows a solution?

推荐答案

将hibernate插件降级为':hibernate:3.6.10.14'有所帮助。似乎分类插件与新的hibernate4插件不兼容。

Downgrading the hibernate plugin to ':hibernate:3.6.10.14' helped. Seems that the taxonomy plugin isn't compatible with the new hibernate4 plugin.

这篇关于“方法在Grails应用程序之外使用”升级到grails 2.4.0之后 - 解决方案是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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