Monday, November 26, 2012

Grails: How to Solve The LDAP Plugin Error While Trying Startup Your App On Tomcat

There is a bug on the LDAP Plugin 0.8.2 that makes it incompatible with the Tomcat server. If you are getting the follow error when you try startup your WAR file on Tomcat server you can try that soluction!

The Message Error

19/11/2012 10:36:08 
org.apache.catalina.core.StandardContext listenerStartGRAVE: Exception sending 
context initialized event to listener instance of class 
.beans.factory.BeanCreationException: Error creating bean with name 
'ldapAuthoritiesPopulator': Cannot resolve reference to bean 'contextSource' while 
setting constructor argument; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'contextSource': Instantiation of bean failed; nested exception is 
org.springframework.beans.BeanInstantiationException: Could not instantiate bean 
class []: 
Constructor threw exception; nested exception is java.lang.NoSuchMethodError:;)V 
at at at at at at at at 
org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean( at at$1.getObject( at 

The Soluction

Just replace the gldapo-0.8.2.jar and spring-ldap-1.2.1.jar lib files for the gldapo-0.8.5.jar and spring-ldap-1.3.0.jar and rename them as gldapo-0.8.2.jar and spring-ldap-1.2.1.jar on your grails project directory (<your user directory/.grails/<your grails version>/projects/<your project name>/plugins/ldap-0.8.2/lib).

So, you will need the gldapo-0.8.5.jar and spring-ldap-1.3.0.jar files. Unfortunately I don't remember when I've got them, but you can search them on the internet.


  1. Replies
    1. Thanks for comment, Grissa. I'm happy that it helped you!

  2. We have 2015, ldap plugin is great but the problem still exists.
    Please find programmatic solution to that problem: