Skip to content
This repository was archived by the owner on Feb 7, 2018. It is now read-only.

Tomcat 8.5 compatibility fix #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
236 changes: 236 additions & 0 deletions dependency-reduced-pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.amazonaws</groupId>
<artifactId>aws-dynamodb-session-tomcat</artifactId>
<name>Amazon DynamoDB Session Manager for Tomcat</name>
<version>2.0.3</version>
<description>The Amazon DynamoDB Session Manager for Tomcat provides a custom session manager for Tomcat 7 that stores session data in Amazon DynamoDB, Amazon's fully managed NoSQL database service.</description>
<url>https://aws.amazon.com/java</url>
<developers>
<developer>
<id>amazonwebservices</id>
<organization>Amazon Web Services</organization>
<organizationUrl>https://aws.amazon.com</organizationUrl>
<roles>
<role>developer</role>
</roles>
</developer>
</developers>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>https://aws.amazon.com/apache2.0</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/aws/aws-dynamodb-session-tomcat.git</url>
</scm>
<build>
<resources>
<resource>
<directory>${basedir}</directory>
<includes>
<include>LICENSE.txt</include>
<include>NOTICE.txt</include>
<include>README.md</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer />
<transformer>
<addHeader>false</addHeader>
</transformer>
</transformers>
<minimizeJar>true</minimizeJar>
<relocations>
<relocation>
<pattern>com.amazonaws</pattern>
<shadedPattern>com.amazonaws.tomcatsessionmanager.amazonaws</shadedPattern>
<excludes>
<exclude>com.amazonaws.services.dynamodb.sessionmanager.DynamoDBSessionManager</exclude>
</excludes>
</relocation>
<relocation>
<pattern>org.apache.http</pattern>
<shadedPattern>com.amazonaws.tomcatsessionmanager.apache.http</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons.logging</pattern>
<shadedPattern>com.amazonaws.tomcatsessionmanager.apache.commons.logging</shadedPattern>
</relocation>
<relocation>
<pattern>org.apache.commons.codec</pattern>
<shadedPattern>com.amazonaws.tomcatsessionmanager.apache.commons.codec</shadedPattern>
</relocation>
<relocation>
<pattern>com.fasterxml</pattern>
<shadedPattern>com.amazonaws.tomcatsessionmanager.fasterxml</shadedPattern>
</relocation>
<relocation>
<pattern>org.joda.time</pattern>
<shadedPattern>com.amazonaws.tomcatsessionmanager.joda.time</shadedPattern>
</relocation>
</relocations>
<artifactSet>
<includes>
<include>com.amazonaws:aws-java-sdk*</include>
<include>commons-logging:*</include>
<include>org.apache.httpcomponents:*</include>
<include>commons-codec:*</include>
<include>com.fasterxml.jackson.core:*</include>
<include>joda-time:*</include>
</includes>
</artifactSet>
<filters>
<filter>
<artifact>commons-logging:commons-logging</artifact>
<includes>
<include>**</include>
</includes>
</filter>
<filter>
<artifact>com.fasterxml.jackson.core:*</artifact>
<includes>
<include>**</include>
</includes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>8.5.4</version>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>tomcat-servlet-api</artifactId>
<groupId>org.apache.tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>tomcat-jsp-api</artifactId>
<groupId>org.apache.tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>tomcat-juli</artifactId>
<groupId>org.apache.tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>tomcat-annotations-api</artifactId>
<groupId>org.apache.tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>tomcat-api</artifactId>
<groupId>org.apache.tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>tomcat-jni</artifactId>
<groupId>org.apache.tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>tomcat-coyote</artifactId>
<groupId>org.apache.tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>tomcat-util</artifactId>
<groupId>org.apache.tomcat</groupId>
</exclusion>
<exclusion>
<artifactId>tomcat-util-scan</artifactId>
<groupId>org.apache.tomcat</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.10.19</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
<exclusion>
<artifactId>objenesis</artifactId>
<groupId>org.objenesis</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-test-utils</artifactId>
<version>1.10.63</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>8.5.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>8.5.4</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>tomcat-embed-el</artifactId>
<groupId>org.apache.tomcat.embed</groupId>
</exclusion>
<exclusion>
<artifactId>ecj</artifactId>
<groupId>org.eclipse.jdt.core.compiler</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>

10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-catalina</artifactId>
<version>7.0.64</version>
<version>8.5.4</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -73,13 +73,13 @@
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>7.0.64</version>
<version>8.5.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<version>7.0.64</version>
<version>8.5.4</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down Expand Up @@ -191,7 +191,7 @@
</plugin>
</plugins>
</build>

<!--
<profiles>
<profile>
<id>publishing</id>
Expand Down Expand Up @@ -227,5 +227,5 @@
</build>
</profile>
</profiles>

-->
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public DynamoDBSessionManager() {
setMaxIdleBackup(30); // 30 seconds
}

@Override
public String getInfo() {
return info;
}
Expand Down Expand Up @@ -131,7 +130,7 @@ public void setDeleteCorruptSessions(boolean deleteCorruptSessions) {

@Override
protected void initInternal() throws LifecycleException {
this.setDistributable(true);
getContext().setDistributable(true);

AmazonDynamoDBClient dynamoClient = createDynamoClient();
initDynamoTable(dynamoClient);
Expand Down Expand Up @@ -261,7 +260,7 @@ private SessionConverter getSessionConverter() {
// TODO Inline this method with getManager().getContext() when Tomcat7 is no longer supported
private Context getAssociatedContext() {
try {
return (Context) getContainer();
return getContext();
} catch (ClassCastException e) {
logger.fatal("Unable to cast " + getClass().getName() + " to a Context."
+ " DynamoDB SessionManager can only be used with a Context");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public DynamoDBSessionStore(DynamoSessionStorage sessionStorage, boolean deleteC
this.deleteCorruptSessions = deleteCorruptSessions;
}

@Override
public String getInfo() {
return info;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private static Map<String, Object> getDefaultSessionAttributes() {

private static Manager getDefaultManager() {
Manager mockManager = mock(Manager.class, RETURNS_DEEP_STUBS);
when(mockManager.getContainer().getLogger().isDebugEnabled()).thenReturn(false);
when(mockManager.getContext().getLogger().isDebugEnabled()).thenReturn(false);
return mockManager;
}

Expand Down