Skip to content
Browse files

Update to Tomcat7 (replacing Tomcat6)

  - Remove the custom plugin to check for the applications readyness, since Tomcat 7 provides that as an option in server.xml config
  - Remove modifications to context.xml (due to no need for the custom plugin) and server.xml (modifications through vcap staging is sufficient)

Change-Id: Iadff0c2705c1d145659fd3a42fa75d93fa1a154a
  • Loading branch information...
1 parent dfe3a02 commit 332dff57bffa117482d1163b16238b1071973df2 @ramnivas ramnivas committed
View
26 plugins/pom.xml
@@ -1,26 +0,0 @@
-<?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>org.cloudfoundry</groupId>
- <artifactId>vcap-java-plugins</artifactId>
- <packaging>pom</packaging>
- <name>vcap-java-plugins</name>
- <version>1.0.0-BUILD-SNAPSHOT</version>
-
- <modules>
- <module>tomcat_startup_listener</module>
- </modules>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
View
34 plugins/tomcat_startup_listener/pom.xml
@@ -1,34 +0,0 @@
-<project>
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.vmware.appcloud</groupId>
- <artifactId>TomcatStartupListener</artifactId>
- <version>1.0</version>
- <packaging>jar</packaging>
- <dependencies>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>catalina</artifactId>
- <version>6.0.26</version>
- <scope>provided</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>coyote</artifactId>
- <version>6.0.26</version>
- <scope>provided</scope>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.0.2</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- </plugins>
- </build>
-</project>
View
56 ..._startup_listener/src/main/java/com/vmware/appcloud/tomcat/AppCloudLifecycleListener.java
@@ -1,56 +0,0 @@
-package com.vmware.appcloud.tomcat;
-
-import org.apache.catalina.Container;
-import org.apache.catalina.Lifecycle;
-import org.apache.catalina.LifecycleEvent;
-import org.apache.catalina.LifecycleListener;
-import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.core.StandardEngine;
-
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import java.io.*;
-
-public class AppCloudLifecycleListener implements LifecycleListener, NotificationListener {
-
- private String stateFile;
-
- private static final String APPCLOUD_STATE_FILE = "tomcat.state";
- private static final String J2EE_RUNNING_STATE = "j2ee.state.running";
-
- public void lifecycleEvent(LifecycleEvent event) {
- Lifecycle lifecycle = event.getLifecycle();
-
- if (lifecycle instanceof StandardContext) {
- StandardContext context = (StandardContext) lifecycle;
- if (event.getType().equals(Lifecycle.BEFORE_START_EVENT)) {
- Container grandParent = context.getParent().getParent();
- if (grandParent instanceof StandardEngine) {
- StandardEngine engine = (StandardEngine) grandParent;
- String relativePath = new StringBuilder()
- .append("..")
- .append(File.separator)
- .append(APPCLOUD_STATE_FILE)
- .toString();
- stateFile = new File(engine.getBaseDir(), relativePath).getAbsolutePath();
- context.addNotificationListener(this, null, null);
- }
- } else if (event.getType().equals(Lifecycle.AFTER_STOP_EVENT)) {
- System.err.println("Stopping Tomcat because the context stopped.");
- System.exit(1);
- }
- }
- }
-
- public void handleNotification(Notification notification, Object handback) {
- if (J2EE_RUNNING_STATE.equals(notification.getType())) {
- try {
- PrintWriter writer = new PrintWriter(stateFile);
- writer.println("{\"state\": \"RUNNING\"}");
- writer.close();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
- }
- }
-}
View
11 ...mcat_startup_listener/src/main/java/com/vmware/appcloud/tomcat/TomcatStartupListener.java
@@ -1,11 +0,0 @@
-package com.vmware.appcloud.tomcat;
-
-/**
- * Created by IntelliJ IDEA.
- * User: vspivak
- * Date: Mar 30, 2010
- * Time: 2:43:57 PM
- * To change this template use File | Settings | File Templates.
- */
-public class TomcatStartupListener {
-}
View
2 pom.xml
@@ -17,7 +17,6 @@
<modules>
<module>cloudfoundry-runtime</module>
<module>auto-reconfiguration</module>
- <module>plugins</module>
</modules>
</profile>
<profile>
@@ -26,7 +25,6 @@
<module>cloudfoundry-runtime</module>
<module>cloudfoundry-runtime-tests</module>
<module>auto-reconfiguration</module>
- <module>plugins</module>
</modules>
</profile>
</profiles>
View
2 tomcat-setup/cf-tomcat.zip.sha1
@@ -1 +1 @@
-293386e6ae37d9c01b9941cf5f8fa775a6969b91 *tomcat.zip
+fc3e24aeb72954e838f7aae9628db484ce8a29c7 *tomcat.zip
View
25 tomcat-setup/resources/conf/context.xml
@@ -1,25 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!-- The contents of this file will be loaded for each web application -->
-<Context>
- <WatchedResource>WEB-INF/web.xml</WatchedResource>
-<!--
- <Manager pathname="" />
--->
- <Listener className="com.vmware.appcloud.tomcat.AppCloudLifecycleListener" />
-</Context>
View
43 tomcat-setup/resources/conf/server.xml
@@ -1,43 +0,0 @@
-<?xml version='1.0' encoding='utf-8'?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-<!-- Note: A "Server" is not itself a "Container", so you may not
- define subcomponents such as "Valves" at this level.
- Documentation at /docs/config/server.html
- -->
-<Server port="-1">
-
- <Listener className="org.apache.catalina.core.JasperListener" />
- <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
- <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" />
- <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
-
- <Service name="Catalina">
-
- <Connector port="9022" protocol="HTTP/1.1"
- connectionTimeout="20000" />
-
- <Engine name="Catalina" defaultHost="localhost">
-
- <Host name="localhost" appBase="webapps"
- unpackWARs="true" autoDeploy="true"
- xmlValidation="false" xmlNamespaceAware="false">
- </Host>
-
- </Engine>
- </Service>
-</Server>
View
BIN tomcat-setup/resources/lib/TomcatStartupListener-1.0.jar
Binary file not shown.
View
8 tomcat-setup/tomcat_manifest.yml
@@ -1,11 +1,11 @@
---
-version: 6.0.35
-download_uri: http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.35/bin/apache-tomcat-6.0.35.tar.gz
+version: 7.0.26
+download_uri: http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.26/bin/apache-tomcat-7.0.26.tar.gz
-replace_files: [conf/server.xml, conf/context.xml]
+replace_files: []
clear_dirs: [logs, temp, webapps, work]
remove_files: [NOTICE, RELEASE-NOTES, RUNNING.txt, LICENSE]
-add_jars: [lib/TomcatStartupListener-1.0.jar]
+add_jars: []
# Assumes that the environment variable 'VCAP' has been set to point to
# the root of 'vcap' source hierarchy.

0 comments on commit 332dff5

Please sign in to comment.
Something went wrong with that request. Please try again.