SSO CAS avec Share

cancel
Showing results for 
Search instead for 
Did you mean: 
fo1337-fr
Member II

SSO CAS avec Share

Apparement, il y a un moyen de faire fonctionner un CAS avec Alfresco Explorer ET Share, en utilisant les instructions de ce site: http://blog.atolcd.com/?p=115

Malheureusement, cela ne semble pas marcher. Je compile l'amp comme prevu, et je l'applique comme d'habitude sur alfresco.war. Au moment de relancer la machine, j'obtiens l'erreur suivante dans les logs:

14:52:14,623 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.atolcd.alfresco.LoginCas] for bean with name 'webscript.com.atolcd.alfresco.logincas.get' defined in file [/opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/module/cas-alfresco/module-context.xml]; nested exception is java.lang.ClassNotFoundException: com.atolcd.alfresco.LoginCas
Caused by: java.lang.ClassNotFoundException: com.atolcd.alfresco.LoginCas
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:201)
        at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:327)
        at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1075)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:282)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
        at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:244)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:187)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:830)
        at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:719)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:490)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1149)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
        at org.apache.catalina.core.StandardService.start(StandardService.java:516)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:616)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

Pourtant, le .jar en question est bien present dans /opt/Alfresco/tomcat/webapps/alfresco/WEB-INF/lib. Quel est le probleme?

Merci.
2 Replies
bertrandf
Active Member

Re: SSO CAS avec Share

Apparemment, il ne trouve pas la classe LoginCas lors de l'injection Spring.
Dans le module-context.xml ( class="com.atolcd.alfresco.LoginCas"):
 <bean id="webscript.com.atolcd.alfresco.logincas.get" class="com.atolcd.alfresco.LoginCas" parent="webscript">

Vous avez peut être changé l'arborescence des sources java dans le projet?
La classe se trouve normalement dans : /alfresco-cas/src/java/com/atolcd/alfresco/LoginCas.java
fo1337-fr
Member II

Re: SSO CAS avec Share

Vous avez effectivement raison: j'avais mal compile la classe. Elle etait packagee mais pas compilee…

Mais j'ai une autre erreur, et me voila a nouveau bloque. Cela survient lorsque j'essaye de me connecter a Share. Je suis bien transfere sur le CAS, je m'authentifie, et je suis ensuite redirige sur Share. Et l'erreur 500 survient. Pourtant le CAS marche avec Alfresco.

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.alfresco.error.AlfrescoRuntimeException: 06170001 Unable to retrieve object: default of type: theme
   org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:140)
   org.alfresco.web.site.Model.getObject(Model.java:513)
   org.alfresco.web.site.Model.getTheme(Model.java:225)
   org.alfresco.web.site.servlet.DispatcherServlet.dispatch(DispatcherServlet.java:285)
   org.alfresco.web.site.servlet.DispatcherServlet.service(DispatcherServlet.java:165)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
   org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
   org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)

root cause

org.alfresco.web.framework.exception.ModelObjectPersisterException: Error loading object id: default from persister id: RemoteStore_alfresco/site-data/themes_theme
   org.alfresco.web.framework.MultiModelObjectPersister.getObject(MultiModelObjectPersister.java:110)
   org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:136)
   org.alfresco.web.site.Model.getObject(Model.java:513)
   org.alfresco.web.site.Model.getTheme(Model.java:225)
   org.alfresco.web.site.servlet.DispatcherServlet.dispatch(DispatcherServlet.java:285)
   org.alfresco.web.site.servlet.DispatcherServlet.service(DispatcherServlet.java:165)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
   org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
   org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)

root cause

org.alfresco.web.framework.exception.ModelObjectPersisterException: Failure to load model object for path: default.xml
   org.alfresco.web.framework.StoreModelObjectPersister.getObjectByPath(StoreModelObjectPersister.java:170)
   org.alfresco.web.framework.StoreModelObjectPersister.getObject(StoreModelObjectPersister.java:108)
   org.alfresco.web.framework.MultiModelObjectPersister.getObject(MultiModelObjectPersister.java:106)
   org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:136)
   org.alfresco.web.site.Model.getObject(Model.java:513)
   org.alfresco.web.site.Model.getTheme(Model.java:225)
   org.alfresco.web.site.servlet.DispatcherServlet.dispatch(DispatcherServlet.java:285)
   org.alfresco.web.site.servlet.DispatcherServlet.service(DispatcherServlet.java:165)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
   org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
   org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)

root cause

java.lang.NullPointerException
   org.alfresco.util.URLEncoder.encode(URLEncoder.java:106)
   org.alfresco.util.URLEncoder.encode(URLEncoder.java:178)
   com.atolcd.alfresco.CasAlfrescoAuthenticator.authenticate(Unknown Source)
   org.alfresco.connector.AuthenticatingConnector.handshake(AuthenticatingConnector.java:407)
   org.alfresco.connector.AuthenticatingConnector.handshakeOrGuest(AuthenticatingConnector.java:308)
   org.alfresco.connector.AuthenticatingConnector.call(AuthenticatingConnector.java:117)
   org.alfresco.web.scripts.RemoteStore.callGet(RemoteStore.java:694)
   org.alfresco.web.scripts.RemoteStore.hasDocument(RemoteStore.java:344)
   org.alfresco.web.framework.StoreModelObjectPersister.getObjectByPath(StoreModelObjectPersister.java:136)
   org.alfresco.web.framework.StoreModelObjectPersister.getObject(StoreModelObjectPersister.java:108)
   org.alfresco.web.framework.MultiModelObjectPersister.getObject(MultiModelObjectPersister.java:106)
   org.alfresco.web.framework.ModelObjectManager.getObject(ModelObjectManager.java:136)
   org.alfresco.web.site.Model.getObject(Model.java:513)
   org.alfresco.web.site.Model.getTheme(Model.java:225)
   org.alfresco.web.site.servlet.DispatcherServlet.dispatch(DispatcherServlet.java:285)
   org.alfresco.web.site.servlet.DispatcherServlet.service(DispatcherServlet.java:165)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   com.atolcd.alfresco.CasAuthenticationFilter.doFilter(Unknown Source)
   org.jasig.cas.client.authentication.AuthenticationFilter.doFilter(AuthenticationFilter.java:111)
   org.jasig.cas.client.validation.AbstractTicketValidationFilter.doFilter(AbstractTicketValidationFilter.java:167)