开发者

Grails 1.2.1 with Spring 3.0.0 dependency problem under Jetty

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜