cas 5.0.3 + ldap support

91 views
Skip to first unread message

Armando Martins

unread,
Feb 23, 2017, 11:34:09 AM2/23/17
to cas-...@apereo.org
Hi,

I'm trying to configure a cas server with ldap support but when i start my tomcat8, i always have this error :

2017-02-23 17:11:45,449 WARN [org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext] - <Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'servletContainer' defined in class path resource [org/apereo/cas/config/CasEmbeddedContainerConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.context.embedded.EmbeddedServletContainerFactory]: Factory method 'servletContainer' threw exception; nested exception is java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/catalina/loader/WebappClassLoader) previously initiated loading for a different type with name "org/apache/coyote/ProtocolHandler">


It seems to me that there is a conflict between a cas java class and a tomcat8 java class. But i don't understand how i can solve this problem....

Thanks

--
Armando Martins

Todd Pratt

unread,
Feb 23, 2017, 1:22:01 PM2/23/17
to CAS Community
You are correct, if you've used the cas overlay template to build it then it would include tomcat embed libraries and you would need to remove them from the war file that it built to deploy on your own tomcat server.

Armando Martins

unread,
Feb 24, 2017, 4:37:25 AM2/24/17
to cas-...@apereo.org
Thanks a lot for your answer Todd. Do you know if there is a way to exclude this libraries in the pom.xml?

--
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
---
You received this message because you are subscribed to the Google Groups "CAS Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+unsubscribe@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/2a7df723-2088-4225-9673-ef16dd699798%40apereo.org.

Todd Pratt

unread,
Feb 28, 2017, 4:32:52 PM2/28/17
to CAS Community
Yes,  add <packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes> to your maven plugin section in your pom.xml file.  Example of the one I use below.

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <warName>cas</warName>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <recompressZippedFiles>false</recompressZippedFiles>
                    <archive>
                        <compress>false</compress>
                        <manifestFile>${project.build.directory}/war/work/org.apereo.cas/cas-server-webapp/META-INF/MANIFEST.MF
                        </manifestFile>
                    </archive>
                    <overlays>
                        <overlay>
                            <groupId>org.apereo.cas</groupId>
                            <artifactId>cas-server-webapp</artifactId>
                        </overlay>
                    </overlays>
                    <packagingExcludes>WEB-INF/lib/tomcat-*.jar</packagingExcludes>
                </configuration>
            </plugin>
To unsubscribe from this group and stop receiving emails from it, send an email to cas-user+u...@apereo.org.
Reply all
Reply to author
Forward
0 new messages