cancel
Showing results for 
Search instead for 
Did you mean: 

CAS configuration with Alfresco 4.2.c

bbiais
Champ in-the-making
Champ in-the-making
Hello,

I need help to set up the authentification with CAS on alfresco (Windows 7). I have some difficulties to find documentation for the last version of Alfresco.

I've installed CAS server in the same tomcat instance of alfresco:

D:\Alfresco\tomcat\webapps\cas-server-webapp-3.5.1.war

I consulted the following links:

https://wiki.jasig.org/display/CASUM/Demo

http://ecmstuff.blogspot.co.uk/2011/06/configuring-alfresco-for-sso-with-cas.html

By reaching the login page of CAS:
http://127.0.0.1:8080/cas-server-webapp-3.5.1/login

I get the following error message:

"CAS is Unavailable
There was an error trying to complete your request. Please notify your support desk or try again."

In the log file "tomcat\logs\localhost.2013-09-17", I see error on class "org.jasig.cas.web.view.Saml10SuccessResponseView":


sept. 17, 2013 11:27:50 AM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
sept. 17, 2013 11:27:50 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
sept. 17, 2013 11:27:52 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'cas'
sept. 17, 2013 11:27:53 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
sept. 17, 2013 11:27:58 AM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok)
sept. 17, 2013 11:27:58 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'Spring Surf Dispatcher Servlet'
sept. 17, 2013 11:28:42 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [cas] in context with path [/cas-server-webapp-3.5.1] threw exception [Request processing failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'casSamlServiceSuccessView': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class org.jasig.cas.web.view.Saml10SuccessResponseView] with root cause
java.lang.NoClassDefFoundError: Could not initialize class org.jasig.cas.web.view.Saml10SuccessResponseView
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
   at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
   at org.springframework.web.servlet.view.ResourceBundleViewResolver.initFactory(ResourceBundleViewResolver.java:251)
   at org.springframework.web.servlet.view.ResourceBundleViewResolver.loadView(ResourceBundleViewResolver.java:194)
   at org.springframework.web.servlet.view.AbstractCachingViewResolver.createView(AbstractCachingViewResolver.java:186)
   at org.springframework.web.servlet.view.AbstractCachingViewResolver.resolveViewName(AbstractCachingViewResolver.java:103)
   at org.springframework.web.servlet.DispatcherServlet.resolveViewName(DispatcherServlet.java:1211)
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1160)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:950)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
   at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.java:128)
   at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherServlet.java:57)
   at org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
   at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:63)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
   at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1813)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
   at java.lang.Thread.run(Thread.java:722)


I tried to install CAS server in another intance of tomcat (without Alfresco) and the login page displays correctly.

So, what can I do to run CAS on Alfresco's tomcat instance?

Sorry for my english. Thanks for your help.
3 REPLIES 3

idwright
Star Collaborator
Star Collaborator
I posted about this earlier today at: http://forums.alfresco.com/comment/138417#comment-138417

Specifically to your post it looks like there's a problem with your CAS install - for version 3.5.2 the class listed as missing is in cas-server-core-3.5.2.jar which should be in the WEB-INF/lib directory of your expanded CAS war

I haven't tried running CAS in the Alfresco tomcat recently but I didn't need to do anything special when I have done it

bbiais
Champ in-the-making
Champ in-the-making
Thanks for your help.

I replaced cas-server-webapp-3.5.1.war by cas-server-webapp-3.5.2.war in webapps directory and restarted tomcat.

I checked, the file cas-server-core-3.5.2.jar is in WEB-INF/lib directory.

I always have the same error message in login page (CAS is unaivalable), but I get a different error in log file :


sept. 17, 2013 2:53:53 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
sept. 17, 2013 2:53:53 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
sept. 17, 2013 2:53:55 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'cas'
sept. 17, 2013 2:53:56 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
sept. 17, 2013 2:54:01 PM org.apache.catalina.core.ApplicationContext log
INFO: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter INFO: loaded (conf ok)
sept. 17, 2013 2:54:01 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'Spring Surf Dispatcher Servlet'
sept. 17, 2013 2:54:33 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [cas] in context with path [/cas-server-webapp-3.5.2] threw exception [Request processing failed; nested exception is org.springframework.webflow.execution.FlowExecutionException: Exception thrown in state 'viewLoginForm' of flow 'login'] with root cause
java.lang.NoSuchMethodError: org.apache.xml.serializer.Encodings.isRecognizedEncoding(Ljava/lang/String;)Z
   at org.apache.xml.serializer.dom3.LSSerializerImpl.write(LSSerializerImpl.java:926)
   at org.opensaml.xml.util.XMLHelper.writeNode(XMLHelper.java:910)
   at org.opensaml.xml.util.XMLHelper.writeNode(XMLHelper.java:890)
   at org.opensaml.xml.util.XMLHelper.nodeToString(XMLHelper.java:852)
   at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:158)
   at org.opensaml.xml.XMLConfigurator.load(XMLConfigurator.java:142)
   at org.opensaml.DefaultBootstrap.initializeXMLTooling(DefaultBootstrap.java:199)
   at org.opensaml.DefaultBootstrap.bootstrap(DefaultBootstrap.java:91)
   at org.jasig.cas.web.view.AbstractSaml10ResponseView.<clinit>(AbstractSaml10ResponseView.java:84)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
   at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
   at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147)
   at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:76)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:990)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:943)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
   at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
   at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
   at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
   at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
   at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:913)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:464)
   at org.springframework.web.servlet.view.ResourceBundleViewResolver.initFactory(ResourceBundleViewResolver.java:251)
   at org.springframework.web.servlet.view.ResourceBundleViewResolver.loadView(ResourceBundleViewResolver.java:194)
   at org.springframework.web.servlet.view.AbstractCachingViewResolver.createView(AbstractCachingViewResolver.java:186)
   at org.springframework.web.servlet.view.AbstractCachingViewResolver.resolveViewName(AbstractCachingViewResolver.java:103)
   at org.springframework.webflow.mvc.builder.DelegatingFlowViewResolver.resolveView(DelegatingFlowViewResolver.java:50)
   at org.springframework.webflow.mvc.view.AbstractMvcViewFactory.getView(AbstractMvcViewFactory.java:87)
   at org.springframework.webflow.engine.ViewState.doEnter(ViewState.java:184)
   at org.springframework.webflow.engine.State.enter(State.java:194)
   at org.springframework.webflow.engine.Transition.execute(Transition.java:227)
   at org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:393)
   at org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:214)
   at org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:119)
   at org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555)
   at org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:388)
   at org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210)
   at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:105)
   at org.springframework.webflow.engine.State.enter(State.java:194)
   at org.springframework.webflow.engine.Transition.execute(Transition.java:227)
   at org.springframework.webflow.engine.impl.FlowExecutionImpl.execute(FlowExecutionImpl.java:393)
   at org.springframework.webflow.engine.impl.RequestControlContextImpl.execute(RequestControlContextImpl.java:214)
   at org.springframework.webflow.engine.TransitionableState.handleEvent(TransitionableState.java:119)
   at org.springframework.webflow.engine.Flow.handleEvent(Flow.java:555)
   at org.springframework.webflow.engine.impl.FlowExecutionImpl.handleEvent(FlowExecutionImpl.java:388)
   at org.springframework.webflow.engine.impl.RequestControlContextImpl.handleEvent(RequestControlContextImpl.java:210)
   at org.springframework.webflow.engine.ActionState.doEnter(ActionState.java:105)
   at org.springframework.webflow.engine.State.enter(State.java:194)
   at org.springframework.webflow.engine.Transition.execute(Transition.java:227)
   at org.springframework.webflow.engine.DecisionState.doEnter(DecisionState.java:51)
   at org.springframework.webflow.engine.State.enter(State.java:194)
   at org.springframework.webflow.engine.Transition.execute(Transition.java:227)
   at org.springframework.webflow.engine.DecisionState.doEnter(DecisionState.java:51)
   at org.springframework.webflow.engine.State.enter(State.java:194)
   at org.springframework.webflow.engine.Flow.start(Flow.java:535)
   at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:366)
   at org.springframework.webflow.engine.impl.FlowExecutionImpl.start(FlowExecutionImpl.java:225)
   at org.springframework.webflow.executor.FlowExecutorImpl.launchExecution(FlowExecutorImpl.java:140)
   at org.springframework.webflow.mvc.servlet.FlowHandlerAdapter.handle(FlowHandlerAdapter.java:193)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
   at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody2(SafeDispatcherServlet.java:128)
   at org.jasig.cas.web.init.SafeDispatcherServlet.service_aroundBody3$advice(SafeDispatcherServlet.java:57)
   at org.jasig.cas.web.init.SafeDispatcherServlet.service(SafeDispatcherServlet.java:1)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
   at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
   at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)
   at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:63)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
   at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
   at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
   at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
   at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1813)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
   at java.lang.Thread.run(Thread.java:722)


In the same instance, it seems that Alfresco and tomcat parameters are perturbing CAS server functioning. In another instance, CAS login page display correctly.

I also tried to reinstall alfresco community 4.2.c on another machine, I placed the .war in webapps directory and restarted tomcat, without modifying any configuration files, with the same result.

Is it necessary to configure specific files in alfresco before running CAS server?

Could you specify how you set up the CAS server in your alfresco?

Thanks.

idwright
Star Collaborator
Star Collaborator
My guess from the logs is that you've got a jar version conflict

I've haven't set up Alfresco and CAS in the same tomcat since version 3