Grails 1.2.1与Jetty下的Spring 3.0.0依赖关系问题 [英] Grails 1.2.1 with Spring 3.0.0 dependency problem under Jetty

查看:104
本文介绍了Grails 1.2.1与Jetty下的Spring 3.0.0依赖关系问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

刚搬到Grails 1.2.1(之前使用1.1.1)。更改了application.properties,运行了grails升级,修复了BuildConfig和Bootstrap - 从grails控制台一切正常。

然而,在jetty 6.1下部署打包战争时出现问题。 22:

  1581 [main]错误org.springframework.web.context.ContextLoader  - 上下文初始化失败org.springframework.beans。 factory.access.BootstrapException:执行引导程序时出错;嵌套异常是java.lang.NoSuchMethodError:org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.setParameterNameDiscoverer(Lorg / springframework / core / ParameterNameDiscoverer;)V 

我的项目是用maven2构建的。我研究了战争依赖关系,看到spring 2.5.6和3.0.0.RELEASE都在那里使用。
然后我试图禁止使用spring 2.5.6,并且Acegi插件出现问题(使用0.5.1版本):

 <$ c#c> 2010-03-10 21:06:56.440:WARN ::嵌套在org.springframework.beans.factory.access.BootstrapException中:执行bootstraps时出错;嵌套异常是java.lang.NoSuchMethodError:org.springframework.web.context.ConfigurableWebApplicationContext.setId(Ljava / lang / String;)V 

任何帮助都将不胜感激。

解决方案

问题是由以下事实引起的: Spring
的版本ConfigurableWebApplicationContext位于spring-web.jar中,但它继承的接口ConfigurableApplicationContext(其中包含setId(String)方法位于spring-context.jar中。)



如果您有一个针对spring-context的老版本编译的库,它将会失败并出现NoMethodFound异常。



解决方案是查找并如果您使用的是低于3.0的Spring版本,则可以尝试使用完整的Spring捆绑包Jar而不是单独的包。


Just moved to Grails 1.2.1 (used 1.1.1 before). Changed application.properties, ran grails upgrade, fixed BuildConfig and Bootstrap - everything works just fine from grails console.

However, getting a problem when deploy packaged war under jetty 6.1.22:

1581 [main] ERROR org.springframework.web.context.ContextLoader  - Context initialization failed org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.NoSuchMethodError: org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.setParameterNameDiscoverer(Lorg/springframework/core/ParameterNameDiscoverer;)V

My project is built with maven2. I researched the war dependencies and see that both spring 2.5.6 and 3.0.0.RELEASE are used there. I then tried to suppress use of spring 2.5.6 and got a problem with Acegi plugin (using version 0.5.1):

2010-03-10 21:06:56.440:WARN::Nested in org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.setId(Ljava/lang/String;)V

Any help would be greatly appreciated.

解决方案

The problem is caused by the fact that in new version of Spring ConfigurableWebApplicationContext is located in spring-web.jar, but the interface it inherits ConfigurableApplicationContext, which contains setId(String) method is in located in spring-context.jar.

If you have a library which has been compiled against older version of spring-context it will fail with NoMethodFound exception.

The solution is to locate and recompile that library against latest Spring version.

If you are using Spring version below 3.0 you could try to put full Spring bundle Jar instead of separate packages.

这篇关于Grails 1.2.1与Jetty下的Spring 3.0.0依赖关系问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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