“方法使用了Grails应用程序之外的”升级后的Grails 2.4.0 - 有什么解决办法?(“

2019-10-20 05:36发布

我刚刚升级我的Grails的一个2.3.8项目的Grails 2.4.0。 只是为了您的信息:该项目北京时间非常复杂,取决于很多的插件,所以它有很多依赖关系。

到现在为止我觉得一切正常,但我不能,因为这个异常的“运行程序”开始我的Grails应用程序:

| 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中在应用程序启动的分类插件的动态方法。 我想不通为什么它不工作,因为我没有改变到目前为止的代码。 也许有人知道一个解决方案吗?

Answer 1:

降级Hibernate插件,以 ':休眠:3.6.10.14' 帮助。 看来,分类插件并没有与新hibernate4插件兼容。



文章来源: “Method was used outside of a Grails application” after upgrade to grails 2.4.0 - What's the solution?