Spring-web

178 views
Skip to first unread message

Jeremiah Garmatter

unread,
Jul 29, 2020, 4:15:01 PM7/29/20
to CAS Community

Hello,

Recently, I've built a new(er) version of CAS for my university's SSO.
I am utilizing CAS maven overlay to build CAS 5.3 deployed through tomcat. I recently decided to add the management webapp (v5.3) and after adding it to tomcat's webapps directory, I received this error:

29-Jul-2020 16:08:00.669 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
        org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/cas-management]]
                at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1858)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at java.lang.Thread.run(Thread.java:748)
        Caused by: java.lang.IllegalArgumentException: More than one fragment with the name [spring_web] was found. This is not legal with relative ordering. See section 8.2.2 2c of the Servlet specification for details. Consider using absolute ordering.
                at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2203)
                at org.apache.tomcat.util.descriptor.web.WebXml.orderWebFragments(WebXml.java:2162)
                at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1131)
                at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:776)
                at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:299)
                at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:123)
                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5053)
                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
                ... 10 more
29-Jul-2020 16:08:00.669 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Error deploying web application directory [/var/lib/tomcat/cas-management]
        java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/cas-management]]
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:747)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1125)
                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1858)
                at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
                at java.util.concurrent.FutureTask.run(FutureTask.java:266)
                at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
                at java.lang.Thread.run(Thread.java:748)

I looked up absolute ordering and placed <absolute-ordering/> into my web.xml deployment right before the </web-app> line and still received the error. I've tried cleaning Tomcat's work directory as well. I heard that Tomcat may be using the cached data, but no luck there.

Any ideas?

Jeremiah Garmatter

unread,
Jul 30, 2020, 9:27:45 AM7/30/20
to CAS Community, Jeremiah Garmatter
Follow-up:

I've placed the absolute ordering tag within the ROOT application's web.xml file and I was able to get past the spring_web web-fragment error. However, once I did that, I received the same error for log4j, note-for-note. After looking within cas-management/WEB-INF/lib, I found dozens of repeated jar files. The same jar, but different versions. For example, spring-web-4.3.17.RELEASE.jar and spring-web-4.3.20.RELEASE.jar. I tried playing around with the versions maven uses to resolve dependencies with cas-management-overlay-5.3/pom.xml without luck. Currently, I receive the same error as posted yesterday with or without the <absolute-ordering/> tag inside ROOT/WEB-INF/web.xml. I even tried making a web.xml for the cas-management server in a misunderstood attempt at a solution.

Has anyone seen this before?

Ray Bon

unread,
Jul 30, 2020, 10:08:12 AM7/30/20
to cas-...@apereo.org, j-gar...@onu.edu
Jeremiah,

How are these multiple libraries getting in to the lib directory?
You could just delete the duplicates, or wipe and rebuild.

Ray

On Thu, 2020-07-30 at 06:27 -0700, Jeremiah Garmatter wrote:
Notice: This message was sent from outside the University of Victoria email system. Please be cautious with links and sensitive information.
-- 
Ray Bon
Programmer Analyst
Development Services, University Systems

I respectfully acknowledge that my place of work is located within the ancestral, traditional and unceded territory of the Songhees, Esquimalt and WSÁNEĆ Nations.

Jeremiah Garmatter

unread,
Jul 30, 2020, 10:32:54 AM7/30/20
to CAS Community, Ray Bon, Jeremiah Garmatter
Ray,

It looks like Maven is grabbing all of them, after cleaning the target directory within the cas-management-webapp-5.3 directory, I run "./mvnw package" and all of the libraries are installed, duplicates included.
I tried deleting the older versions of spring-web and log4j as those were the two giving me errors (so far). After re-deploying on Tomcat, I check the Catalina logs and it looks like Tomcat hangs trying to deploy the management server. I am trying to deploy the management app on the same machine as cas, if that changes anything.

Catalina log:
30-Jul-2020 09:02:44.246 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [1.2.24] using APR version [1.6.5].
30-Jul-2020 09:02:44.246 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
30-Jul-2020 09:02:44.246 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]
30-Jul-2020 09:02:44.249 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.1g  21 Apr 2020]
30-Jul-2020 09:02:44.381 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["https-openssl-nio-8443"]
30-Jul-2020 09:02:44.561 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
30-Jul-2020 09:02:44.577 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1090 ms
30-Jul-2020 09:02:44.635 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
30-Jul-2020 09:02:44.636 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.56
30-Jul-2020 09:02:44.663 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/var/lib/tomcat/ROOT]
30-Jul-2020 09:02:45.076 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/var/lib/tomcat/ROOT] has finished in [413] ms
30-Jul-2020 09:02:45.076 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/var/lib/tomcat/cas]
30-Jul-2020 09:02:57.103 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
30-Jul-2020 09:03:45.082 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/var/lib/tomcat/cas] has finished in [60,006] ms
30-Jul-2020 09:03:45.082 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/var/lib/tomcat/cas-management]
30-Jul-2020 09:03:54.118 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.



Here is my pom.xml for cas-management, I only added the dependency for JSON and modified the version numbers from the file obtained from https://github.com/apereo/cas-management-overlay/tree/5.3:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd ">
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.apereo.cas</groupId>
    <artifactId>cas-services-management-overlay</artifactId>
    <packaging>war</packaging>
    <version>1.0</version>

    <build>
        <plugins>
            <plugin>
                <groupId>com.rimerosolutions.maven.plugins</groupId>
                  <artifactId>wrapper-maven-plugin</artifactId>
                  <version>0.0.5</version>
                  <configuration>
                      <verifyDownload>true</verifyDownload>
                    <checksumAlgorithm>MD5</checksumAlgorithm>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>${springboot.version}</version>
                <configuration>
                    <mainClass>${mainClassName}</mainClass>
                    <addResources>true</addResources>
                    <executable>${isExecutable}</executable>
                    <layout>WAR</layout>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-war-plugin</artifactId>
                <version>2.6</version>
                <configuration>
                    <warName>cas-management</warName>
                    <failOnMissingWebXml>false</failOnMissingWebXml>
                    <recompressZippedFiles>false</recompressZippedFiles>
                    <archive>
                        <compress>false</compress>
                        <manifestFile>${manifestFileToUse}</manifestFile>
                    </archive>
                    <overlays>
                        <overlay>
                            <groupId>org.apereo.cas</groupId>
                            <artifactId>cas-management-webapp</artifactId>
                        </overlay>
                    </overlays>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
            </plugin>
        </plugins>
        <finalName>cas-management</finalName>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.apereo.cas</groupId>
            <artifactId>cas-management-webapp</artifactId>
            <version>${cas-mgmt.version}</version>
            <type>war</type>
        </dependency>
        <!-- Allow Management webapp to access the same json service registry as cas-->
        <dependency>
            <groupId>org.apereo.cas</groupId>
            <artifactId>cas-server-support-json-service-registry</artifactId>
            <version>${cas.version}</version>
        </dependency>
    </dependencies>

    <properties>
        <cas-mgmt.version>5.3.6</cas-mgmt.version>    
        <cas.version>5.3.6</cas.version>
        <springboot.version>1.5.18.RELEASE</springboot.version>
        <mainClassName>org.springframework.boot.loader.WarLauncher</mainClassName>
        <isExecutable>false</isExecutable>
        <manifestFileToUse>${project.build.directory}/war/work/org.apereo.cas/cas-management-webapp/META-INF/MANIFEST.MF</manifestFileToUse>

        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <repositories>
        <repository>
            <id>sonatype-releases</id>
            <url>http://oss.sonatype.org/content/repositories/releases/</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
            <releases>
                <enabled>true</enabled>
            </releases>
        </repository>
        <repository>
            <id>sonatype-snapshots</id>
            <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
        <repository>
            <id>shibboleth-releases</id>
            <url>https://build.shibboleth.net/nexus/content/repositories/releases</url>
        </repository>
    </repositories>

    <profiles>
        <profile>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <id>exec</id>
            <properties>
                <mainClassName>org.apereo.cas.mgmt.web.CasManagementWebApplication</mainClassName>
                <isExecutable>true</isExecutable>
                <manifestFileToUse></manifestFileToUse>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.soebes.maven.plugins</groupId>
                        <artifactId>echo-maven-plugin</artifactId>
                        <version>0.3.0</version>
                        <executions>
                            <execution>
                                <phase>prepare-package</phase>
                                <goals>
                                    <goal>echo</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <echos>
                            <echo>Executable profile to make the generated CAS management application executable.</echo></echos>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>

        <profile>
            <activation>
                <activeByDefault>false</activeByDefault>
            </activation>
            <id>pgp</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>com.github.s4u.plugins</groupId>
                        <artifactId>pgpverify-maven-plugin</artifactId>
                        <version>1.1.0</version>
                        <executions>
                            <execution>
                                <goals>
                                    <goal>check</goal>
                                </goals>
                            </execution>
                        </executions>
                        <configuration>
                            <pgpKeyServer>hkp://pool.sks-keyservers.net</pgpKeyServer>
                            <pgpKeysCachePath>${settings.localRepository}/pgpkeys-cache</pgpKeysCachePath>
                            <scope>test</scope>
                            <verifyPomFiles>true</verifyPomFiles>
                            <failNoSignature>false</failNoSignature>
                        </configuration>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
</project>

Jeremiah Garmatter

unread,
Jul 30, 2020, 11:07:09 AM7/30/20
to CAS Community, Jeremiah Garmatter, Ray Bon
I went through the entire list of jars, deleting every repeat (about 50 total), redeployed through tomcat and the log still hangs after the jar scan for cas-management. I was careful to only delete the earlier versions of each jar but it seems like some of them are necessary for the application to run.

Ray Bon

unread,
Jul 30, 2020, 11:10:18 AM7/30/20
to j-gar...@onu.edu, cas-...@apereo.org
Jeremiah,

To find the source(s) of old libraries, run
mvnw dependency:tree
You might want to send the out put to file. Then search for the old libraries. You can exclude transitive dependencies with pom entries. If there are a lot of duplicates, this will become tedious.
I was not able to get 5.x cas-management installed. Working on 6.x now.

Ray

Jeremiah Garmatter

unread,
Jul 30, 2020, 11:32:26 AM7/30/20
to CAS Community, Ray Bon, Jeremiah Garmatter
Thank you Ray,

Out of curiosity, I tried removing the json-service registry dependency. After re-packaging, I have no duplicate libraries, however, when re-deploying, the tomcat service is still stuck after scanning for jars. Sounds like I have another issue with the server.

Mickaël

unread,
Jul 30, 2020, 12:00:35 PM7/30/20
to cas-...@apereo.org, Jeremiah Garmatter
Hi,

To solve this problem, I choose CAS dependency to integrate in my cas-manager by checking the spring version in apereo/cas gradle.build file for matching the cas-manager version.

Mickaël

--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
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+u...@apereo.org.
To view this discussion on the web visit https://groups.google.com/a/apereo.org/d/msgid/cas-user/38f822e9-258e-476e-8bfa-266ecb8dc16en%40apereo.org.

Jeremiah Garmatter

unread,
Jul 30, 2020, 2:15:03 PM7/30/20
to CAS Community, Mickaël, Jeremiah Garmatter
Mickaël

Could you explain this in more detail? I use the Maven overlay, not Gradle, but perhaps there is configuration overlap.

Also, I was interested if I could install another version of cas-manangement app. I use CAS 5.3.14 for my login server, would it be possible to use management-server 5.2.x or another version, or are they too different?

Ray Bon

unread,
Jul 30, 2020, 2:29:50 PM7/30/20
to cas-...@apereo.org, millec...@gmail.com, j-gar...@onu.edu
Jeremiah,

We are still using cas-management 4.2 with cas 6.1!
Newer versions of cas-management are leveraging cas code, but not necessarily a cas installation.
As I said before, I am just beginning the upgrade to the latest cas-management, so my knowledge base is shallow.

Ray

Mickaël

unread,
Aug 24, 2020, 11:04:08 AM8/24/20
to CAS Community, j-gar...@onu.edu, Mickaël
Jeremiah,

Sorry for long time of response.

For exemple, if you want to integrate dependency from CAS to connect to a database, you should use the same version of spring otherwize you got an error.

Sincerely,

Mickaël
Reply all
Reply to author
Forward
0 new messages