views:

478

answers:

1

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.

A: 

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.

Dmitry Buzdin
Thanks Dmitry. I've already found and fixed that ;)
archer