Results 1 to 3 of 3

Thread: Grails App on tc Server 2.1.2 - java.lang.NoClassDefFoundError: AuthenticationSource

  1. #1

    Default Grails App on tc Server 2.1.2 - java.lang.NoClassDefFoundError: AuthenticationSource

    I am developing a simple grails application in STS 2.5.2 and using spring-security and spring-security-ldap plugins.

    This application works in STS workspace, I can even authenticate user against the company active directory (LDAP).

    But the problem is, after dropping the application war file in tcServer 2.1.2 runtime instance. It fails to start throws below exception.

    However I see the org/springframework/ldap/core/AuthenticationSource.class in \WEB-INF\lib\org.springframework.ldap-1.3.0.RELEASE.jar

    1. Not sure what could be the problem on tc Server while no issues in STS.
    2. Why the tc Server runtime not able to find the AuthenticatinSource class.
    3. The class I am seeing in jar file and the class it is looking, are they same ? The exception doesn't show me the package name...


    Code:
    2011-03-11 09:31:23,696 [WrapperSimpleAppMain] INFO  spring.BeanBuilder  - [RuntimeConfiguration] Configuring data source for environment: PRODUCTION
    2011-03-11 09:31:24,258 [WrapperSimpleAppMain] ERROR context.ContextLoader  - Context initialization failed
    org.springframework.beans.factory.access.BootstrapException: Error executing bootstraps; nested exception is org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: AuthenticationSource
    	at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:87)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4205)
    	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
    	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
    	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
    	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:623)
    	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:941)
    	at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)
    	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)
    	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1320)
    	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
    	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1061)
    	at org.apache.catalina.core.StandardHost.start(StandardHost.java:862)
    	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
    	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
    	at org.apache.catalina.core.StandardService.start(StandardService.java:525)
    	at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
    	at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
    	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
    	at net.covalent.tomcat.wrapper.ThreadDumpWrapper.main(ThreadDumpWrapper.java:73)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:197)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.NoClassDefFoundError: AuthenticationSource
    	at grails.spring.BeanBuilder.invokeBeanDefiningClosure(BeanBuilder.java:723)
    	at grails.spring.BeanBuilder.beans(BeanBuilder.java:573)
    	at grails.spring.BeanBuilder.invokeMethod(BeanBuilder.java:519)
    	at net.covalent.tomcat.wrapper.ThreadDumpWrapper.main(ThreadDumpWrapper.java:73)
    	... 2 more
    Caused by: java.lang.NoClassDefFoundError: AuthenticationSource
    	at java.lang.ClassLoader.defineClass1(Native Method)
    	at java.lang.ClassLoader.defineClassCond(Unknown Source)
    	at java.lang.ClassLoader.defineClass(Unknown Source)
    	at java.security.SecureClassLoader.defineClass(Unknown Source)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Unknown Source)
    	at SpringSecurityLdapGrailsPlugin$_closure1.class$(SpringSecurityLdapGrailsPlugin.groovy)
    	at SpringSecurityLdapGrailsPlugin$_closure1.$get$$class$org$codehaus$groovy$grails$plugins$springsecurity$ldap$SimpleAuthenticationSource(SpringSecurityLdapGrailsPlugin.groovy)
    	at SpringSecurityLdapGrailsPlugin$_closure1.doCall(SpringSecurityLdapGrailsPlugin.groovy:77)
    	at SpringSecurityLdapGrailsPlugin$_closure1.doCall(SpringSecurityLdapGrailsPlugin.groovy)
    	... 6 more
    Caused by: java.lang.ClassNotFoundException: AuthenticationSource
    	... 16 more
    Please help, Thanks
    YA

  2. #2
    Join Date
    Oct 2008
    Posts
    493

    Default

    I'll try an enlist some help from one of our Grails experts.

    In the meantime, when you say that things worked fine in STS, which runtime did you have your application deployed to? I'm interested in any possible differences between it and the runtime where it fails.
    Andy Wilkinson
    SpringSource

  3. #3
    Join Date
    Sep 2011
    Posts
    1

    Default Similar problem on Weblogic 10

    Considering the age of this post, I'm hoping that the solution has been found - I'll keep searching the web but thought I'd leave a breadcrumb here in case the original poster would care to share that solution. I'm getting the same type of error, but deploying to WebLogic 10: in STS 2.6.1, 'run-app' works fine (tomcat), and after changing the destdir for classes, 'run-war' (tomcat) also works. BUT when I deploy a WAR locally or on test to WebLogic, I get the NoClassDefFoundError - specifically related to the Spring Security classes (tags, etc.) despite being able to see them in the 'proper' places.

    Thank you in advance for any help you can offer!

    M. Kerry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •