Installation Troubles with LDAP on RHEL 5

Scott Battaglia scott.battaglia at gmail.com
Fri May 18 09:30:46 EDT 2007


Paul,

Yep, you're missing a jar file.

"Instantiation of bean failed; nested exception is
java.lang.NoClassDefFoundError: com.sun.jndi.ldap.LdapCtxFactory"

You can download the Spring LDAP distribution and there should be another
jar in it that you need (the name always evades me).

-Scott
-- 
-Scott Battaglia

LinkedIn: http://www.linkedin.com/in/scottbattaglia

On 5/18/07, Paul Ortman <portman at goshen.edu> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I'm running into a frustrating installation/integration problem
> that, despite quite a bit of mailing list and Google searching,
> seems to elude my explanation.
>
> On a RHEL 5 installation, with tomcat and java installed [1], I got
> the demo cas.war deployed and it works great using the
> username=password authentication.  However, when I follow the
> instructions for configuring the auth to use LDAP, I'm given an
> enormous number of thrown exceptions even when just loading the
> login page.
>
>
>   org.springframework.beans.factory.BeanCreationException: Error
>   creating bean with name 'centralAuthenticationService' defined in
>   ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot
>   resolve reference to bean 'authenticationManager' while setting
>   bean property 'authenticationManager'; nested exception is
>   org.springframework.beans.factory.BeanCreationException: Error
>   creating bean with name 'authenticationManager' defined in
>   ServletContext resource [/WEB-INF/deployerConfigContext.xml]:
>   Cannot create inner bean
>   'org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler#48c4fa0'
>   of type
>   [org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler]
>   while setting bean property 'authenticationHandlers' with key [1];
>   nested exception is
>   org.springframework.beans.factory.BeanCreationException: Error
>   creating bean with name
>   'org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler#48c4fa0'
>   defined in ServletContext resource
>   [/WEB-INF/deployerConfigContext.xml]: Cannot resolve reference to
>   bean 'contextSource' while setting bean property 'contextSource';
>   nested exception is
>   org.springframework.beans.factory.BeanCreationException: Error
>   creating bean with name 'contextSource' defined in ServletContext
>   resource [/WEB-INF/deployerConfigContext.xml]: Instantiation of
>   bean failed; nested exception is java.lang.NoClassDefFoundError:
>   com.sun.jndi.ldap.LdapCtxFactory
>
> I'm no java guru, and I'm obviously new to CAS, so I'm not sure
> exactly what's going on.  The catalina logging doesn't seem to shed
> any light either:
>
>   ERROR
>   [org.apache.catalina.core.ContainerBase
> .[Catalina].[localhost].[/cas].[cas]]
>   - <Servlet.service() for servlet cas threw exception>
>   org.springframework.context.ApplicationContextException: Unable to
>   initialize application context.  at
>   org.jasig.cas.web.init.SafeDispatcherServlet.service(
> SafeDispatcherServlet.java:117)
>   at
>   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
> catalina-5.5.23.jar.so)
>
> It would seem to me that the original problem is that the
> LdapCtxFactory class seems to be missing.  Can this really be?  Is
> there some other testing I could do?
>
> The other information that might be useful.
>
>   CAS Version: 3.0.7
>   RHEL Version: 5.0 (plus current patches)
>   Tomcat Version: 5.5
>   Java Version: 1.4.2
>   Spring LDAP Version: 1.1.2
>
> My localPlugins directory contains:
>
>   -rw-r--r-- 1 root root  13431 May 17 11:09 cas-server-ldap-3.0.7.jar
>   -rw-r--r-- 1 root root 559366 May 17 12:57 commons-collections.jar
>   -rw-r--r-- 1 root root 207723 May 17 12:57 commons-lang.jar
>   -rw-r--r-- 1 root root  38015 May 17 12:57 commons-logging.jar
>   -rw-r--r-- 1 root root  49437 May 17 12:57 ldapbp.jar
>   -rw-r--r-- 1 root root 373325 May 17 12:57 spring-beans.jar
>   -rw-r--r-- 1 root root 122078 May 17 12:57 spring-context.jar
>   -rw-r--r-- 1 root root 172430 May 17 12:57 spring-core.jar
>   -rw-r--r-- 1 root root 123817 May 17 12:57 spring-dao.jar
>   -rw-r--r-- 1 root root 110756 May 17 12:57 spring-ldap-1.1.2.jar
>
> The resulting cas.war is built successfully.
>
> I've also configured the WEB-INF/deployerConfigContext.xml (here w/o
> comments) and built this into the custom cas.war:
>
>   <?xml version="1.0" encoding="UTF-8"?>
>   <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "
> http://www.springframework.org/dtd/spring-beans.dtd">
>   <beans>
>     <bean id="authenticationManager" class="
> org.jasig.cas.authentication.AuthenticationManagerImpl">
>       <property name="credentialsToPrincipalResolvers">
>         <list>
>           <bean class="
> org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver
> "/>
>           <bean class="
> org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver
> "/>
>         </list>
>       </property>
>       <property name="authenticationHandlers">
>         <list>
>           <bean class="
> org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler
> ">
>             <property name="httpClient" ref="httpClient"/>
>           </bean>
>           <bean class="
> org.jasig.cas.adaptors.ldap.FastBindLdapAuthenticationHandler">
>             <property name="filter"
> value="uid=%u,ou=people,dc=goshen,dc=edu"/>
>             <property name="contextSource" ref="contextSource"/>
>           </bean>
>         </list>
>       </property>
>     </bean>
>     <bean id="contextSource" class="
> org.jasig.cas.adaptors.ldap.util.AuthenticatedLdapContextSource">
>       <property name="urls">
>         <list>
>           <value>ldap://openldap-repl.goshen.edu/</value>
>           <value>ldap://openldap.goshen.edu/</value>
>         </list>
>       </property>
>     </bean>
>   </beans>
>
>
> I'm really stumped on this one.  If anyone can help, I'd greatly
> appreciate it.  Thanks in advance.
>
>
> [1] tomcat5-servlet-2.4-api-5.5.23-0jpp.1.0.3.el5
>     tomcat5-5.5.23-0jpp.1.0.3.el5
>     tomcat5-admin-webapps-5.5.23-0jpp.1.0.3.el5
>     java-1.4.2-gcj-compat-1.4.2.0-40jpp.112
>     java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp.112
>     tomcat5-jasper-5.5.23-0jpp.1.0.3.el5
>     tomcat5-jsp-2.0-api-5.5.23-0jpp.1.0.3.el5
>     tomcat5-common-lib-5.5.23-0jpp.1.0.3.el5
>     tomcat5-server-lib-5.5.23-0jpp.1.0.3.el5
>
>
> - --
> Paul Ortman
>
> PGP Key: 55602C81
> - --
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.6 (GNU/Linux)
>
> iD8DBQFGTadDfw8KGlVgLIERAoUdAJ92/kjstKdVw9VXfbCC0TYAL0T9pACaAr0G
> 32mDtyMaW+vCbYHPkuwLLHs=
> =5ujM
> -----END PGP SIGNATURE-----
> _______________________________________________
> Yale CAS mailing list
> cas at tp.its.yale.edu
> http://tp.its.yale.edu/mailman/listinfo/cas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tp.its.yale.edu/pipermail/cas/attachments/20070518/f9f47606/attachment.html 


More information about the cas mailing list