You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2011/01/25 21:44:57 UTC
svn commit: r1063450 [1/2] - in /openejb/branches/openejb-3.1.x/assembly:
itest-runner/ itest-runner/src/ itest-runner/src/main/
itest-runner/src/main/groovy/ itest-runner/src/main/java/
itest-runner/src/test/ itest-runner/src/test/groovy/ itest-runner...
Author: jgallimore
Date: Tue Jan 25 20:44:56 2011
New Revision: 1063450
URL: http://svn.apache.org/viewvc?rev=1063450&view=rev
Log:
OPENEJB-1403 merge Tomcat 7 support over from trunk
Added:
openejb/branches/openejb-3.1.x/assembly/itest-runner/
openejb/branches/openejb-3.1.x/assembly/itest-runner/pom.xml
openejb/branches/openejb-3.1.x/assembly/itest-runner/src/
openejb/branches/openejb-3.1.x/assembly/itest-runner/src/main/
openejb/branches/openejb-3.1.x/assembly/itest-runner/src/main/groovy/
openejb/branches/openejb-3.1.x/assembly/itest-runner/src/main/java/
openejb/branches/openejb-3.1.x/assembly/itest-runner/src/test/
openejb/branches/openejb-3.1.x/assembly/itest-runner/src/test/groovy/
openejb/branches/openejb-3.1.x/assembly/itest-runner/src/test/groovy/commands/
openejb/branches/openejb-3.1.x/assembly/itest-runner/src/test/groovy/commands/SetupCommand.groovy
openejb/branches/openejb-3.1.x/assembly/itest-runner/src/test/java/
openejb/branches/openejb-3.1.x/assembly/itest-runner/src/test/script/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/pom.xml
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/src/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/src/main/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/src/main/assembly/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/src/main/assembly/tomee.xml
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/pom.xml
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/src/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/src/main/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/src/main/assembly/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/src/main/assembly/tomee.xml
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/pom.xml
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/src/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/src/main/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/src/main/groovy/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/src/main/groovy/commands/
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/src/main/groovy/commands/SetupCommand.groovy
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-loader/src/main/java/org/apache/openejb/tomcat/loader/TomcatHelper.java
Modified:
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/build.xml
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/pom.xml
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/src/main/assembly/bundle.xml
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/src/main/java/org/apache/openejb/tomcat/TomcatBundleInstaller.java
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/pom.xml
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/GlobalListenerSupport.java
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/OpenEJBValve.java
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatLoader.java
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatSecurityService.java
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWsRegistry.java
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/common/TomcatVersion.java
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Paths.java
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-loader/src/main/java/org/apache/openejb/tomcat/loader/OpenEJBListener.java
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-webapp/src/main/resources/META-INF/context.xml
openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-webapp/src/main/webapp/testhome.jsp
Added: openejb/branches/openejb-3.1.x/assembly/itest-runner/pom.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/itest-runner/pom.xml?rev=1063450&view=auto
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/itest-runner/pom.xml (added)
+++ openejb/branches/openejb-3.1.x/assembly/itest-runner/pom.xml Tue Jan 25 20:44:56 2011
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+ xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>assembly</artifactId>
+ <groupId>org.apache.openejb</groupId>
+ <version>3.1.5-SNAPSHOT</version>
+ </parent>
+ <artifactId>itest-runner</artifactId>
+ <name>OpenEJB :: Assembly :: iTest-Runner</name>
+ <url>http://maven.apache.org</url>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>setup-environment</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>new commands.SetupCommand(this).execute()</source>
+ <skip>${maven.test.skip}</skip>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>unpack</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>unpack</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-tomcat-bundle</artifactId>
+ <version>3.2-SNAPSHOT</version>
+ <type>zip</type>
+ <outputDirectory>${project.build.directory}</outputDirectory>
+ </artifactItem>
+ </artifactItems>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>-->
+ </plugins>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.3</version>
+ <configuration>
+ <scriptpath>
+ <element>${project.basedir}/src/test/groovy</element>
+ </scriptpath>
+ <classpath>
+ <element>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ </element>
+ </classpath>
+ <defaults>
+ <testSectionsFile>${project.basedir}/sections.properties</testSectionsFile>
+ <logOutputDirectory>${project.build.directory}/logs</logOutputDirectory>
+ <backupLogs>true</backupLogs>
+ </defaults>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <!--<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>-->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-webapp-common</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-tomcat-common</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <tomcat.version>6.0.29</tomcat.version>
+ <localRepository>${settings.localRepository}</localRepository>
+ <openejb.home>${project.build.directory}/apache-tomcat-${tomcatVersion}</openejb.home>
+ <skipTests>${maven.test.skip}</skipTests>
+ </properties>
+</project>
Added: openejb/branches/openejb-3.1.x/assembly/itest-runner/src/test/groovy/commands/SetupCommand.groovy
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/itest-runner/src/test/groovy/commands/SetupCommand.groovy?rev=1063450&view=auto
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/itest-runner/src/test/groovy/commands/SetupCommand.groovy (added)
+++ openejb/branches/openejb-3.1.x/assembly/itest-runner/src/test/groovy/commands/SetupCommand.groovy Tue Jan 25 20:44:56 2011
@@ -0,0 +1,210 @@
+/*
+ * 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.
+ */
+
+package commands
+
+import org.apache.commons.lang.SystemUtils
+import org.apache.openejb.webapp.common.Installers
+import org.apache.openejb.webapp.common.Alerts
+import java.io.File
+import org.apache.openejb.tomcat.installer.Installer;
+import org.apache.openejb.tomcat.installer.Paths;
+
+class SetupCommand {
+ def log
+ def ant
+ def project
+
+ def SetupCommand(source) {
+ this.log = source.log
+ this.project = source.project
+ this.ant = new AntBuilder()
+ }
+
+ def get(name) {
+ assert name != null
+
+ def value = project.properties.getProperty(name)
+
+ log.debug("Get property: $name=$value")
+
+ return value
+ }
+
+ def get(name, defaultValue) {
+ def value = get(name)
+
+ if (value == null) {
+ value = defaultValue
+ }
+
+ return value
+ }
+
+ def getBoolean(name, defaultValue) {
+ def value = get(name, defaultValue)
+ return Boolean.valueOf("$value")
+ }
+
+ def require(name) {
+ assert name != null
+
+ log.debug("Require property: $name")
+
+ if (!project.properties.containsKey(name) && !System.properties.containsKey(name)) {
+ throw new Exception("Missing required property: $name")
+ }
+
+ def value = get(name)
+
+ if (value == 'null') {
+ throw new Exception("Missing required property: $name (resolved to null)")
+ }
+
+ return value
+ }
+
+ def isWindows() {
+ def os = System.getProperty("os.name").toLowerCase()
+ return (os.indexOf("win") >= 0)
+ }
+
+ def execute() {
+ execute("6.0.29")
+ execute("7.0.6")
+ }
+
+ def execute(tomcatVersion) {
+ def localRepo = require('localRepository')
+ def openejbHome = require('openejb.home')
+ def extension = ".sh"
+ def stopPort = get('tomcat.port.stop', '18005')
+ def httpPort = get('tomcat.port.http', '18080')
+ def ajpPort = get('tomcat.port.ajp', '18009')
+
+ if (isWindows()) {
+ extension = ".bat"
+ }
+
+ if (getBoolean('skipTests', false)) {
+ log.info('Skipping itests.')
+ return
+ }
+
+ def source = ""
+ def dest = "${project.build.directory}/apache-tomcat-${tomcatVersion}.zip"
+ def catalinaHome = "${project.build.directory}/apache-tomcat-${tomcatVersion}"
+
+ if (tomcatVersion != "testonly") {
+ if (tomcatVersion =~ /^7\./) {
+ source = "http://archive.apache.org/dist/tomcat/tomcat-7/v${tomcatVersion}/bin/apache-tomcat-${tomcatVersion}.zip"
+ }
+
+ if (tomcatVersion =~ /^6\./) {
+ source = "http://archive.apache.org/dist/tomcat/tomcat-6/v${tomcatVersion}/bin/apache-tomcat-${tomcatVersion}.zip"
+ }
+
+ if (tomcatVersion =~ /^5\.5/) {
+ source = "http://archive.apache.org/dist/tomcat/tomcat-5/v${tomcatVersion}/bin/apache-tomcat-${tomcatVersion}.zip"
+ }
+
+ ant.get(src: source, dest: dest)
+
+ ant.unzip(src: dest, dest: "${project.build.directory}")
+
+ ant.echo("Deploying the openejb war")
+ ant.unzip(src: "${localRepo}/org/apache/openejb/openejb-tomcat-webapp/${project.version}/openejb-tomcat-webapp-${project.version}.war",
+ dest: "${project.build.directory}/apache-tomcat-${tomcatVersion}/webapps/openejb")
+
+ ant.echo("Installing to: ${catalinaHome}")
+
+ System.setProperty("catalina.home", "${catalinaHome}")
+ System.setProperty("catalina.base", "${catalinaHome}")
+ Paths paths = new Paths(new File("${catalinaHome}/webapps/openejb"))
+ Installer installer = new Installer(paths, true)
+ installer.installAll()
+
+ ant.echo("Assigning execute privileges to scripts in Tomcat bin directory")
+ ant.chmod(dir: "${project.build.directory}/apache-tomcat-${tomcatVersion}/bin", perm: "u+x", includes: "**/*.sh")
+
+ ant.echo("Deploying the itests war")
+ ant.unzip(src: "${localRepo}/org/apache/openejb/openejb-itests-web/${project.version}/openejb-itests-web-${project.version}.war",
+ dest: "${project.build.directory}/apache-tomcat-${tomcatVersion}/webapps/itests")
+
+ def alerts = new Alerts()
+ def file = new File("${project.build.directory}/apache-tomcat-${tomcatVersion}/conf/server.xml")
+ def fileContent = Installers.readAll(file, alerts)
+ fileContent = fileContent.replaceAll("Server port=\"8005\"", "Server port=\"" + stopPort + "\"");
+ fileContent = fileContent.replaceAll("Connector port=\"8080\"", "Connector port=\"" + httpPort + "\"");
+ fileContent = fileContent.replaceAll("Connector port=\"8009\"", "Connector port=\"" + ajpPort + "\"");
+ Installers.writeAll(file, fileContent, alerts)
+
+ ant.exec(executable: "${project.build.directory}/apache-tomcat-${tomcatVersion}/bin/startup${extension}",
+ spawn: true) {
+ env(key: "CATALINA_HOME", value: "${catalinaHome}")
+ env(key: "CATALINA_BASE", value: "${catalinaHome}")
+ //env(key: "JPDA_SUSPEND", value: "y")
+ //arg(line: "jpda start")
+ arg(line: "start")
+ }
+
+ ant.waitfor(maxwait: 1, maxwaitunit: "minute") {
+ ant.and() {
+ ant.socket(server: "localhost", port: httpPort)
+ ant.socket(server: "localhost", port: stopPort)
+ ant.socket(server: "localhost", port: ajpPort)
+ }
+ }
+
+ ant.echo("Tomcat started. Running itests...")
+ }
+
+ ant.java(jar: "${localRepo}/org/apache/openejb/openejb-itests-standalone-client/${project.version}/openejb-itests-standalone-client-${project.version}.jar", fork: "yes") {
+ sysproperty(key: "openejb.home", value: "${openejbHome}")
+ sysproperty(key: "openejb.server.uri", value: "http://127.0.0.1:" + httpPort + "/openejb/ejb")
+
+ //sysproperty(key:"DEBUG", value:"true")
+ //jvmarg(value:"-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8888")
+ arg(value: "tomcat")
+ }
+
+ if (tomcatVersion != "testonly") {
+ ant.echo("Tomcat itests complete, stopping Tomcat...")
+ ant.exec(executable: "${project.build.directory}/apache-tomcat-${tomcatVersion}/bin/shutdown${extension}",
+ spawn: true) {
+ env(key: "CATALINA_HOME", value: "${catalinaHome}")
+ env(key: "CATALINA_BASE", value: "${catalinaHome}")
+ }
+
+ ant.waitfor(maxwait: 1, maxwaitunit: "minute") {
+ ant.not() {
+ ant.or() {
+ ant.socket(server: "localhost", port: httpPort)
+ ant.socket(server: "localhost", port: stopPort)
+ ant.socket(server: "localhost", port: ajpPort)
+ ant.socket(server: "localhost", port: "61616")
+ }
+ }
+ }
+ ant.echo("Tomcat stopped")
+ }
+ ant.echo("itest run complete")
+ }
+}
+
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/build.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/build.xml?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/build.xml (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/build.xml Tue Jan 25 20:44:56 2011
@@ -1,36 +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.
- -->
-
-<project name="TomcatBundle">
- <target name="downloadtomcat">
- <!-- create a directory to extract Tomcat to -->
- <mkdir dir="${OUTPUT_DIR}/bundle/extracted"/>
-
- <!-- download Tomcat -->
- <get src="http://archive.apache.org/dist/tomcat/tomcat-6/v${tomcat.version}/bin/apache-tomcat-${tomcat.version}.zip" dest="${LOCAL_M2_REPO}/org/apache/openejb/apache-tomcat-${tomcat.version}.zip" verbose="true" usetimestamp="true"/>
-
- <!-- unzip Tomcat -->
- <unzip src="${LOCAL_M2_REPO}/org/apache/openejb/apache-tomcat-${tomcat.version}.zip" dest="${OUTPUT_DIR}/bundle/extracted"/>
-
- <!-- unzip openejb.war -->
- <unzip src="${LOCAL_M2_REPO}/org/apache/openejb/openejb-tomcat-webapp/${openejb.version}/openejb-tomcat-webapp-${openejb.version}.war" dest="${OUTPUT_DIR}/bundle/extracted/apache-tomcat-${tomcat.version}/webapps/openejb"/>
-
- <!-- unzip examples.war -->
- <unzip src="${LOCAL_M2_REPO}/org/superbiz/ejb-examples/${examples.version}/ejb-examples-${examples.version}.war" dest="${OUTPUT_DIR}/bundle/extracted/apache-tomcat-${tomcat.version}/webapps/ejb-examples"/>
- </target>
-</project>
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/pom.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/pom.xml?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/pom.xml (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/pom.xml Tue Jan 25 20:44:56 2011
@@ -27,126 +27,120 @@
<version>3.1.5-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
- <artifactId>tomee</artifactId>
- <packaging>jar</packaging>
- <version>6.0.29.314-SNAPSHOT</version>
- <name>OpenEJB :: Assembly :: TomEE</name>
- <properties>
- <tomcat.version>6.0.29</tomcat.version>
- <examples.version>1.0-SNAPSHOT</examples.version>
- <openejb.version>3.1.5-SNAPSHOT</openejb.version>
- </properties>
- <dependencies>
- <dependency>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-loader</artifactId>
- <version>${openejb.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.openejb</groupId>
- <artifactId>openejb-tomcat-common</artifactId>
- <version>${openejb.version}</version>
- </dependency>
- <dependency>
- <groupId>org.apache.tomcat</groupId>
- <artifactId>catalina</artifactId>
- </dependency>
- </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <version>2.3</version>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-antrun-plugin</artifactId>
- <executions>
- <execution>
- <id>download-tomcat</id>
- <phase>compile</phase>
- <configuration>
- <tasks>
- <property name="OUTPUT_DIR" value="${basedir}/target"/>
- <property name="LOCAL_M2_REPO" value="${settings.localRepository}"/>
- <property name="tomcat.version" value="${tomcat.version}"/>
- <property name="openejb.version" value="${openejb.version}"/>
- <property name="examples.version" value="${examples.version}"/>
+ <artifactId>openejb-tomee</artifactId>
+ <packaging>pom</packaging>
+ <name>OpenEJB :: Assembly :: TomEE</name>
- <ant antfile="${basedir}/build.xml">
- <target name="downloadtomcat"/>
- </ant>
- </tasks>
- </configuration>
- <goals>
- <goal>run</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.1</version>
- <executions>
- <execution>
- <id>execute-installer</id>
- <phase>prepare-package</phase>
- <configuration>
- <mainClass>org.apache.openejb.tomcat.TomcatBundleInstaller</mainClass>
- <arguments>
- <argument>
- ${basedir}/target/bundle/extracted/apache-tomcat-${tomcat.version}/webapps/openejb
- </argument>
- </arguments>
- <systemProperties>
- <systemProperty>
- <key>catalina.home</key>
- <value>
- ${basedir}/target/bundle/extracted/apache-tomcat-${tomcat.version}
- </value>
- </systemProperty>
- <systemProperty>
- <key>catalina.base</key>
- <value>
- ${basedir}/target/bundle/extracted/apache-tomcat-${tomcat.version}
- </value>
- </systemProperty>
- </systemProperties>
- </configuration>
- <goals>
- <goal>java</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-assembly-plugin</artifactId>
- <executions>
- <execution>
- <id>war</id>
- <phase>package</phase>
- <configuration>
- <finalName>${artifactId}-${project.version}</finalName>
- </configuration>
- <goals>
- <goal>attached</goal>
- </goals>
- </execution>
- </executions>
- <configuration>
- <appendAssemblyId>false</appendAssemblyId>
- <descriptors>
- <descriptor>src/main/assembly/bundle.xml</descriptor>
- </descriptors>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <!--<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>-->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-webapp-common</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-tomcat-common</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-nodeps</artifactId>
+ <version>1.7.1</version>
+ <type>jar</type>
+ </dependency>
+ </dependencies>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.3</version>
+ <configuration>
+ <scriptpath>
+ <element>${project.basedir}/src/main/groovy</element>
+ </scriptpath>
+ <classpath>
+ <element>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ </element>
+ <element>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-nodeps</artifactId>
+ <version>1.7.1</version>
+ <type>jar</type>
+ </element>
+ </classpath>
+ <defaults>
+ <testSectionsFile>${project.basedir}/sections.properties</testSectionsFile>
+ <logOutputDirectory>${project.build.directory}/logs</logOutputDirectory>
+ <backupLogs>true</backupLogs>
+ </defaults>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>tomee6</id>
+ <phase>package</phase>
+ <configuration>
+ <appendAssemblyId>false</appendAssemblyId>
+ <descriptors>
+ <descriptor>src/main/assembly/tomee.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
+ <properties>
+ <localRepository>${settings.localRepository}</localRepository>
+ <examples.version>1.0-SNAPSHOT</examples.version>
+ </properties>
+
+ <modules>
+ <module>utils</module>
+ <module>tomee6</module>
+ <module>tomee7</module>
+ </modules>
</project>
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/src/main/assembly/bundle.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/src/main/assembly/bundle.xml?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/src/main/assembly/bundle.xml (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/src/main/assembly/bundle.xml Tue Jan 25 20:44:56 2011
@@ -1,50 +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.
--->
-
-<!-- $Rev: 576067 $ $Date: 2007-09-16 03:17:08 -0700 (Sun, 16 Sep 2007) $ -->
-
-<assembly>
- <id>openejb-tomcat-bundle</id>
- <formats>
- <format>tar.gz</format>
- <format>zip</format>
- </formats>
- <includeBaseDirectory>false</includeBaseDirectory>
- <fileSets>
- <fileSet>
- <directory>${basedir}/target/bundle/extracted</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>**/*</include>
- </includes>
- <excludes>
- <exclude>**/bin/**/*</exclude>
- </excludes>
- </fileSet>
- <fileSet>
- <directory>${basedir}/target/bundle/extracted</directory>
- <outputDirectory>/</outputDirectory>
- <includes>
- <include>**/bin/**/*</include>
- </includes>
- <fileMode>0755</fileMode>
- </fileSet>
- </fileSets>
-</assembly>
-
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/src/main/java/org/apache/openejb/tomcat/TomcatBundleInstaller.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/src/main/java/org/apache/openejb/tomcat/TomcatBundleInstaller.java?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/src/main/java/org/apache/openejb/tomcat/TomcatBundleInstaller.java (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/src/main/java/org/apache/openejb/tomcat/TomcatBundleInstaller.java Tue Jan 25 20:44:56 2011
@@ -1,43 +0,0 @@
-/**
- *
- * 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.
- */
-package org.apache.openejb.tomcat;
-
-import org.apache.openejb.tomcat.installer.Installer;
-import org.apache.openejb.tomcat.installer.Paths;
-
-import java.io.File;
-import java.lang.reflect.Field;
-
-public class TomcatBundleInstaller {
- public static void main(String[] args) {
- try {
- if (args == null || args.length == 0) {
- System.out.println("Usage: TomcatBundleInstaller <catalina_home>");
- }
-
- String catalinaHome = args[0];
- System.out.println("Installing to: " + catalinaHome);
- Paths paths = new Paths(new File(catalinaHome));
-
- Installer installer = new Installer(paths, true);
- installer.installAll();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-}
Added: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/pom.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/pom.xml?rev=1063450&view=auto
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/pom.xml (added)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/pom.xml Tue Jan 25 20:44:56 2011
@@ -0,0 +1,138 @@
+<?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. -->
+
+<!-- $Rev: 600338 $ $Date: 2007-12-02 09:08:04 -0800 (Sun, 02 Dec 2007) $ -->
+
+<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">
+ <parent>
+ <artifactId>openejb-tomee</artifactId>
+ <groupId>org.apache.openejb</groupId>
+ <version>3.1.5-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>openejb-tomee-tomcat6</artifactId>
+ <packaging>jar</packaging>
+ <name>OpenEJB :: Assembly :: TomEE :: Tomcat 6</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <!--<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>-->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-webapp-common</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-tomcat-common</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-tomee-utils</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-nodeps</artifactId>
+ <version>1.7.1</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>execute-installer</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>new commands.SetupCommand(this).execute()</source>
+ <classpath>
+ <element>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ </element>
+ <element>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-nodeps</artifactId>
+ <version>1.7.1</version>
+ <type>jar</type>
+ </element>
+ <element>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-tomee-utils</artifactId>
+ <version>${project.version}</version>
+ </element>
+ </classpath>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <localRepository>${settings.localRepository}</localRepository>
+ <examples.version>1.1-SNAPSHOT</examples.version>
+ <tomcat.version>6.0.29</tomcat.version>
+ <http.proxy.host>${settings.activeProxy.host}</http.proxy.host>
+ <http.proxy.port>${settings.activeProxy.port}</http.proxy.port>
+ <http.proxy.username>${settings.activeProxy.username}</http.proxy.username>
+ <http.proxy.password>${settings.activeProxy.password}</http.proxy.password>
+ <http.proxy.nonProxyHosts>${settings.activeProxy.nonProxyHosts}</http.proxy.nonProxyHosts>
+ </properties>
+
+
+</project>
+
Added: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/src/main/assembly/tomee.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/src/main/assembly/tomee.xml?rev=1063450&view=auto
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/src/main/assembly/tomee.xml (added)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee6/src/main/assembly/tomee.xml Tue Jan 25 20:44:56 2011
@@ -0,0 +1,50 @@
+<?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.
+-->
+
+<!-- $Rev: 576067 $ $Date: 2007-09-16 03:17:08 -0700 (Sun, 16 Sep 2007) $ -->
+
+<assembly>
+ <id>openejb-tomcat6-bundle</id>
+ <formats>
+ <format>tar.gz</format>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${basedir}/target/apache-tomcat-6.0.29</directory>
+ <outputDirectory>/apache-tomee-tomcat-6.0.29</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>**/bin/**/*</exclude>
+ </excludes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/target/apache-tomcat-6.0.29</directory>
+ <outputDirectory>/apache-tomee-tomcat-6.0.29</outputDirectory>
+ <includes>
+ <include>**/bin/**/*</include>
+ </includes>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ </fileSets>
+</assembly>
+
Added: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/pom.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/pom.xml?rev=1063450&view=auto
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/pom.xml (added)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/pom.xml Tue Jan 25 20:44:56 2011
@@ -0,0 +1,137 @@
+<?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. -->
+
+<!-- $Rev: 600338 $ $Date: 2007-12-02 09:08:04 -0800 (Sun, 02 Dec 2007) $ -->
+
+<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">
+ <parent>
+ <artifactId>openejb-tomee</artifactId>
+ <groupId>org.apache.openejb</groupId>
+ <version>3.1.5-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>openejb-tomee-tomcat7</artifactId>
+ <packaging>jar</packaging>
+ <name>OpenEJB :: Assembly :: TomEE :: Tomcat 7</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <!--<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>-->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-webapp-common</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-tomcat-common</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-tomee-utils</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-nodeps</artifactId>
+ <version>1.7.1</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>execute-installer</id>
+ <phase>prepare-package</phase>
+ <goals>
+ <goal>execute</goal>
+ </goals>
+ <configuration>
+ <source>new commands.SetupCommand(this).execute()</source>
+ <classpath>
+ <element>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ </element>
+ <element>
+ <groupId>org.apache.ant</groupId>
+ <artifactId>ant-nodeps</artifactId>
+ <version>1.7.1</version>
+ <type>jar</type>
+ </element>
+ <element>
+ <groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-tomee-utils</artifactId>
+ <version>${project.version}</version>
+ </element>
+ </classpath>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+ <properties>
+ <localRepository>${settings.localRepository}</localRepository>
+ <examples.version>1.1-SNAPSHOT</examples.version>
+ <tomcat.version>7.0.6</tomcat.version>
+ <http.proxy.host>${settings.activeProxy.host}</http.proxy.host>
+ <http.proxy.port>${settings.activeProxy.port}</http.proxy.port>
+ <http.proxy.username>${settings.activeProxy.username}</http.proxy.username>
+ <http.proxy.password>${settings.activeProxy.password}</http.proxy.password>
+ <http.proxy.nonProxyHosts>${settings.activeProxy.nonProxyHosts}</http.proxy.nonProxyHosts>
+ </properties>
+
+</project>
+
Added: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/src/main/assembly/tomee.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/src/main/assembly/tomee.xml?rev=1063450&view=auto
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/src/main/assembly/tomee.xml (added)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/tomee7/src/main/assembly/tomee.xml Tue Jan 25 20:44:56 2011
@@ -0,0 +1,50 @@
+<?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.
+-->
+
+<!-- $Rev: 576067 $ $Date: 2007-09-16 03:17:08 -0700 (Sun, 16 Sep 2007) $ -->
+
+<assembly>
+ <id>openejb-tomcat6-bundle</id>
+ <formats>
+ <format>tar.gz</format>
+ <format>zip</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <fileSets>
+ <fileSet>
+ <directory>${basedir}/target/apache-tomcat-7.0.6</directory>
+ <outputDirectory>/apache-tomee-tomcat-7.0.6</outputDirectory>
+ <includes>
+ <include>**/*</include>
+ </includes>
+ <excludes>
+ <exclude>**/bin/**/*</exclude>
+ </excludes>
+ </fileSet>
+ <fileSet>
+ <directory>${basedir}/target/apache-tomcat-7.0.6</directory>
+ <outputDirectory>/apache-tomee-tomcat-7.0.6</outputDirectory>
+ <includes>
+ <include>**/bin/**/*</include>
+ </includes>
+ <fileMode>0755</fileMode>
+ </fileSet>
+ </fileSets>
+</assembly>
+
Added: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/pom.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/pom.xml?rev=1063450&view=auto
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/pom.xml (added)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/pom.xml Tue Jan 25 20:44:56 2011
@@ -0,0 +1,94 @@
+<?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. -->
+
+<!-- $Rev: 600338 $ $Date: 2007-12-02 09:08:04 -0800 (Sun, 02 Dec 2007) $ -->
+
+<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">
+ <parent>
+ <artifactId>openejb-tomee</artifactId>
+ <groupId>org.apache.openejb</groupId>
+ <version>3.1.5-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>openejb-tomee-utils</artifactId>
+ <packaging>jar</packaging>
+ <name>OpenEJB :: Assembly :: TomEE :: Utils</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.codehaus.gmaven.runtime</groupId>
+ <artifactId>gmaven-runtime-1.6</artifactId>
+ <version>1.3</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>jline</groupId>
+ <artifactId>jline</artifactId>
+ <version>0.9.94</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ </dependency>
+ <!--<dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ </dependency>-->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-webapp-common</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ <dependency>
+ <groupId>${project.groupId}</groupId>
+ <artifactId>openejb-tomcat-common</artifactId>
+ <version>${project.version}</version>
+ <type>jar</type>
+ <scope>compile</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.codehaus.gmaven</groupId>
+ <artifactId>gmaven-plugin</artifactId>
+ <version>1.3</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generateStubs</goal>
+ <goal>compile</goal>
+ <goal>generateTestStubs</goal>
+ <goal>testCompile</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
+
Added: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/src/main/groovy/commands/SetupCommand.groovy
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/src/main/groovy/commands/SetupCommand.groovy?rev=1063450&view=auto
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/src/main/groovy/commands/SetupCommand.groovy (added)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-bundle/utils/src/main/groovy/commands/SetupCommand.groovy Tue Jan 25 20:44:56 2011
@@ -0,0 +1,148 @@
+/*
+ * 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.
+ */
+
+package commands
+
+import org.apache.commons.lang.SystemUtils
+import org.apache.openejb.webapp.common.Installers
+import org.apache.openejb.webapp.common.Alerts
+import java.io.File
+import org.apache.openejb.tomcat.installer.Installer;
+import org.apache.openejb.tomcat.installer.Paths;
+import org.apache.tools.ant.taskdefs.optional.net.SetProxy
+
+class SetupCommand {
+ def log
+ def ant
+ def project
+
+ def SetupCommand(source) {
+ this.log = source.log
+ this.project = source.project
+ this.ant = new AntBuilder()
+ }
+
+ def get(name) {
+ assert name != null
+
+ def value = project.properties.getProperty(name)
+
+ log.debug("Get property: $name=$value")
+
+ return value
+ }
+
+ def get(name, defaultValue) {
+ def value = get(name)
+
+ if (value == null) {
+ value = defaultValue
+ }
+
+ return value
+ }
+
+ def getBoolean(name, defaultValue) {
+ def value = get(name, defaultValue)
+ return Boolean.valueOf("$value")
+ }
+
+ def require(name) {
+ assert name != null
+
+ log.debug("Require property: $name")
+
+ if (!project.properties.containsKey(name) && !System.properties.containsKey(name)) {
+ throw new Exception("Missing required property: $name")
+ }
+
+ def value = get(name)
+
+ if (value == 'null') {
+ throw new Exception("Missing required property: $name (resolved to null)")
+ }
+
+ return value
+ }
+
+ def execute() {
+ def tomcatVersion = require('tomcat.version')
+ def localRepo = require('localRepository')
+ def openejbHome = "${project.build.directory}/apache-tomcat-${tomcatVersion}"
+ def examplesVersion = require('examples.version')
+
+ def proxyHost = get('http.proxy.host', '')
+ def proxyPort = get('http.proxy.port', '')
+ def proxyUsername = get('http.proxy.username', '')
+ def proxyPassword = get('http.proxy.password', '')
+ def proxyNonProxyHosts = get('http.proxy.nonProxyHosts', '')
+
+ if ((proxyHost != null && proxyHost.length() > 0) || (proxyPort != null && proxyPort.length() > 0)) {
+ ant.echo("Setting proxy host=${proxyHost} and proxy port=${proxyPort}")
+
+ def setProxy = new SetProxy();
+ setProxy.setProxyHost(proxyHost)
+ setProxy.setProxyPort(Integer.parseInt(proxyPort))
+ setProxy.setProxyUser(proxyUsername)
+ setProxy.setProxyPassword(proxyPassword)
+ setProxy.setNonProxyHosts(proxyNonProxyHosts)
+ setProxy.execute()
+ }
+
+ def source = ""
+ def dest = "${project.build.directory}/apache-tomcat-${tomcatVersion}.zip"
+ def catalinaHome = "${project.build.directory}/apache-tomcat-${tomcatVersion}"
+
+ if (tomcatVersion =~ /^7\./) {
+ source = "http://archive.apache.org/dist/tomcat/tomcat-7/v${tomcatVersion}/bin/apache-tomcat-${tomcatVersion}.zip"
+ }
+
+ if (tomcatVersion =~ /^6\./) {
+ source = "http://archive.apache.org/dist/tomcat/tomcat-6/v${tomcatVersion}/bin/apache-tomcat-${tomcatVersion}.zip"
+ }
+
+ if (tomcatVersion =~ /^5\.5/) {
+ source = "http://archive.apache.org/dist/tomcat/tomcat-5/v${tomcatVersion}/bin/apache-tomcat-${tomcatVersion}.zip"
+ }
+
+ ant.get(src: source, dest: dest)
+
+ ant.unzip(src: dest, dest: "${project.build.directory}")
+
+ ant.echo("Deploying the openejb war")
+ ant.unzip(src: "${localRepo}/org/apache/openejb/openejb-tomcat-webapp/${project.version}/openejb-tomcat-webapp-${project.version}.war",
+ dest: "${project.build.directory}/apache-tomcat-${tomcatVersion}/webapps/openejb")
+
+ ant.echo("Installing to: ${catalinaHome}")
+
+ System.setProperty("catalina.home", "${catalinaHome}")
+ System.setProperty("catalina.base", "${catalinaHome}")
+ Paths paths = new Paths(new File("${catalinaHome}/webapps/openejb"))
+ Installer installer = new Installer(paths, true)
+ installer.installAll()
+
+ ant.echo("Assigning execute privileges to scripts in Tomcat bin directory")
+ ant.chmod(dir: "${project.build.directory}/apache-tomcat-${tomcatVersion}/bin", perm: "u+x", includes: "**/*.sh")
+
+ ant.echo("Deploying the examples war")
+ ant.unzip(src: "${localRepo}/org/superbiz/ejb-examples/${examplesVersion}/ejb-examples-${examplesVersion}.war",
+ dest: "${project.build.directory}/apache-tomcat-${tomcatVersion}/webapps/ejb-examples")
+ }
+}
+
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/pom.xml
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/pom.xml?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/pom.xml (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/pom.xml Tue Jan 25 20:44:56 2011
@@ -66,6 +66,11 @@
</dependency>
<dependency>
<groupId>org.apache.openejb</groupId>
+ <artifactId>openejb-tomcat-loader</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.openejb</groupId>
<artifactId>openejb-server</artifactId>
<version>${project.version}</version>
</dependency>
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/GlobalListenerSupport.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/GlobalListenerSupport.java?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/GlobalListenerSupport.java (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/GlobalListenerSupport.java Tue Jan 25 20:44:56 2011
@@ -27,6 +27,7 @@ import org.apache.catalina.core.Standard
import org.apache.catalina.core.StandardEngine;
import org.apache.catalina.core.StandardHost;
import org.apache.catalina.core.StandardServer;
+import org.apache.openejb.tomcat.loader.TomcatHelper;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -55,9 +56,17 @@ public class GlobalListenerSupport imple
} else if (Lifecycle.BEFORE_START_EVENT.equals(type)) {
contextListener.beforeStart(standardContext);
} else if (Lifecycle.START_EVENT.equals(type)) {
+ if (TomcatHelper.isTomcat7()) {
+ standardContext.addParameter("openejb.start.late", "true");
+ }
+
contextListener.start(standardContext);
} else if (Lifecycle.AFTER_START_EVENT.equals(type)) {
contextListener.afterStart(standardContext);
+
+ if (TomcatHelper.isTomcat7()) {
+ standardContext.removeParameter("openejb.start.late");
+ }
} else if (Lifecycle.BEFORE_STOP_EVENT.equals(type)) {
contextListener.beforeStop(standardContext);
} else if (Lifecycle.STOP_EVENT.equals(type)) {
@@ -76,6 +85,11 @@ public class GlobalListenerSupport imple
} else if (source instanceof StandardServer) {
StandardServer standardServer = (StandardServer) source;
String type = event.getType();
+
+ if (Lifecycle.BEFORE_STOP_EVENT.equals(type)) {
+ TomcatHelper.setStopping(true);
+ }
+
if (Lifecycle.AFTER_STOP_EVENT.equals(type)) {
contextListener.afterStop(standardServer);
}
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/OpenEJBValve.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/OpenEJBValve.java?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/OpenEJBValve.java (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/OpenEJBValve.java Tue Jan 25 20:44:56 2011
@@ -28,10 +28,10 @@ import javax.servlet.ServletException;
import java.io.IOException;
public class OpenEJBValve extends ValveBase {
- protected TomcatSecurityService securityService;
+ protected TomcatSecurityService securityService;
+ protected static final String info = OpenEJBValve.class.getName() + "/" + OpenEjbVersion.get().getVersion();
public OpenEJBValve() {
- info = getClass().getName() + "/" + OpenEjbVersion.get().getVersion();
securityService = getSecurityService();
}
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatLoader.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatLoader.java?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatLoader.java (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatLoader.java Tue Jan 25 20:44:56 2011
@@ -23,7 +23,6 @@ import org.apache.catalina.Host;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
-import org.apache.catalina.ServerFactory;
import org.apache.catalina.Service;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.core.StandardServer;
@@ -43,6 +42,7 @@ import org.apache.openejb.server.Service
import org.apache.openejb.server.ServiceManager;
import org.apache.openejb.server.ejbd.EjbServer;
import org.apache.openejb.server.webservices.WsRegistry;
+import org.apache.openejb.tomcat.loader.TomcatHelper;
import java.io.BufferedInputStream;
import java.io.File;
@@ -166,7 +166,7 @@ public class TomcatLoader implements Loa
ejbServer.init(ejbServerProps);
// Add our naming context listener to the server which registers all Tomcat resources with OpenEJB
- StandardServer standardServer = (StandardServer) ServerFactory.getServer();
+ StandardServer standardServer = (StandardServer) TomcatHelper.getServer();
OpenEJBNamingContextListener namingContextListener = new OpenEJBNamingContextListener(standardServer);
// Standard server has no state property, so we check global naming context to determine if server is started yet
if (standardServer.getGlobalNamingContext() != null) {
@@ -231,7 +231,7 @@ public class TomcatLoader implements Loa
for (Container hostChild : host.findChildren()) {
if (hostChild instanceof StandardContext) {
StandardContext standardContext = (StandardContext) hostChild;
- int state = standardContext.getState();
+ int state = TomcatHelper.getContextState(standardContext);
if (state == 0) {
// context only initialized
tomcatWebAppBuilder.init(standardContext);
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatSecurityService.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatSecurityService.java?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatSecurityService.java (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatSecurityService.java Tue Jan 25 20:44:56 2011
@@ -20,12 +20,12 @@ package org.apache.openejb.tomcat.catali
import org.apache.catalina.Realm;
import org.apache.catalina.Service;
import org.apache.catalina.Engine;
-import org.apache.catalina.ServerFactory;
import org.apache.catalina.Server;
import org.apache.openejb.DeploymentInfo;
import org.apache.openejb.core.security.AbstractSecurityService;
import org.apache.openejb.core.CoreDeploymentInfo;
import org.apache.openejb.spi.CallerPrincipal;
+import org.apache.openejb.tomcat.loader.TomcatHelper;
import javax.security.auth.Subject;
import javax.security.auth.login.LoginException;
@@ -46,7 +46,7 @@ public class TomcatSecurityService exte
private Realm defaultRealm;
public TomcatSecurityService() {
- Server server = ServerFactory.getServer();
+ Server server = TomcatHelper.getServer();
for (Service service : server.findServices()) {
if (service.getContainer() instanceof Engine) {
Engine engine = (Engine) service.getContainer();
@@ -85,7 +85,7 @@ public class TomcatSecurityService exte
for (Principal principal : principals) {
if (principal instanceof TomcatUser) {
TomcatUser user = (TomcatUser) principal;
- if (user.getRealm().hasRole(user.getTomcatPrincipal(), logicalRole)) {
+ if (TomcatHelper.hasRole(user.getRealm(), user.getTomcatPrincipal(), logicalRole)) {
roles.add(logicalRole);
break;
}
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWebAppBuilder.java Tue Jan 25 20:44:56 2011
@@ -25,7 +25,6 @@ import org.apache.openejb.tomcat.common.
import org.apache.catalina.Container;
import org.apache.catalina.Engine;
import org.apache.catalina.LifecycleListener;
-import org.apache.catalina.ServerFactory;
import org.apache.catalina.Service;
import org.apache.catalina.Wrapper;
import org.apache.catalina.core.StandardContext;
@@ -72,6 +71,7 @@ import org.apache.openejb.jee.FacesConfi
import org.apache.openejb.jee.ParamValue;
import org.apache.openejb.jee.WebApp;
import org.apache.openejb.loader.SystemInstance;
+import org.apache.openejb.tomcat.loader.TomcatHelper;
import org.apache.openejb.util.LogCategory;
import org.apache.openejb.util.Logger;
import org.apache.openejb.util.URLs;
@@ -112,7 +112,7 @@ public class TomcatWebAppBuilder impleme
private CoreContainerSystem containerSystem;
public TomcatWebAppBuilder() {
- StandardServer standardServer = (StandardServer) ServerFactory.getServer();
+ StandardServer standardServer = TomcatHelper.getServer();
globalListenerSupport = new GlobalListenerSupport(standardServer, this);
for (Service service : standardServer.findServices()) {
@@ -549,7 +549,7 @@ public class TomcatWebAppBuilder impleme
// check each url to determine if it is an ejb jar
for (URL url : getUrls(standardContext)) {
try {
- Class moduleType = DeploymentLoader.discoverModuleType(url, standardContext.getLoader().getClassLoader(), true);
+ Class moduleType = new DeploymentLoader().discoverModuleType(url, standardContext.getLoader().getClassLoader(), true);
if (EjbModule.class.isAssignableFrom(moduleType)) {
File file;
if (url.getProtocol().equals("jar")) {
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWsRegistry.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWsRegistry.java?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWsRegistry.java (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-catalina/src/main/java/org/apache/openejb/tomcat/catalina/TomcatWsRegistry.java Tue Jan 25 20:44:56 2011
@@ -24,7 +24,6 @@ import org.apache.catalina.Host;
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
-import org.apache.catalina.ServerFactory;
import org.apache.catalina.Service;
import org.apache.catalina.Wrapper;
import org.apache.catalina.authenticator.BasicAuthenticator;
@@ -40,6 +39,9 @@ import org.apache.catalina.deploy.Securi
import org.apache.openejb.server.httpd.HttpListener;
import org.apache.openejb.server.webservices.WsRegistry;
import org.apache.openejb.server.webservices.WsServlet;
+import org.apache.openejb.tomcat.loader.TomcatHelper;
+
+import static org.apache.openejb.tomcat.catalina.BackportUtil.getServlet;
import static org.apache.openejb.tomcat.catalina.TomcatWebAppBuilder.IGNORE_CONTEXT;
import java.net.URI;
@@ -55,7 +57,7 @@ public class TomcatWsRegistry implements
private List<Connector> connectors;
public TomcatWsRegistry() {
- StandardServer standardServer = (StandardServer) ServerFactory.getServer();
+ StandardServer standardServer = (StandardServer) TomcatHelper.getServer();
for (Service service : standardServer.findServices()) {
if (service.getContainer() instanceof Engine) {
connectors = Arrays.asList(service.findConnectors());
@@ -147,8 +149,14 @@ public class TomcatWsRegistry implements
// configured true, or it will treat it as a failed deployment
context.addLifecycleListener(new LifecycleListener() {
public void lifecycleEvent(LifecycleEvent event) {
- if (event.getType().equals(Lifecycle.START_EVENT)) {
- Context context = (Context) event.getLifecycle();
+ Context context = (Context) event.getLifecycle();
+
+ if (event.getType().equals(Lifecycle.BEFORE_START_EVENT)) {
+ context.getServletContext().setAttribute(IGNORE_CONTEXT, "true");
+ }
+
+
+ if (event.getType().equals(Lifecycle.START_EVENT) || event.getType().equals(Lifecycle.BEFORE_START_EVENT) || event.getType().equals("configure_start")) {
context.setConfigured(true);
}
}
@@ -204,22 +212,26 @@ public class TomcatWsRegistry implements
}
// Mark this as a dynamic context that should not be inspected by the TomcatWebAppBuilder
- context.getServletContext().setAttribute(IGNORE_CONTEXT, "true");
// build the servlet
Wrapper wrapper = context.createWrapper();
wrapper.setName("webservice");
wrapper.setServletClass(WsServlet.class.getName());
- setWsContainer(context, wrapper, httpListener);
- wrapper.addMapping("/*");
-
- // add add servlet to context
+ // add servlet to context
context.addChild(wrapper);
+ wrapper.addMapping("/*");
context.addServletMapping("/*", "webservice");
+ String webServicecontainerID = wrapper.getName() + WsServlet.WEBSERVICE_CONTAINER + httpListener.hashCode();
+ wrapper.addInitParameter(WsServlet.WEBSERVICE_CONTAINER, webServicecontainerID);
+
// add context to host
host.addChild(context);
+
+ context.getServletContext().setAttribute(IGNORE_CONTEXT, "true");
+ setWsContainer(context, wrapper, httpListener);
+
webserviceContexts.put(path, context);
// register wsdl locations for service-ref resolution
@@ -237,6 +249,10 @@ public class TomcatWsRegistry implements
// assure context root with a leading slash
if (!path.startsWith("/")) path = "/" + path;
+ if (TomcatHelper.isTomcat7() && TomcatHelper.isStopping()) {
+ return;
+ }
+
StandardContext context = webserviceContexts.remove(path);
try {
context.stop();
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/common/TomcatVersion.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/common/TomcatVersion.java?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/common/TomcatVersion.java (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/common/TomcatVersion.java Tue Jan 25 20:44:56 2011
@@ -23,7 +23,7 @@ import java.util.Properties;
*/
public enum TomcatVersion {
- v3, v40, v41, v50, v55, v6, UNKNOWN;
+ v3, v40, v41, v50, v55, v6, v7, UNKNOWN;
private String serverNumber;
private String serverBuilt;
@@ -90,6 +90,7 @@ public enum TomcatVersion {
else if (serverNumber.startsWith("5.0")) version = v50;
else if (serverNumber.startsWith("5.5")) version = v55;
else if (serverNumber.startsWith("6.")) version = v6;
+ else if (serverNumber.startsWith("7.")) version = v7;
else version = UNKNOWN;
version.serverNumber = serverNumber;
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Paths.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Paths.java?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Paths.java (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-common/src/main/java/org/apache/openejb/tomcat/installer/Paths.java Tue Jan 25 20:44:56 2011
@@ -146,7 +146,7 @@ public class Paths {
if (catalinaHomeDir == null) return null;
- if (TomcatVersion.v6.isTheVersion()) {
+ if (TomcatVersion.v6.isTheVersion() || TomcatVersion.v7.isTheVersion()) {
return new File(catalinaHomeDir, "lib");
} else {
return new File(new File(catalinaHomeDir, "server"), "lib");
Modified: openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-loader/src/main/java/org/apache/openejb/tomcat/loader/OpenEJBListener.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-loader/src/main/java/org/apache/openejb/tomcat/loader/OpenEJBListener.java?rev=1063450&r1=1063449&r2=1063450&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-loader/src/main/java/org/apache/openejb/tomcat/loader/OpenEJBListener.java (original)
+++ openejb/branches/openejb-3.1.x/assembly/openejb-tomcat/openejb-tomcat-loader/src/main/java/org/apache/openejb/tomcat/loader/OpenEJBListener.java Tue Jan 25 20:44:56 2011
@@ -23,7 +23,6 @@ import java.util.Properties;
import org.apache.catalina.Container;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
-import org.apache.catalina.ServerFactory;
import org.apache.catalina.Service;
import org.apache.catalina.core.StandardContext;
import org.apache.catalina.core.StandardEngine;
@@ -53,15 +52,16 @@ public class OpenEJBListener implements
public void lifecycleEvent(LifecycleEvent event) {
// only install once
if (listenerInstalled) return;
- listenerInstalled = true;
-
- Properties properties = new Properties();
- File webappDir = findOpenEjbWar();
- properties.setProperty("openejb.war", webappDir.getAbsolutePath());
-
- properties.setProperty("openejb.embedder.source", getClass().getSimpleName());
-
- TomcatEmbedder.embed(properties, StandardServer.class.getClassLoader());
+
+ try {
+ Properties properties = new Properties();
+ File webappDir = findOpenEjbWar();
+ properties.setProperty("openejb.war", webappDir.getAbsolutePath());
+ properties.setProperty("openejb.embedder.source", getClass().getSimpleName());
+ TomcatEmbedder.embed(properties, StandardServer.class.getClassLoader());
+ listenerInstalled = true;
+ } catch (Exception e) {
+ }
}
private static File findOpenEjbWar() {
@@ -72,36 +72,39 @@ public class OpenEJBListener implements
if (openEjbWar != null) {
return openEjbWar;
}
-
- // in Tomcat 6 the OpenEjb war is normally in webapps, but we just scan all hosts directories
- for (Service service : ServerFactory.getServer().findServices()) {
- Container container = service.getContainer();
- if (container instanceof StandardEngine) {
- StandardEngine engine = (StandardEngine) container;
- for (Container child : engine.findChildren()) {
- if (child instanceof StandardHost) {
- StandardHost host = (StandardHost) child;
- String appBase = host.getAppBase();
-
- // determine the host dir (normally webapps)
- File hostDir = new File(appBase);
- if (!hostDir.isAbsolute()) {
- hostDir = new File(catalinaBase, appBase);
- }
-
- openEjbWar = findOpenEjbWar(hostDir);
- if (openEjbWar != null) {
- return openEjbWar;
- } else {
- return findOpenEjbWar(host);
- }
- }
- }
- }
- }
-
-
- return null;
+
+ try {
+ // in Tomcat 6 the OpenEjb war is normally in webapps, but we just
+ // scan all hosts directories
+ for (Service service : TomcatHelper.getServer().findServices()) {
+ Container container = service.getContainer();
+ if (container instanceof StandardEngine) {
+ StandardEngine engine = (StandardEngine) container;
+ for (Container child : engine.findChildren()) {
+ if (child instanceof StandardHost) {
+ StandardHost host = (StandardHost) child;
+ String appBase = host.getAppBase();
+
+ // determine the host dir (normally webapps)
+ File hostDir = new File(appBase);
+ if (!hostDir.isAbsolute()) {
+ hostDir = new File(catalinaBase, appBase);
+ }
+
+ openEjbWar = findOpenEjbWar(hostDir);
+ if (openEjbWar != null) {
+ return openEjbWar;
+ } else {
+ return findOpenEjbWar(host);
+ }
+ }
+ }
+ }
+ }
+ } catch (Exception e) {
+ }
+
+ return null;
}
private static File findOpenEjbWar(StandardHost standardHost) {