Thanks to your help i found (at last ;)): http://www.ja-sig.org/wiki/display/CASUM/Best+Practice+-+Setting+Up+CAS+Locally+using+the+Maven2+WAR+Overlay+Method

So now iam using war overlay method, added the requird dependency and everything is working fine now. Thanks A LOT for your help.

-
Markus

Scott Battaglia wrote:
That page apparently misses one piece that most of the other pages have and that is to include in your pom.xml a dependency on the cas-server-support-generic.

Cheers,
Scott



On Tue, Jan 12, 2010 at 11:06 AM, Markus Kosubek <[email protected] <mailto:[email protected]>> wrote:

    Hi,

    i just setup a tomcat with cas successfully. The cas-demo works fine
    (the copy of
    $CAS_HOME/modules/cas-server-webapp-3.3.5/cas-server-webapp.jar in
    $CATALINA_HOME/webapps).

    But when i try to implement the generic authentication handler like
    here: http://www.ja-sig.org/wiki/display/CASUM/Generic i run into
    some trouble...

    I installed a Maven2-Binary in a subfolder of / and changed my $PATH
    accordingly. I neither build maven from scratch nor installed a
    distribution-package, because it seems that there is no maven-rpm
    for SLES11 (could that be?)

    Further the environment-variables $JAVA_HOME and $JRE_HOME are set
    correctly. J2SE (JDK) is installed.

    My change in
    
$CAS_HOME/cas-server-webapp-3.3.5/cas-server-webapp/src/main/webapp/WEB-INF/deployerConfigContext.xml
    looks like this (just deactivated bean
    
'org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler'
    and added bean
    'org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler'):

    ...
    <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"
    p:httpClient-ref="httpClient" />
    <!--<bean
    
class="org.jasig.cas.authentication.handler.support.SimpleTestUsernamePasswordAuthenticationHandler"
    />-->
    <bean
    class="org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler">
      <property name="users">
         <map>
            <entry key="hans" value="wurst" />
         </map>
      </property>
    </bean>
    ...

    then i run
    mvn package install
    in folder $CAS_HOME/cas-server-webapp

    My maven-info looks fine (just the last part):
    -------------------------------------------------------
     T E S T S
    -------------------------------------------------------
    Running org.jasig.cas.util.AutowiringSchedulerFactoryBeanTests
    log4j:WARN No appenders could be found for logger
    (org.springframework.context.support.ClassPathXmlApplicationContext).
    log4j:WARN Please initialize the log4j system properly.
    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
    0.804 sec

    Results :

    Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

    [INFO] [war:war {execution: default-war}]
    [INFO] Packaging webapp
    [INFO] Assembling webapp[cas-server-webapp] in
    
[/fhg/cas-server-3.3.5/cas-server-webapp/target/clover/cas-server-webapp-3.3.5-clover]
    [INFO] Processing war project
    [INFO] Copying webapp
    resources[/fhg/cas-server-3.3.5/cas-server-webapp/src/main/webapp]
    [INFO] Webapp assembled in[238 msecs]
    [INFO] Building war:
    /fhg/cas-server-3.3.5/cas-server-webapp/target/clover/cas.war
    [INFO] [install:install {execution: default-install}]
    [INFO] Installing
    /fhg/cas-server-3.3.5/cas-server-webapp/target/clover/cas.war to
    
/root/.m2/repository/org/jasig/cas/cas-server-webapp/3.3.5/cas-server-webapp-3.3.5-clover.war
    [INFO] Installing
    
/fhg/cas-server-3.3.5/cas-server-webapp/target/cas-server-webapp-3.3.5-sources.jar
    to
    
/root/.m2/repository/org/jasig/cas/cas-server-webapp/3.3.5/cas-server-webapp-3.3.5-sources.jar
    [INFO] Installing
    
/fhg/cas-server-3.3.5/cas-server-webapp/target/cas-server-webapp-3.3.5-sources.jar
    to
    
/root/.m2/repository/org/jasig/cas/cas-server-webapp/3.3.5/cas-server-webapp-3.3.5-sources.jar
    [INFO] [clover2:instrument {execution: default}]
    [INFO] [install:install {execution: default-install}]
    [INFO] Installing
    /fhg/cas-server-3.3.5/cas-server-webapp/target/cas.war to
    
/root/.m2/repository/org/jasig/cas/cas-server-webapp/3.3.5/cas-server-webapp-3.3.5.war
    [INFO] Installing
    
/fhg/cas-server-3.3.5/cas-server-webapp/target/cas-server-webapp-3.3.5-sources.jar
    to
    
/root/.m2/repository/org/jasig/cas/cas-server-webapp/3.3.5/cas-server-webapp-3.3.5-sources.jar
    [INFO] Installing
    
/fhg/cas-server-3.3.5/cas-server-webapp/target/cas-server-webapp-3.3.5-sources.jar
    to
    
/root/.m2/repository/org/jasig/cas/cas-server-webapp/3.3.5/cas-server-webapp-3.3.5-sources.jar
    [INFO]
    ------------------------------------------------------------------------
    [INFO] BUILD SUCCESSFUL
    [INFO]
    ------------------------------------------------------------------------
    [INFO] Total time: 3 minutes 21 seconds
    [INFO] Finished at: Tue Jan 12 16:23:19 CET 2010
    [INFO] Final Memory: 61M/81M
    [INFO]
    ------------------------------------------------------------------------

    Then i copy
    
/root/.m2/repository/org/jasig/cas/cas-server-webapp/3.3.5/cas-server-webapp-3.3.5.war
    to my $CATALINA_HOME/webapps directory and start tomcat, but cas
    won´t work, it is failing with following stacktrace ... looks like
    class
    'org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler' is
    not found, but i don´t know why.

    2010-01-12 16:25:07,846 ERROR
    [org.springframework.web.context.ContextLoader] - Context
    initialization failed
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'centralAuthenticationService' defined in
    ServletContext resource
    [/WEB-INF/spring-configuration/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.generic.AcceptUsersAuthenticationHandler#687ea9'
    of type
    [org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler]
    while setting bean property 'authenticationHandlers' with key [1];
    nested exception is
    org.springframework.beans.factory.CannotLoadBeanClassException:
    Cannot find class
    [org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler]
    for bean with name
    'org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler#687ea9'
    defined in ServletContext resource
    [/WEB-INF/deployerConfigContext.xml]; nested exception is
    java.lang.ClassNotFoundException:
    org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler
           at
    
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)

           [...]

    Caused by: 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.generic.AcceptUsersAuthenticationHandler#687ea9'
    of type
    [org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler]
    while setting bean property 'authenticationHandlers' with key [1];
    nested exception is
    org.springframework.beans.factory.CannotLoadBeanClassException:
    Cannot find class
    [org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler]
    for bean with name
    'org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler#687ea9'
    defined in ServletContext resource
    [/WEB-INF/deployerConfigContext.xml]; nested exception is
    java.lang.ClassNotFoundException:
    org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler
           at
    
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)

           [...]

    Caused by:
    org.springframework.beans.factory.CannotLoadBeanClassException:
    Cannot find class
    [org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler]
    for bean with name
    'org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler#687ea9'
    defined in ServletContext resource
    [/WEB-INF/deployerConfigContext.xml]; nested exception is
    java.lang.ClassNotFoundException:
    org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler
           at
    
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1141)

           [...]

    2010-01-12 16:25:07,867 FATAL
    [org.jasig.cas.web.init.SafeContextLoaderListener] -
    SafeContextLoaderListener:
    The Spring ContextLoaderListener we wrap threw on contextInitialized.
    But for our having caught this error, the web application context
    would not have initialized.
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'centralAuthenticationService' defined in
    ServletContext resource
    [/WEB-INF/spring-configuration/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.generic.AcceptUsersAuthenticationHandler#687ea9'
    of type
    [org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler]
    while setting bean property 'authenticationHandlers' with key [1];
    nested exception is
    org.springframework.beans.factory.CannotLoadBeanClassException:
    Cannot find class
    [org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler]
    for bean with name
    'org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler#687ea9'
    defined in ServletContext resource
    [/WEB-INF/deployerConfigContext.xml]; nested exception is
    java.lang.ClassNotFoundException:
    org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler
           at
    
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)

           [...]

    Caused by: 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.generic.AcceptUsersAuthenticationHandler#687ea9'
    of type
    [org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler]
    while setting bean property 'authenticationHandlers' with key [1];
    nested exception is
    org.springframework.beans.factory.CannotLoadBeanClassException:
    Cannot find class
    [org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler]
    for bean with name
    'org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler#687ea9'
    defined in ServletContext resource
    [/WEB-INF/deployerConfigContext.xml]; nested exception is
    java.lang.ClassNotFoundException:
    org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler
           at
    
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:230)

           [...]

    Caused by:
    org.springframework.beans.factory.CannotLoadBeanClassException:
    Cannot find class
    [org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler]
    for bean with name
    'org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler#687ea9'
    defined in ServletContext resource
    [/WEB-INF/deployerConfigContext.xml]; nested exception is
    java.lang.ClassNotFoundException:
    org.jasig.cas.adaptors.generic.AcceptUsersAuthenticationHandler
           at
    
org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1141)

           [...]

    Even an attempt with
    'org.jasig.cas.adaptors.generic.FileAuthenticationHandler' fails
    with the same error. If i build cas with the default
    deployerConfigContext.xml, everything is working fine.

    My goal is to bring up the elearning-platform ILIAS with CAS and
    ldap in background but before starting ldap-tests, i´d like to test
    the generic authentication-methods.
    My OS is SLES11.0

    Any suggestion about this would be helpful.

    TIA
    Markus

-- Zentrale der Fraunhofer-Gesellschaft e.V.
    Markus Kosubek, Abt. C7 - Kommunikationsmanagement
    Tel: +49 2241 14 -2114; Fax: -42114
    Schloss Birlinghoven
    53754 Sankt Augustin

-- You are currently subscribed to [email protected]
    <mailto:[email protected]> as: [email protected]
    <mailto:[email protected]>
    To unsubscribe, change settings or access archives, see
    http://www.ja-sig.org/wiki/display/JSG/cas-user


--
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user


--
Zentrale der Fraunhofer-Gesellschaft e.V.
Markus Kosubek, Abt. C7 - Kommunikationsmanagement
Tel: +49 2241 14 -2114; Fax: -42114
Schloss Birlinghoven
53754 Sankt Augustin

--
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to