You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2015/11/18 21:18:05 UTC
[1/3] tomee git commit: EOL commit
Repository: tomee
Updated Branches:
refs/heads/master 912db4178 -> 3069db0ba
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/AsyncConsoleHandler.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/AsyncConsoleHandler.java b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/AsyncConsoleHandler.java
index e212428..4dd2554 100644
--- a/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/AsyncConsoleHandler.java
+++ b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/AsyncConsoleHandler.java
@@ -1,63 +1,63 @@
-/*
- * 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.tomee.jul.formatter;
-
-import org.apache.juli.AsyncFileHandler;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Formatter;
-import java.util.logging.LogRecord;
-
-public class AsyncConsoleHandler extends AsyncFileHandler {
- private final ConsoleHandler delegate = new ConsoleHandler() {{
- setFormatter(new SingleLineFormatter()); // console -> dev. File uses plain old format
- }};
-
- protected void publishInternal(final LogRecord record) {
- delegate.publish(record);
- }
-
- // copy cause of classloading
- private static class SingleLineFormatter extends Formatter {
- private static final String SEP = System.getProperty("line.separator", "\n");
-
- @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
- @Override
- public synchronized String format(final LogRecord record) {
- final boolean exception = record.getThrown() != null;
- final StringBuilder sbuf = new StringBuilder();
- sbuf.append(record.getLevel().getLocalizedName());
- sbuf.append(" - ");
- sbuf.append(this.formatMessage(record));
- sbuf.append(SEP);
- if (exception) {
- try {
- final StringWriter sw = new StringWriter();
- final PrintWriter pw = new PrintWriter(sw);
- record.getThrown().printStackTrace(pw);
- pw.close();
- sbuf.append(sw.toString());
- } catch (final Exception ex) {
- // no-op
- }
- }
- return sbuf.toString();
- }
- }
-}
+/*
+ * 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.tomee.jul.formatter;
+
+import org.apache.juli.AsyncFileHandler;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Formatter;
+import java.util.logging.LogRecord;
+
+public class AsyncConsoleHandler extends AsyncFileHandler {
+ private final ConsoleHandler delegate = new ConsoleHandler() {{
+ setFormatter(new SingleLineFormatter()); // console -> dev. File uses plain old format
+ }};
+
+ protected void publishInternal(final LogRecord record) {
+ delegate.publish(record);
+ }
+
+ // copy cause of classloading
+ private static class SingleLineFormatter extends Formatter {
+ private static final String SEP = System.getProperty("line.separator", "\n");
+
+ @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+ @Override
+ public synchronized String format(final LogRecord record) {
+ final boolean exception = record.getThrown() != null;
+ final StringBuilder sbuf = new StringBuilder();
+ sbuf.append(record.getLevel().getLocalizedName());
+ sbuf.append(" - ");
+ sbuf.append(this.formatMessage(record));
+ sbuf.append(SEP);
+ if (exception) {
+ try {
+ final StringWriter sw = new StringWriter();
+ final PrintWriter pw = new PrintWriter(sw);
+ record.getThrown().printStackTrace(pw);
+ pw.close();
+ sbuf.append(sw.toString());
+ } catch (final Exception ex) {
+ // no-op
+ }
+ }
+ return sbuf.toString();
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/SimpleTomEEFormatter.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/SimpleTomEEFormatter.java b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/SimpleTomEEFormatter.java
index 5ee3a39..03c66c0 100644
--- a/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/SimpleTomEEFormatter.java
+++ b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/SimpleTomEEFormatter.java
@@ -1,48 +1,48 @@
-/**
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.tomee.jul.formatter;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.logging.LogRecord;
-
-public class SimpleTomEEFormatter extends java.util.logging.Formatter {
- private static final String LN = System.getProperty("line.separator");
-
- @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
- @Override
- public synchronized String format(final LogRecord record) {
- final Throwable thrown = record.getThrown();
- final StringBuilder sbuf = new StringBuilder();
- sbuf.append(record.getLevel().getLocalizedName());
- sbuf.append(" - ");
- sbuf.append(formatMessage(record));
- sbuf.append(LN);
- if (thrown != null) {
- try {
- final StringWriter sw = new StringWriter();
- final PrintWriter pw = new PrintWriter(sw);
- thrown.printStackTrace(pw);
- pw.close();
- sbuf.append(sw.toString());
- } catch (final Exception ex) {
- // no-op
- }
- }
- return sbuf.toString();
- }
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.tomee.jul.formatter;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.logging.LogRecord;
+
+public class SimpleTomEEFormatter extends java.util.logging.Formatter {
+ private static final String LN = System.getProperty("line.separator");
+
+ @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
+ @Override
+ public synchronized String format(final LogRecord record) {
+ final Throwable thrown = record.getThrown();
+ final StringBuilder sbuf = new StringBuilder();
+ sbuf.append(record.getLevel().getLocalizedName());
+ sbuf.append(" - ");
+ sbuf.append(formatMessage(record));
+ sbuf.append(LN);
+ if (thrown != null) {
+ try {
+ final StringWriter sw = new StringWriter();
+ final PrintWriter pw = new PrintWriter(sw);
+ thrown.printStackTrace(pw);
+ pw.close();
+ sbuf.append(sw.toString());
+ } catch (final Exception ex) {
+ // no-op
+ }
+ }
+ return sbuf.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/log/JULLogger.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/log/JULLogger.java b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/log/JULLogger.java
index 39f8b4d..184ecea 100644
--- a/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/log/JULLogger.java
+++ b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/log/JULLogger.java
@@ -1,180 +1,180 @@
-/*
- * 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.tomee.jul.formatter.log;
-
-import org.apache.juli.logging.Log;
-
-import java.util.logging.ConsoleHandler;
-import java.util.logging.Formatter;
-import java.util.logging.Handler;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-// DirectJDKLog copy since it is now package scoped
-public class JULLogger implements Log {
- /**
- * Alternate config reader and console format
- */
- private static final String SIMPLE_FMT = "java.util.logging.SimpleFormatter";
- private static final String SIMPLE_CFG = "org.apache.juli.JdkLoggerConfig"; //doesn't exist
- private static final String FORMATTER = "org.apache.juli.formatter";
-
- static {
- if (System.getProperty("java.util.logging.config.class") == null &&
- System.getProperty("java.util.logging.config.file") == null) {
- // default configuration - it sucks. Let's override at least the
- // formatter for the console
- try {
- Class.forName(SIMPLE_CFG).newInstance();
- } catch (final Throwable t) {
- // no-op
- }
- try {
- final Formatter fmt = (Formatter) Class.forName(System.getProperty(FORMATTER, SIMPLE_FMT)).newInstance();
- // it is also possible that the user modified jre/lib/logging.properties -
- // but that's really stupid in most cases
- final Logger root = Logger.getLogger("");
- final Handler[] handlers = root.getHandlers();
- for (final Handler handler : handlers) {
- // I only care about console - that's what's used in default config anyway
- if (handler instanceof ConsoleHandler) {
- handler.setFormatter(fmt);
- }
- }
- } catch (final Throwable t) {
- // no-op maybe it wasn't included - the ugly default will be used.
- }
- }
- }
-
- private final Logger logger;
-
- public JULLogger(final String name) {
- logger = Logger.getLogger(name);
- }
-
- @Override
- public final boolean isErrorEnabled() {
- return logger.isLoggable(Level.SEVERE);
- }
-
- @Override
- public final boolean isWarnEnabled() {
- return logger.isLoggable(Level.WARNING);
- }
-
- @Override
- public final boolean isInfoEnabled() {
- return logger.isLoggable(Level.INFO);
- }
-
- @Override
- public final boolean isDebugEnabled() {
- return logger.isLoggable(Level.FINE);
- }
-
- @Override
- public final boolean isFatalEnabled() {
- return logger.isLoggable(Level.SEVERE);
- }
-
- @Override
- public final boolean isTraceEnabled() {
- return logger.isLoggable(Level.FINER);
- }
-
- @Override
- public final void debug(final Object message) {
- log(Level.FINE, String.valueOf(message), null);
- }
-
- @Override
- public final void debug(final Object message, final Throwable t) {
- log(Level.FINE, String.valueOf(message), t);
- }
-
- @Override
- public final void trace(final Object message) {
- log(Level.FINER, String.valueOf(message), null);
- }
-
- @Override
- public final void trace(final Object message, final Throwable t) {
- log(Level.FINER, String.valueOf(message), t);
- }
-
- @Override
- public final void info(final Object message) {
- log(Level.INFO, String.valueOf(message), null);
- }
-
- @Override
- public final void info(final Object message, final Throwable t) {
- log(Level.INFO, String.valueOf(message), t);
- }
-
- @Override
- public final void warn(final Object message) {
- log(Level.WARNING, String.valueOf(message), null);
- }
-
- @Override
- public final void warn(final Object message, final Throwable t) {
- log(Level.WARNING, String.valueOf(message), t);
- }
-
- @Override
- public final void error(final Object message) {
- log(Level.SEVERE, String.valueOf(message), null);
- }
-
- @Override
- public final void error(final Object message, final Throwable t) {
- log(Level.SEVERE, String.valueOf(message), t);
- }
-
- @Override
- public final void fatal(final Object message) {
- log(Level.SEVERE, String.valueOf(message), null);
- }
-
- @Override
- public final void fatal(final Object message, final Throwable t) {
- log(Level.SEVERE, String.valueOf(message), t);
- }
-
- private void log(final Level level, final String msg, final Throwable ex) {
- if (logger.isLoggable(level)) {
- // Hack (?) to get the stack trace.
- final Throwable dummyException = new Throwable();
- final StackTraceElement[] locations = dummyException.getStackTrace();
- // Caller will be the third element
- String cname = "unknown";
- String method = "unknown";
- if (locations != null && locations.length > 3) {
- final StackTraceElement caller = locations[3];
- cname = caller.getClassName();
- method = caller.getMethodName();
- }
- if (ex == null) {
- logger.logp(level, cname, method, msg);
- } else {
- logger.logp(level, cname, method, msg, ex);
- }
- }
- }
-}
+/*
+ * 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.tomee.jul.formatter.log;
+
+import org.apache.juli.logging.Log;
+
+import java.util.logging.ConsoleHandler;
+import java.util.logging.Formatter;
+import java.util.logging.Handler;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+// DirectJDKLog copy since it is now package scoped
+public class JULLogger implements Log {
+ /**
+ * Alternate config reader and console format
+ */
+ private static final String SIMPLE_FMT = "java.util.logging.SimpleFormatter";
+ private static final String SIMPLE_CFG = "org.apache.juli.JdkLoggerConfig"; //doesn't exist
+ private static final String FORMATTER = "org.apache.juli.formatter";
+
+ static {
+ if (System.getProperty("java.util.logging.config.class") == null &&
+ System.getProperty("java.util.logging.config.file") == null) {
+ // default configuration - it sucks. Let's override at least the
+ // formatter for the console
+ try {
+ Class.forName(SIMPLE_CFG).newInstance();
+ } catch (final Throwable t) {
+ // no-op
+ }
+ try {
+ final Formatter fmt = (Formatter) Class.forName(System.getProperty(FORMATTER, SIMPLE_FMT)).newInstance();
+ // it is also possible that the user modified jre/lib/logging.properties -
+ // but that's really stupid in most cases
+ final Logger root = Logger.getLogger("");
+ final Handler[] handlers = root.getHandlers();
+ for (final Handler handler : handlers) {
+ // I only care about console - that's what's used in default config anyway
+ if (handler instanceof ConsoleHandler) {
+ handler.setFormatter(fmt);
+ }
+ }
+ } catch (final Throwable t) {
+ // no-op maybe it wasn't included - the ugly default will be used.
+ }
+ }
+ }
+
+ private final Logger logger;
+
+ public JULLogger(final String name) {
+ logger = Logger.getLogger(name);
+ }
+
+ @Override
+ public final boolean isErrorEnabled() {
+ return logger.isLoggable(Level.SEVERE);
+ }
+
+ @Override
+ public final boolean isWarnEnabled() {
+ return logger.isLoggable(Level.WARNING);
+ }
+
+ @Override
+ public final boolean isInfoEnabled() {
+ return logger.isLoggable(Level.INFO);
+ }
+
+ @Override
+ public final boolean isDebugEnabled() {
+ return logger.isLoggable(Level.FINE);
+ }
+
+ @Override
+ public final boolean isFatalEnabled() {
+ return logger.isLoggable(Level.SEVERE);
+ }
+
+ @Override
+ public final boolean isTraceEnabled() {
+ return logger.isLoggable(Level.FINER);
+ }
+
+ @Override
+ public final void debug(final Object message) {
+ log(Level.FINE, String.valueOf(message), null);
+ }
+
+ @Override
+ public final void debug(final Object message, final Throwable t) {
+ log(Level.FINE, String.valueOf(message), t);
+ }
+
+ @Override
+ public final void trace(final Object message) {
+ log(Level.FINER, String.valueOf(message), null);
+ }
+
+ @Override
+ public final void trace(final Object message, final Throwable t) {
+ log(Level.FINER, String.valueOf(message), t);
+ }
+
+ @Override
+ public final void info(final Object message) {
+ log(Level.INFO, String.valueOf(message), null);
+ }
+
+ @Override
+ public final void info(final Object message, final Throwable t) {
+ log(Level.INFO, String.valueOf(message), t);
+ }
+
+ @Override
+ public final void warn(final Object message) {
+ log(Level.WARNING, String.valueOf(message), null);
+ }
+
+ @Override
+ public final void warn(final Object message, final Throwable t) {
+ log(Level.WARNING, String.valueOf(message), t);
+ }
+
+ @Override
+ public final void error(final Object message) {
+ log(Level.SEVERE, String.valueOf(message), null);
+ }
+
+ @Override
+ public final void error(final Object message, final Throwable t) {
+ log(Level.SEVERE, String.valueOf(message), t);
+ }
+
+ @Override
+ public final void fatal(final Object message) {
+ log(Level.SEVERE, String.valueOf(message), null);
+ }
+
+ @Override
+ public final void fatal(final Object message, final Throwable t) {
+ log(Level.SEVERE, String.valueOf(message), t);
+ }
+
+ private void log(final Level level, final String msg, final Throwable ex) {
+ if (logger.isLoggable(level)) {
+ // Hack (?) to get the stack trace.
+ final Throwable dummyException = new Throwable();
+ final StackTraceElement[] locations = dummyException.getStackTrace();
+ // Caller will be the third element
+ String cname = "unknown";
+ String method = "unknown";
+ if (locations != null && locations.length > 3) {
+ final StackTraceElement caller = locations[3];
+ cname = caller.getClassName();
+ method = caller.getMethodName();
+ }
+ if (ex == null) {
+ logger.logp(level, cname, method, msg);
+ } else {
+ logger.logp(level, cname, method, msg, ex);
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/log/ReloadableLog.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/log/ReloadableLog.java b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/log/ReloadableLog.java
index fe274f8..0f86f37 100644
--- a/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/log/ReloadableLog.java
+++ b/tomee/tomee-juli/src/main/java/org/apache/tomee/jul/formatter/log/ReloadableLog.java
@@ -1,116 +1,116 @@
-/*
- * 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.tomee.jul.formatter.log;
-
-import org.apache.juli.logging.Log;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.concurrent.atomic.AtomicReference;
-
-public final class ReloadableLog {
-
- public static final Class<?>[] INTERFACES = new Class<?>[]{Log.class};
-
- private ReloadableLog() {
- // no-op
- }
-
- public static Log newLog(final String name, final String factory) {
- return Log.class.cast(Proxy.newProxyInstance(
- ReloadableLog.class.getClassLoader(), INTERFACES, new ReloadableLogHandler(factory, name)));
- }
-
- private static final class ReloadableLogHandler implements InvocationHandler {
- private static final String LOG4J_IMPL = "org.apache.tomee.loader.log.Log4jLog";
- private static final String LOG4J2_IMPL = "org.apache.tomee.loader.log.Log4j2Log";
- private static final String SLF4J_IMPL = "org.apache.tomee.loader.log.Slf4jLog";
- private static final String MAVEN_IMPL = "org.apache.openejb.maven.util.TomEEMavenLog";
-
- private volatile String factory;
- private final String name;
- private final AtomicReference<Log> delegate = new AtomicReference<>();
- private volatile boolean done = false;
-
- public ReloadableLogHandler(final String factory, final String name) {
- this.factory = factory;
- this.name = name;
- initDelegate();
- }
-
- private Log initDelegate() {
- if (done) {
- return delegate.get();
- }
-
- try {
- if (factory == null) {
- final String f = TomEELog.getLoggerClazz();
- if (f != null) {
- factory = f;
- }
-
- final Log log = delegate.get();
- if (factory == null && log != null) {
- return log;
- }
- }
- switch (factory) {
- case "org.apache.openejb.util.Log4jLogStreamFactory":
- delegate.set(newInstance(LOG4J_IMPL));
- break;
- case "org.apache.openejb.util.Log4j2LogStreamFactory":
- delegate.set(newInstance(LOG4J2_IMPL));
- break;
- case "org.apache.openejb.util.Slf4jLogStreamFactory":
- delegate.set(newInstance(SLF4J_IMPL));
- break;
- case "org.apache.openejb.maven.util.MavenLogStreamFactory":
- delegate.set(newInstance(MAVEN_IMPL));
- break;
- default:
- delegate.set(new JULLogger(name));
- }
- done = true;
- } catch (final Throwable the) {
- if (delegate.get() == null) {
- delegate.set(new JULLogger(name));
- }
- }
- return delegate.get();
- }
-
- private Log newInstance(final String impl) throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
- return Log.class.cast(Thread.currentThread()
- .getContextClassLoader()
- .loadClass(impl)
- .getConstructor(String.class)
- .newInstance(name));
- }
-
- @Override
- public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
- try {
- return method.invoke(initDelegate(), args);
- } catch (final InvocationTargetException ite) {
- throw ite.getCause();
- }
- }
- }
-}
+/*
+ * 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.tomee.jul.formatter.log;
+
+import org.apache.juli.logging.Log;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.concurrent.atomic.AtomicReference;
+
+public final class ReloadableLog {
+
+ public static final Class<?>[] INTERFACES = new Class<?>[]{Log.class};
+
+ private ReloadableLog() {
+ // no-op
+ }
+
+ public static Log newLog(final String name, final String factory) {
+ return Log.class.cast(Proxy.newProxyInstance(
+ ReloadableLog.class.getClassLoader(), INTERFACES, new ReloadableLogHandler(factory, name)));
+ }
+
+ private static final class ReloadableLogHandler implements InvocationHandler {
+ private static final String LOG4J_IMPL = "org.apache.tomee.loader.log.Log4jLog";
+ private static final String LOG4J2_IMPL = "org.apache.tomee.loader.log.Log4j2Log";
+ private static final String SLF4J_IMPL = "org.apache.tomee.loader.log.Slf4jLog";
+ private static final String MAVEN_IMPL = "org.apache.openejb.maven.util.TomEEMavenLog";
+
+ private volatile String factory;
+ private final String name;
+ private final AtomicReference<Log> delegate = new AtomicReference<>();
+ private volatile boolean done = false;
+
+ public ReloadableLogHandler(final String factory, final String name) {
+ this.factory = factory;
+ this.name = name;
+ initDelegate();
+ }
+
+ private Log initDelegate() {
+ if (done) {
+ return delegate.get();
+ }
+
+ try {
+ if (factory == null) {
+ final String f = TomEELog.getLoggerClazz();
+ if (f != null) {
+ factory = f;
+ }
+
+ final Log log = delegate.get();
+ if (factory == null && log != null) {
+ return log;
+ }
+ }
+ switch (factory) {
+ case "org.apache.openejb.util.Log4jLogStreamFactory":
+ delegate.set(newInstance(LOG4J_IMPL));
+ break;
+ case "org.apache.openejb.util.Log4j2LogStreamFactory":
+ delegate.set(newInstance(LOG4J2_IMPL));
+ break;
+ case "org.apache.openejb.util.Slf4jLogStreamFactory":
+ delegate.set(newInstance(SLF4J_IMPL));
+ break;
+ case "org.apache.openejb.maven.util.MavenLogStreamFactory":
+ delegate.set(newInstance(MAVEN_IMPL));
+ break;
+ default:
+ delegate.set(new JULLogger(name));
+ }
+ done = true;
+ } catch (final Throwable the) {
+ if (delegate.get() == null) {
+ delegate.set(new JULLogger(name));
+ }
+ }
+ return delegate.get();
+ }
+
+ private Log newInstance(final String impl) throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException, ClassNotFoundException {
+ return Log.class.cast(Thread.currentThread()
+ .getContextClassLoader()
+ .loadClass(impl)
+ .getConstructor(String.class)
+ .newInstance(name));
+ }
+
+ @Override
+ public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
+ try {
+ return method.invoke(initDelegate(), args);
+ } catch (final InvocationTargetException ite) {
+ throw ite.getCause();
+ }
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-juli/src/test/java/org/apache/tomee/jul/formatter/SimpleTomEEFormatterTest.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-juli/src/test/java/org/apache/tomee/jul/formatter/SimpleTomEEFormatterTest.java b/tomee/tomee-juli/src/test/java/org/apache/tomee/jul/formatter/SimpleTomEEFormatterTest.java
index 91ff914..ac34d3b 100644
--- a/tomee/tomee-juli/src/test/java/org/apache/tomee/jul/formatter/SimpleTomEEFormatterTest.java
+++ b/tomee/tomee-juli/src/test/java/org/apache/tomee/jul/formatter/SimpleTomEEFormatterTest.java
@@ -1,80 +1,80 @@
-/**
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.tomee.jul.formatter;
-
-import org.apache.commons.lang3.exception.ExceptionUtils;
-import org.junit.Test;
-
-import java.util.logging.Formatter;
-import java.util.logging.Level;
-import java.util.logging.LogRecord;
-
-import static org.junit.Assert.assertEquals;
-
-public class SimpleTomEEFormatterTest {
- private static final String LINE_SEPARATOR_KEY = "line.separator";
-
- @Test
- public void formatNullThrown() throws Exception {
- final String previousLineSeparatorProperty = System.getProperty(LINE_SEPARATOR_KEY);
- try {
- final String lineSeparatorValue = "\n";
- final String logMessage = "An example log record";
- final Level level = Level.FINEST;
-
- System.setProperty(LINE_SEPARATOR_KEY, lineSeparatorValue);
- final LogRecord logRecordInput = new LogRecord(level, logMessage);
- logRecordInput.setThrown(null);
-
- final Formatter formatter = new SimpleTomEEFormatter();
- final String actualFormatOutput = formatter.format(logRecordInput);
-
- final String expectedFormatOutput = level.getLocalizedName() + " - " + logMessage + "\n";
-
- assertEquals(expectedFormatOutput, actualFormatOutput);
- } finally {
- System.setProperty(LINE_SEPARATOR_KEY, previousLineSeparatorProperty);
- }
- }
-
- @Test
- public void formatNotNullThrown() throws Exception {
- final String previousLineSeparatorProperty = System.getProperty(LINE_SEPARATOR_KEY);
-
- try {
- final String lineSeparatorValue = "\n";
- final String logMessage = "An example log record";
- final Level level = Level.CONFIG;
- final String exceptionMessage = "An example exception";
- final Throwable thrown = new Exception(exceptionMessage);
-
- System.setProperty(LINE_SEPARATOR_KEY, lineSeparatorValue);
- final LogRecord logRecordInput = new LogRecord(level, logMessage);
- logRecordInput.setThrown(thrown);
-
- final Formatter formatter = new SimpleTomEEFormatter();
- final String actualFormatOutput = formatter.format(logRecordInput);
-
- final String expectedFormatOutput = level.getLocalizedName() + " - " + logMessage + lineSeparatorValue + ExceptionUtils.getStackTrace(thrown);
-
- assertEquals(expectedFormatOutput, actualFormatOutput);
- } finally {
- System.setProperty(LINE_SEPARATOR_KEY, previousLineSeparatorProperty);
- }
- }
-
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.tomee.jul.formatter;
+
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.junit.Test;
+
+import java.util.logging.Formatter;
+import java.util.logging.Level;
+import java.util.logging.LogRecord;
+
+import static org.junit.Assert.assertEquals;
+
+public class SimpleTomEEFormatterTest {
+ private static final String LINE_SEPARATOR_KEY = "line.separator";
+
+ @Test
+ public void formatNullThrown() throws Exception {
+ final String previousLineSeparatorProperty = System.getProperty(LINE_SEPARATOR_KEY);
+ try {
+ final String lineSeparatorValue = "\n";
+ final String logMessage = "An example log record";
+ final Level level = Level.FINEST;
+
+ System.setProperty(LINE_SEPARATOR_KEY, lineSeparatorValue);
+ final LogRecord logRecordInput = new LogRecord(level, logMessage);
+ logRecordInput.setThrown(null);
+
+ final Formatter formatter = new SimpleTomEEFormatter();
+ final String actualFormatOutput = formatter.format(logRecordInput);
+
+ final String expectedFormatOutput = level.getLocalizedName() + " - " + logMessage + "\n";
+
+ assertEquals(expectedFormatOutput, actualFormatOutput);
+ } finally {
+ System.setProperty(LINE_SEPARATOR_KEY, previousLineSeparatorProperty);
+ }
+ }
+
+ @Test
+ public void formatNotNullThrown() throws Exception {
+ final String previousLineSeparatorProperty = System.getProperty(LINE_SEPARATOR_KEY);
+
+ try {
+ final String lineSeparatorValue = "\n";
+ final String logMessage = "An example log record";
+ final Level level = Level.CONFIG;
+ final String exceptionMessage = "An example exception";
+ final Throwable thrown = new Exception(exceptionMessage);
+
+ System.setProperty(LINE_SEPARATOR_KEY, lineSeparatorValue);
+ final LogRecord logRecordInput = new LogRecord(level, logMessage);
+ logRecordInput.setThrown(thrown);
+
+ final Formatter formatter = new SimpleTomEEFormatter();
+ final String actualFormatOutput = formatter.format(logRecordInput);
+
+ final String expectedFormatOutput = level.getLocalizedName() + " - " + logMessage + lineSeparatorValue + ExceptionUtils.getStackTrace(thrown);
+
+ assertEquals(expectedFormatOutput, actualFormatOutput);
+ } finally {
+ System.setProperty(LINE_SEPARATOR_KEY, previousLineSeparatorProperty);
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEFacesConfigurationProvider.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEFacesConfigurationProvider.java b/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEFacesConfigurationProvider.java
index 0e2e7f0..4ed8b9e 100644
--- a/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEFacesConfigurationProvider.java
+++ b/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEFacesConfigurationProvider.java
@@ -1,46 +1,46 @@
-/**
- * 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.tomee.myfaces;
-
-import org.apache.myfaces.config.DefaultFacesConfigurationProvider;
-import org.apache.myfaces.config.element.FacesConfig;
-import org.apache.openejb.loader.IO;
-
-import javax.faces.context.ExternalContext;
-import java.io.InputStream;
-
-public class TomEEFacesConfigurationProvider extends DefaultFacesConfigurationProvider {
- @Override
- public FacesConfig getWebAppFacesConfig(final ExternalContext ectx) {
- final InputStream stream = ectx.getResourceAsStream("/WEB-INF/faces-config.xml");
- if (stream != null && isEmpty(stream)) {
- return new org.apache.myfaces.config.impl.digester.elements.FacesConfig();
- }
- // we can't just check the emptyness after the exception
- // because otherwise an exception is logged because of the parser error handler
- return super.getWebAppFacesConfig(ectx);
- }
-
- private static boolean isEmpty(final InputStream stream) {
- try {
- final String content = IO.slurp(stream);
- return content.trim().length() == 0;
- } catch (final Exception e) {
- return false;
- }
- }
-}
+/**
+ * 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.tomee.myfaces;
+
+import org.apache.myfaces.config.DefaultFacesConfigurationProvider;
+import org.apache.myfaces.config.element.FacesConfig;
+import org.apache.openejb.loader.IO;
+
+import javax.faces.context.ExternalContext;
+import java.io.InputStream;
+
+public class TomEEFacesConfigurationProvider extends DefaultFacesConfigurationProvider {
+ @Override
+ public FacesConfig getWebAppFacesConfig(final ExternalContext ectx) {
+ final InputStream stream = ectx.getResourceAsStream("/WEB-INF/faces-config.xml");
+ if (stream != null && isEmpty(stream)) {
+ return new org.apache.myfaces.config.impl.digester.elements.FacesConfig();
+ }
+ // we can't just check the emptyness after the exception
+ // because otherwise an exception is logged because of the parser error handler
+ return super.getWebAppFacesConfig(ectx);
+ }
+
+ private static boolean isEmpty(final InputStream stream) {
+ try {
+ final String content = IO.slurp(stream);
+ return content.trim().length() == 0;
+ } catch (final Exception e) {
+ return false;
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEFacesConfigurationProviderFactory.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEFacesConfigurationProviderFactory.java b/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEFacesConfigurationProviderFactory.java
index e37ad1f..1d098c5 100644
--- a/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEFacesConfigurationProviderFactory.java
+++ b/tomee/tomee-myfaces/src/main/java/org/apache/tomee/myfaces/TomEEFacesConfigurationProviderFactory.java
@@ -1,72 +1,72 @@
-/**
- * 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.tomee.myfaces;
-
-import org.apache.myfaces.shared.util.ClassUtils;
-import org.apache.myfaces.spi.FacesConfigurationProvider;
-import org.apache.myfaces.spi.ServiceProviderFinderFactory;
-import org.apache.myfaces.spi.impl.DefaultFacesConfigurationProviderFactory;
-
-import javax.faces.FacesException;
-import javax.faces.context.ExternalContext;
-import java.lang.reflect.InvocationTargetException;
-import java.security.PrivilegedActionException;
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-// fork to be able to not fail on empty faces-config.xml
-public class TomEEFacesConfigurationProviderFactory extends DefaultFacesConfigurationProviderFactory {
- public static final String FACES_CONFIGURATION_PROVIDER = FacesConfigurationProvider.class.getName();
- public static final String FACES_CONFIGURATION_PROVIDER_LIST = FacesConfigurationProvider.class.getName()+".LIST";
- public static final String FACES_CONFIGURATION_PROVIDER_INSTANCE_KEY = FacesConfigurationProvider.class.getName() + ".INSTANCE";
-
- private Logger getLogger() {
- return Logger.getLogger(DefaultFacesConfigurationProviderFactory.class.getName());
- }
-
- @Override
- public FacesConfigurationProvider getFacesConfigurationProvider(final ExternalContext externalContext) {
- FacesConfigurationProvider returnValue = (FacesConfigurationProvider) externalContext.getApplicationMap().get(FACES_CONFIGURATION_PROVIDER_INSTANCE_KEY);
- if (returnValue == null) {
- final ExternalContext extContext = externalContext;
- try {
- returnValue = resolveFacesConfigurationProviderFromService(extContext);
- externalContext.getApplicationMap().put(FACES_CONFIGURATION_PROVIDER_INSTANCE_KEY, returnValue);
- } catch (final ClassNotFoundException | NoClassDefFoundError e) {
- // ignore
- } catch (final InstantiationException | InvocationTargetException | IllegalAccessException e) {
- getLogger().log(Level.SEVERE, "", e);
- } catch (final PrivilegedActionException e) {
- throw new FacesException(e);
- }
- }
-
-
- return returnValue;
- }
-
- private FacesConfigurationProvider resolveFacesConfigurationProviderFromService(final ExternalContext externalContext)
- throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException {
- List<String> classList = (List<String>) externalContext.getApplicationMap().get(FACES_CONFIGURATION_PROVIDER_LIST);
- if (classList == null) {
- classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext).getServiceProviderList(FACES_CONFIGURATION_PROVIDER);
- externalContext.getApplicationMap().put(FACES_CONFIGURATION_PROVIDER_LIST, classList);
- }
- return ClassUtils.buildApplicationObject(FacesConfigurationProvider.class, classList, new TomEEFacesConfigurationProvider());
- }
-}
+/**
+ * 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.tomee.myfaces;
+
+import org.apache.myfaces.shared.util.ClassUtils;
+import org.apache.myfaces.spi.FacesConfigurationProvider;
+import org.apache.myfaces.spi.ServiceProviderFinderFactory;
+import org.apache.myfaces.spi.impl.DefaultFacesConfigurationProviderFactory;
+
+import javax.faces.FacesException;
+import javax.faces.context.ExternalContext;
+import java.lang.reflect.InvocationTargetException;
+import java.security.PrivilegedActionException;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+// fork to be able to not fail on empty faces-config.xml
+public class TomEEFacesConfigurationProviderFactory extends DefaultFacesConfigurationProviderFactory {
+ public static final String FACES_CONFIGURATION_PROVIDER = FacesConfigurationProvider.class.getName();
+ public static final String FACES_CONFIGURATION_PROVIDER_LIST = FacesConfigurationProvider.class.getName()+".LIST";
+ public static final String FACES_CONFIGURATION_PROVIDER_INSTANCE_KEY = FacesConfigurationProvider.class.getName() + ".INSTANCE";
+
+ private Logger getLogger() {
+ return Logger.getLogger(DefaultFacesConfigurationProviderFactory.class.getName());
+ }
+
+ @Override
+ public FacesConfigurationProvider getFacesConfigurationProvider(final ExternalContext externalContext) {
+ FacesConfigurationProvider returnValue = (FacesConfigurationProvider) externalContext.getApplicationMap().get(FACES_CONFIGURATION_PROVIDER_INSTANCE_KEY);
+ if (returnValue == null) {
+ final ExternalContext extContext = externalContext;
+ try {
+ returnValue = resolveFacesConfigurationProviderFromService(extContext);
+ externalContext.getApplicationMap().put(FACES_CONFIGURATION_PROVIDER_INSTANCE_KEY, returnValue);
+ } catch (final ClassNotFoundException | NoClassDefFoundError e) {
+ // ignore
+ } catch (final InstantiationException | InvocationTargetException | IllegalAccessException e) {
+ getLogger().log(Level.SEVERE, "", e);
+ } catch (final PrivilegedActionException e) {
+ throw new FacesException(e);
+ }
+ }
+
+
+ return returnValue;
+ }
+
+ private FacesConfigurationProvider resolveFacesConfigurationProviderFromService(final ExternalContext externalContext)
+ throws ClassNotFoundException, NoClassDefFoundError, InstantiationException, IllegalAccessException, InvocationTargetException, PrivilegedActionException {
+ List<String> classList = (List<String>) externalContext.getApplicationMap().get(FACES_CONFIGURATION_PROVIDER_LIST);
+ if (classList == null) {
+ classList = ServiceProviderFinderFactory.getServiceProviderFinder(externalContext).getServiceProviderList(FACES_CONFIGURATION_PROVIDER);
+ externalContext.getApplicationMap().put(FACES_CONFIGURATION_PROVIDER_LIST, classList);
+ }
+ return ClassUtils.buildApplicationObject(FacesConfigurationProvider.class, classList, new TomEEFacesConfigurationProvider());
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-myfaces/src/main/resources/META-INF/services/org.apache.myfaces.spi.FacesConfigurationProviderFactory
----------------------------------------------------------------------
diff --git a/tomee/tomee-myfaces/src/main/resources/META-INF/services/org.apache.myfaces.spi.FacesConfigurationProviderFactory b/tomee/tomee-myfaces/src/main/resources/META-INF/services/org.apache.myfaces.spi.FacesConfigurationProviderFactory
index 8d058c7..e5b0160 100644
--- a/tomee/tomee-myfaces/src/main/resources/META-INF/services/org.apache.myfaces.spi.FacesConfigurationProviderFactory
+++ b/tomee/tomee-myfaces/src/main/resources/META-INF/services/org.apache.myfaces.spi.FacesConfigurationProviderFactory
@@ -1 +1 @@
-org.apache.tomee.myfaces.TomEEFacesConfigurationProviderFactory
+org.apache.tomee.myfaces.TomEEFacesConfigurationProviderFactory
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-webaccess/src/main/java/readme.txt
----------------------------------------------------------------------
diff --git a/tomee/tomee-webaccess/src/main/java/readme.txt b/tomee/tomee-webaccess/src/main/java/readme.txt
index 59bd2de..f3a6d76 100644
--- a/tomee/tomee-webaccess/src/main/java/readme.txt
+++ b/tomee/tomee-webaccess/src/main/java/readme.txt
@@ -1,6 +1,6 @@
-If there is at least one file (Java or not) in src/main/java,
-then all files in src/main/groovy will be found.
-If, however, src/main/java is empty, then src/main/groovy will be ignored.
-You can get around this by placing an empty file in src/main/java just so that src/main/groovy
-will be recognized. The same is true for src/test/java and src/test/groovy.
+If there is at least one file (Java or not) in src/main/java,
+then all files in src/main/groovy will be found.
+If, however, src/main/java is empty, then src/main/groovy will be ignored.
+You can get around this by placing an empty file in src/main/java just so that src/main/groovy
+will be recognized. The same is true for src/test/java and src/test/groovy.
This is actually a workaround for GRECLIPSE-1221.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-webaccess/src/main/webapp/app/js/view/growl.js
----------------------------------------------------------------------
diff --git a/tomee/tomee-webaccess/src/main/webapp/app/js/view/growl.js b/tomee/tomee-webaccess/src/main/webapp/app/js/view/growl.js
index 7510997..a147ed9 100644
--- a/tomee/tomee-webaccess/src/main/webapp/app/js/view/growl.js
+++ b/tomee/tomee-webaccess/src/main/webapp/app/js/view/growl.js
@@ -1,70 +1,70 @@
-/**
- *
- * 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.
- */
-
-(function () {
- 'use strict';
-
- var deps = ['app/js/templates', 'lib/underscore'];
- define(deps, function (templates, underscore) {
-
- var GrowlContainerView = Backbone.View.extend({
- el: 'body',
- render: function () {
- if (this.options.isRendered) {
- return this;
- }
-
- var me = this;
- var container = $(templates.getValue('growl-container', {}));
- me.$el.append(container[0]);
- me.containerEl = $(container[0]);
-
- // render it only once
- this.options.isRendered = true;
- return this;
- }
- });
- var container = new GrowlContainerView({});
-
- function showNotification(messageType, messageText) {
- container.render();
-
- var alert = $(templates.getValue('growl', {
- messageType: messageType,
- messageText: messageText
- }));
-
- container.containerEl.append(alert[0]);
- alert.fadeIn();
- var faceOutCallback = function () {
- alert.fadeOut(null, function () {
- try {
- alert.remove();
- } catch (ignore) { /* noop */
- }
- });
- };
- var faceOut = underscore.debounce(faceOutCallback, 5000);
- faceOut();
- }
-
- return {
- showNotification: showNotification
- };
- });
-}());
+/**
+ *
+ * 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.
+ */
+
+(function () {
+ 'use strict';
+
+ var deps = ['app/js/templates', 'lib/underscore'];
+ define(deps, function (templates, underscore) {
+
+ var GrowlContainerView = Backbone.View.extend({
+ el: 'body',
+ render: function () {
+ if (this.options.isRendered) {
+ return this;
+ }
+
+ var me = this;
+ var container = $(templates.getValue('growl-container', {}));
+ me.$el.append(container[0]);
+ me.containerEl = $(container[0]);
+
+ // render it only once
+ this.options.isRendered = true;
+ return this;
+ }
+ });
+ var container = new GrowlContainerView({});
+
+ function showNotification(messageType, messageText) {
+ container.render();
+
+ var alert = $(templates.getValue('growl', {
+ messageType: messageType,
+ messageText: messageText
+ }));
+
+ container.containerEl.append(alert[0]);
+ alert.fadeIn();
+ var faceOutCallback = function () {
+ alert.fadeOut(null, function () {
+ try {
+ alert.remove();
+ } catch (ignore) { /* noop */
+ }
+ });
+ };
+ var faceOut = underscore.debounce(faceOutCallback, 5000);
+ faceOut();
+ }
+
+ return {
+ showNotification: showNotification
+ };
+ });
+}());
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-webaccess/src/test/java/readme.txt
----------------------------------------------------------------------
diff --git a/tomee/tomee-webaccess/src/test/java/readme.txt b/tomee/tomee-webaccess/src/test/java/readme.txt
index 59bd2de..f3a6d76 100644
--- a/tomee/tomee-webaccess/src/test/java/readme.txt
+++ b/tomee/tomee-webaccess/src/test/java/readme.txt
@@ -1,6 +1,6 @@
-If there is at least one file (Java or not) in src/main/java,
-then all files in src/main/groovy will be found.
-If, however, src/main/java is empty, then src/main/groovy will be ignored.
-You can get around this by placing an empty file in src/main/java just so that src/main/groovy
-will be recognized. The same is true for src/test/java and src/test/groovy.
+If there is at least one file (Java or not) in src/main/java,
+then all files in src/main/groovy will be found.
+If, however, src/main/java is empty, then src/main/groovy will be ignored.
+You can get around this by placing an empty file in src/main/java just so that src/main/groovy
+will be recognized. The same is true for src/test/java and src/test/groovy.
This is actually a workaround for GRECLIPSE-1221.
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-webapp/src/main/java/org/apache/tomee/webapp/installer/InstallerServlet.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-webapp/src/main/java/org/apache/tomee/webapp/installer/InstallerServlet.java b/tomee/tomee-webapp/src/main/java/org/apache/tomee/webapp/installer/InstallerServlet.java
index d5cf64b..8bf7aac 100644
--- a/tomee/tomee-webapp/src/main/java/org/apache/tomee/webapp/installer/InstallerServlet.java
+++ b/tomee/tomee-webapp/src/main/java/org/apache/tomee/webapp/installer/InstallerServlet.java
@@ -1,81 +1,81 @@
-/*
- * 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.tomee.webapp.installer;
-
-import org.apache.tomee.installer.Installer;
-import org.apache.tomee.installer.Paths;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-public class InstallerServlet extends HttpServlet {
-
- private String escape(final String str) {
- if (str == null) {
- return "";
- }
- return str.replaceAll("\"", "\\\\\"").replaceAll("\\\\", "\\\\\\\\");
- }
-
- private String getJsonList(final List<Map<String, String>> list) {
- final StringBuffer sb = new StringBuffer();
- for (final Map<String, String> entry : list) {
- sb.append(String.format("{\"key\": \"%s\", \"value\": \"%s\"},",
- entry.get("key"), escape(entry.get("value"))
- ));
- }
- if (!list.isEmpty()) {
- sb.deleteCharAt(sb.length() - 1);
- }
- return "[" + sb.toString() + "]";
- }
-
- @Override
- protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
- final ServletContext ctx = req.getServletContext();
- final String rootPath = ctx.getRealPath("/");
- final Runner installer = new Runner(new Installer(new Paths(new File(rootPath))));
- resp.setContentType("application/json");
- resp.getOutputStream().print(getJsonList(installer.execute(false)));
- }
-
- @Override
- protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
- final ServletContext ctx = req.getServletContext();
- final String rootPath = ctx.getRealPath("/");
- final Runner installer = new Runner(new Installer(new Paths(new File(rootPath))));
- if (req.getParameter("catalinaBaseDir") != null && "".equals(req.getParameter("catalinaBaseDir").trim())) {
- installer.setCatalinaBaseDir(req.getParameter("catalinaBaseDir").trim());
- }
- if (req.getParameter("catalinaHome") != null && "".equals(req.getParameter("catalinaHome").trim())) {
- installer.setCatalinaHome(req.getParameter("catalinaHome").trim());
- }
- if (req.getParameter("serverXmlFile") != null && "".equals(req.getParameter("serverXmlFile").trim())) {
- installer.setServerXmlFile(req.getParameter("serverXmlFile").trim());
- }
- resp.setContentType("application/json");
- resp.getOutputStream().print(getJsonList(installer.execute(true)));
- }
-}
+/*
+ * 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.tomee.webapp.installer;
+
+import org.apache.tomee.installer.Installer;
+import org.apache.tomee.installer.Paths;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
+public class InstallerServlet extends HttpServlet {
+
+ private String escape(final String str) {
+ if (str == null) {
+ return "";
+ }
+ return str.replaceAll("\"", "\\\\\"").replaceAll("\\\\", "\\\\\\\\");
+ }
+
+ private String getJsonList(final List<Map<String, String>> list) {
+ final StringBuffer sb = new StringBuffer();
+ for (final Map<String, String> entry : list) {
+ sb.append(String.format("{\"key\": \"%s\", \"value\": \"%s\"},",
+ entry.get("key"), escape(entry.get("value"))
+ ));
+ }
+ if (!list.isEmpty()) {
+ sb.deleteCharAt(sb.length() - 1);
+ }
+ return "[" + sb.toString() + "]";
+ }
+
+ @Override
+ protected void doGet(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
+ final ServletContext ctx = req.getServletContext();
+ final String rootPath = ctx.getRealPath("/");
+ final Runner installer = new Runner(new Installer(new Paths(new File(rootPath))));
+ resp.setContentType("application/json");
+ resp.getOutputStream().print(getJsonList(installer.execute(false)));
+ }
+
+ @Override
+ protected void doPost(final HttpServletRequest req, final HttpServletResponse resp) throws ServletException, IOException {
+ final ServletContext ctx = req.getServletContext();
+ final String rootPath = ctx.getRealPath("/");
+ final Runner installer = new Runner(new Installer(new Paths(new File(rootPath))));
+ if (req.getParameter("catalinaBaseDir") != null && "".equals(req.getParameter("catalinaBaseDir").trim())) {
+ installer.setCatalinaBaseDir(req.getParameter("catalinaBaseDir").trim());
+ }
+ if (req.getParameter("catalinaHome") != null && "".equals(req.getParameter("catalinaHome").trim())) {
+ installer.setCatalinaHome(req.getParameter("catalinaHome").trim());
+ }
+ if (req.getParameter("serverXmlFile") != null && "".equals(req.getParameter("serverXmlFile").trim())) {
+ installer.setServerXmlFile(req.getParameter("serverXmlFile").trim());
+ }
+ resp.setContentType("application/json");
+ resp.getOutputStream().print(getJsonList(installer.execute(true)));
+ }
+}
[3/3] tomee git commit: EOL commit
Posted by rm...@apache.org.
EOL commit
Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/3069db0b
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/3069db0b
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/3069db0b
Branch: refs/heads/master
Commit: 3069db0ba41c586c36e3070774443c70d7d3b926
Parents: 912db41
Author: Romain Manni-Bucau <rm...@gmail.com>
Authored: Wed Nov 18 12:17:59 2015 -0800
Committer: Romain Manni-Bucau <rm...@gmail.com>
Committed: Wed Nov 18 12:17:59 2015 -0800
----------------------------------------------------------------------
.../openejb/tck/impl/ContainersImplTomEE.java | 340 ++++++-------
.../openejb/tck/impl/FullRestartContainer.java | 274 +++++------
.../apache/openejb/tck/util/ServerLocal.java | 100 ++--
.../main/groovy/commands/SetupCommand.groovy | 236 ++++-----
.../apache/tomee/RemoteTomEEEJBContainer.java | 338 ++++++-------
.../apache-tomee/src/main/resources/service.bat | 452 ++++++++---------
.../main/resources/service.install.as.admin.bat | 64 +--
.../main/resources/service.remove.as.admin.bat | 64 +--
tomee/apache-tomee/src/main/resources/tomee.bat | 180 +++----
tomee/build.xml | 92 ++--
.../org/apache/tomee/catalina/Contexts.java | 330 ++++++-------
.../tomee/catalina/TomEEWebappLoader.java | 242 +++++-----
.../tomee/catalina/TomcatDeploymentLoader.java | 86 ++--
.../java/org/apache/tomee/embedded/Main.java | 268 +++++------
.../org/apache/tomee/configs/catalina.policy | 482 +++++++++----------
.../apache/tomee/configs/catalina.properties | 242 +++++-----
.../java/org/apache/tomee/embedded/ABean.java | 52 +-
.../src/test/resources/META-INF/beans.xml | 38 +-
.../jul/formatter/AsyncConsoleHandler.java | 126 ++---
.../jul/formatter/SimpleTomEEFormatter.java | 96 ++--
.../tomee/jul/formatter/log/JULLogger.java | 360 +++++++-------
.../tomee/jul/formatter/log/ReloadableLog.java | 232 ++++-----
.../jul/formatter/SimpleTomEEFormatterTest.java | 160 +++---
.../TomEEFacesConfigurationProvider.java | 92 ++--
.../TomEEFacesConfigurationProviderFactory.java | 144 +++---
...yfaces.spi.FacesConfigurationProviderFactory | 2 +-
tomee/tomee-webaccess/src/main/java/readme.txt | 10 +-
.../src/main/webapp/app/js/view/growl.js | 140 +++---
tomee/tomee-webaccess/src/test/java/readme.txt | 10 +-
.../webapp/installer/InstallerServlet.java | 162 +++----
30 files changed, 2707 insertions(+), 2707 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
----------------------------------------------------------------------
diff --git a/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java b/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
index 813ff75..f382b7a 100644
--- a/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
+++ b/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/ContainersImplTomEE.java
@@ -1,170 +1,170 @@
-/*
- * 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.tck.impl;
-
-import org.apache.openejb.assembler.Deployer;
-import org.apache.openejb.assembler.classic.AppInfo;
-import org.apache.openejb.client.RemoteInitialContextFactory;
-import org.apache.openejb.config.RemoteServer;
-import org.apache.openejb.config.ValidationException;
-import org.apache.openejb.loader.Options;
-import org.apache.openejb.tck.OpenEJBTCKRuntimeException;
-import org.apache.openejb.tck.util.ServerLocal;
-import org.jboss.testharness.api.DeploymentException;
-import org.jboss.testharness.spi.Containers;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.Properties;
-
-/**
- * @version $Rev$ $Date$
- */
-public class ContainersImplTomEE extends AbstractContainers implements Containers {
- private static int count = 0;
- private final RemoteServer server;
- private Deployer deployer = null;
- private Exception exception;
- private AppInfo appInfo;
- private File currentFile = null;
- private final int port = ServerLocal.getPort(8080);
-
- private Deployer lookup() {
- final Options options = new Options(System.getProperties());
- final Properties props = new Properties();
- props.put(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName());
- props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL, "http://localhost:" + port + "/tomee/ejb"));
-
- final String deployerJndi = System.getProperty("openejb.deployer.jndiname", "openejb/DeployerBusinessRemote");
-
- try {
- final InitialContext context = new InitialContext(props);
- return (Deployer) context.lookup(deployerJndi);
- } catch (final Exception e) {
- throw new OpenEJBTCKRuntimeException(e);
- }
- }
-
- public ContainersImplTomEE() {
- System.out.println("ContainersImpl=" + ContainersImplTomEE.class.getName());
- System.out.println("Initialized ContainersImplTomEE " + (++count) + ", wait port = " + port);
- server = new RemoteServer();
- server.setPortStartup(this.port);
- }
-
- @Override
- public boolean deploy(final InputStream archive, final String name) throws IOException {
- exception = null;
- appInfo = null;
-
- System.out.println("Deploying " + archive + " with name " + name);
-
- currentFile = getFile(name);
- System.out.println(currentFile);
- writeToFile(currentFile, archive);
- try {
- if (deployer == null) {
- deployer = lookup();
- }
- appInfo = deployer.deploy(currentFile.getAbsolutePath());
- } catch (final Exception ex) {
- Exception e = ex;
- if (e.getCause() instanceof ValidationException) {
- e = (Exception) e.getCause();
- }
-
- if (name.contains(".broken.")) {
- // Tests that contain the name '.broken.' are expected to fail deployment
- // This is how the TCK verifies the container is doing the required error checking
- exception = (DeploymentException) new DeploymentException("deploy failed").initCause(e);
- } else {
- // This on the other hand is not good ....
- System.out.println("FIX Deployment of " + name);
- e.printStackTrace();
- exception = e;
- }
-
- return false;
- }
- return true;
- }
-
- @Override
- public DeploymentException getDeploymentException() {
- try {
- return (DeploymentException) exception;
- } catch (final Exception e) {
- System.out.println("BADCAST");
- return new DeploymentException("", exception);
- }
- }
-
- @Override
- public void undeploy(final String name) throws IOException {
- if (appInfo == null) {
- if (!(exception instanceof DeploymentException)) {
- System.out.println("Nothing to undeploy" + name);
- }
- return;
- }
-
- System.out.println("Undeploying " + name);
- try {
- deployer.undeploy(appInfo.path);
- } catch (final Exception e) {
- e.printStackTrace();
- throw new OpenEJBTCKRuntimeException(e);
- }
-
- final File toDelete;
- if (currentFile != null && (toDelete = currentFile.getParentFile()).exists()) {
- System.out.println("deleting " + toDelete.getAbsolutePath());
- delete(toDelete);
- }
- }
-
- protected File getFile(final String name) {
- final File dir = new File(tmpDir, Math.random() + "");
- if (!dir.exists() && !dir.mkdir()) {
- throw new RuntimeException("Failed to create directory: " + dir);
- }
- dir.deleteOnExit();
- return new File(dir, name);
- }
-
- @Override
- public void setup() throws IOException {
- System.out.println("Setup called");
- try {
- server.start(Arrays.asList("-Dopenejb.classloader.forced-load=org.apache.openejb.tck"), "start", true);
- } catch (final Exception e) {
- cleanup();
- throw e;
- }
- System.out.println("Started");
- }
-
- @Override
- public void cleanup() throws IOException {
- System.out.println("Cleanup called");
- server.destroy();
- }
-}
+/*
+ * 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.tck.impl;
+
+import org.apache.openejb.assembler.Deployer;
+import org.apache.openejb.assembler.classic.AppInfo;
+import org.apache.openejb.client.RemoteInitialContextFactory;
+import org.apache.openejb.config.RemoteServer;
+import org.apache.openejb.config.ValidationException;
+import org.apache.openejb.loader.Options;
+import org.apache.openejb.tck.OpenEJBTCKRuntimeException;
+import org.apache.openejb.tck.util.ServerLocal;
+import org.jboss.testharness.api.DeploymentException;
+import org.jboss.testharness.spi.Containers;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+import java.util.Properties;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class ContainersImplTomEE extends AbstractContainers implements Containers {
+ private static int count = 0;
+ private final RemoteServer server;
+ private Deployer deployer = null;
+ private Exception exception;
+ private AppInfo appInfo;
+ private File currentFile = null;
+ private final int port = ServerLocal.getPort(8080);
+
+ private Deployer lookup() {
+ final Options options = new Options(System.getProperties());
+ final Properties props = new Properties();
+ props.put(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName());
+ props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL, "http://localhost:" + port + "/tomee/ejb"));
+
+ final String deployerJndi = System.getProperty("openejb.deployer.jndiname", "openejb/DeployerBusinessRemote");
+
+ try {
+ final InitialContext context = new InitialContext(props);
+ return (Deployer) context.lookup(deployerJndi);
+ } catch (final Exception e) {
+ throw new OpenEJBTCKRuntimeException(e);
+ }
+ }
+
+ public ContainersImplTomEE() {
+ System.out.println("ContainersImpl=" + ContainersImplTomEE.class.getName());
+ System.out.println("Initialized ContainersImplTomEE " + (++count) + ", wait port = " + port);
+ server = new RemoteServer();
+ server.setPortStartup(this.port);
+ }
+
+ @Override
+ public boolean deploy(final InputStream archive, final String name) throws IOException {
+ exception = null;
+ appInfo = null;
+
+ System.out.println("Deploying " + archive + " with name " + name);
+
+ currentFile = getFile(name);
+ System.out.println(currentFile);
+ writeToFile(currentFile, archive);
+ try {
+ if (deployer == null) {
+ deployer = lookup();
+ }
+ appInfo = deployer.deploy(currentFile.getAbsolutePath());
+ } catch (final Exception ex) {
+ Exception e = ex;
+ if (e.getCause() instanceof ValidationException) {
+ e = (Exception) e.getCause();
+ }
+
+ if (name.contains(".broken.")) {
+ // Tests that contain the name '.broken.' are expected to fail deployment
+ // This is how the TCK verifies the container is doing the required error checking
+ exception = (DeploymentException) new DeploymentException("deploy failed").initCause(e);
+ } else {
+ // This on the other hand is not good ....
+ System.out.println("FIX Deployment of " + name);
+ e.printStackTrace();
+ exception = e;
+ }
+
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public DeploymentException getDeploymentException() {
+ try {
+ return (DeploymentException) exception;
+ } catch (final Exception e) {
+ System.out.println("BADCAST");
+ return new DeploymentException("", exception);
+ }
+ }
+
+ @Override
+ public void undeploy(final String name) throws IOException {
+ if (appInfo == null) {
+ if (!(exception instanceof DeploymentException)) {
+ System.out.println("Nothing to undeploy" + name);
+ }
+ return;
+ }
+
+ System.out.println("Undeploying " + name);
+ try {
+ deployer.undeploy(appInfo.path);
+ } catch (final Exception e) {
+ e.printStackTrace();
+ throw new OpenEJBTCKRuntimeException(e);
+ }
+
+ final File toDelete;
+ if (currentFile != null && (toDelete = currentFile.getParentFile()).exists()) {
+ System.out.println("deleting " + toDelete.getAbsolutePath());
+ delete(toDelete);
+ }
+ }
+
+ protected File getFile(final String name) {
+ final File dir = new File(tmpDir, Math.random() + "");
+ if (!dir.exists() && !dir.mkdir()) {
+ throw new RuntimeException("Failed to create directory: " + dir);
+ }
+ dir.deleteOnExit();
+ return new File(dir, name);
+ }
+
+ @Override
+ public void setup() throws IOException {
+ System.out.println("Setup called");
+ try {
+ server.start(Arrays.asList("-Dopenejb.classloader.forced-load=org.apache.openejb.tck"), "start", true);
+ } catch (final Exception e) {
+ cleanup();
+ throw e;
+ }
+ System.out.println("Started");
+ }
+
+ @Override
+ public void cleanup() throws IOException {
+ System.out.println("Cleanup called");
+ server.destroy();
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/FullRestartContainer.java
----------------------------------------------------------------------
diff --git a/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/FullRestartContainer.java b/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/FullRestartContainer.java
index 98d00e6..2199ec2 100644
--- a/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/FullRestartContainer.java
+++ b/tck/tck-common/src/main/java/org/apache/openejb/tck/impl/FullRestartContainer.java
@@ -1,137 +1,137 @@
-/*
- * 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.tck.impl;
-
-import org.apache.openejb.client.RemoteInitialContextFactory;
-import org.apache.openejb.config.RemoteServer;
-import org.apache.openejb.loader.Options;
-import org.apache.openejb.tck.OpenEJBTCKRuntimeException;
-import org.apache.openejb.tck.util.ServerLocal;
-import org.apache.tomee.catalina.facade.ExceptionManagerFacade;
-import org.jboss.testharness.api.DeploymentException;
-import org.jboss.testharness.spi.Containers;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-/**
- * flow:
- * - copy file
- * - start the server
- * - stop the server
- * - remove the file
- */
-public class FullRestartContainer extends AbstractContainers implements Containers {
- private static final File WEBAPP_DIR = new File(System.getProperty("openejb.home"), "webapps/");
- private static final File APPS_DIR = new File(System.getProperty("openejb.home"), "apps/");
-
- private RemoteServer server;
- private Exception exception;
- private File currentFile;
-
- public FullRestartContainer() {
- System.out.println("ContainersImpl=" + FullRestartContainer.class.getName());
- }
-
- @Override
- public DeploymentException getDeploymentException() {
- if (exception instanceof DeploymentException) {
- return (DeploymentException) exception;
- }
- System.out.println("BADCAST");
- return new DeploymentException("", exception);
- }
-
- @Override
- public boolean deploy(final InputStream archive, final String name) throws IOException {
- if (name.endsWith("war")) {
- currentFile = new File(WEBAPP_DIR, name);
- } else {
- currentFile = new File(APPS_DIR, name);
- }
-
- System.out.println(currentFile);
- writeToFile(currentFile, archive);
-
- final int port = ServerLocal.getPort(-1);
- if (port > 0) {
- server = new RemoteServer(100, true);
- server.setPortStartup(port);
- } else {
- throw new OpenEJBTCKRuntimeException("Please set the tomee port using the system property 'server.http.port'");
- }
-
- try {
- server.start();
- } catch (final Exception e) {
- server.destroy();
- e.printStackTrace();
- throw e;
- }
-
- return (exception = lookup().exception()) == null;
- }
-
- @Override
- public void undeploy(final String name) throws IOException {
-
- if (null != server) {
- server.destroy();
- }
-
- final File folder = new File(currentFile.getParentFile(), currentFile.getName().substring(0, currentFile.getName().length() - 4));
- if (folder.exists()) {
- delete(folder);
- }
- delete(currentFile);
- }
-
- @Override
- public void setup() throws IOException {
- // no-op
- }
-
- @Override
- public void cleanup() throws IOException {
- // no-op
- }
-
- private ExceptionManagerFacade lookup() {
- final Options options = new Options(System.getProperties());
- final Properties props = new Properties();
- props.put(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName());
- final int port = ServerLocal.getPort(-1);
- if (port > 0) {
- System.out.println("provider url = " + "http://localhost:" + port + "/tomee/ejb");
- props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL, "http://localhost:" + port + "/tomee/ejb"));
- } else {
- throw new OpenEJBTCKRuntimeException("Please set the tomee port using the system property 'server.http.port'");
- }
-
- try {
- final InitialContext context = new InitialContext(props);
- return (ExceptionManagerFacade) context.lookup("openejb/ExceptionManagerFacadeBusinessRemote");
- } catch (final Exception e) {
- throw new OpenEJBTCKRuntimeException(e);
- }
- }
-}
+/*
+ * 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.tck.impl;
+
+import org.apache.openejb.client.RemoteInitialContextFactory;
+import org.apache.openejb.config.RemoteServer;
+import org.apache.openejb.loader.Options;
+import org.apache.openejb.tck.OpenEJBTCKRuntimeException;
+import org.apache.openejb.tck.util.ServerLocal;
+import org.apache.tomee.catalina.facade.ExceptionManagerFacade;
+import org.jboss.testharness.api.DeploymentException;
+import org.jboss.testharness.spi.Containers;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+/**
+ * flow:
+ * - copy file
+ * - start the server
+ * - stop the server
+ * - remove the file
+ */
+public class FullRestartContainer extends AbstractContainers implements Containers {
+ private static final File WEBAPP_DIR = new File(System.getProperty("openejb.home"), "webapps/");
+ private static final File APPS_DIR = new File(System.getProperty("openejb.home"), "apps/");
+
+ private RemoteServer server;
+ private Exception exception;
+ private File currentFile;
+
+ public FullRestartContainer() {
+ System.out.println("ContainersImpl=" + FullRestartContainer.class.getName());
+ }
+
+ @Override
+ public DeploymentException getDeploymentException() {
+ if (exception instanceof DeploymentException) {
+ return (DeploymentException) exception;
+ }
+ System.out.println("BADCAST");
+ return new DeploymentException("", exception);
+ }
+
+ @Override
+ public boolean deploy(final InputStream archive, final String name) throws IOException {
+ if (name.endsWith("war")) {
+ currentFile = new File(WEBAPP_DIR, name);
+ } else {
+ currentFile = new File(APPS_DIR, name);
+ }
+
+ System.out.println(currentFile);
+ writeToFile(currentFile, archive);
+
+ final int port = ServerLocal.getPort(-1);
+ if (port > 0) {
+ server = new RemoteServer(100, true);
+ server.setPortStartup(port);
+ } else {
+ throw new OpenEJBTCKRuntimeException("Please set the tomee port using the system property 'server.http.port'");
+ }
+
+ try {
+ server.start();
+ } catch (final Exception e) {
+ server.destroy();
+ e.printStackTrace();
+ throw e;
+ }
+
+ return (exception = lookup().exception()) == null;
+ }
+
+ @Override
+ public void undeploy(final String name) throws IOException {
+
+ if (null != server) {
+ server.destroy();
+ }
+
+ final File folder = new File(currentFile.getParentFile(), currentFile.getName().substring(0, currentFile.getName().length() - 4));
+ if (folder.exists()) {
+ delete(folder);
+ }
+ delete(currentFile);
+ }
+
+ @Override
+ public void setup() throws IOException {
+ // no-op
+ }
+
+ @Override
+ public void cleanup() throws IOException {
+ // no-op
+ }
+
+ private ExceptionManagerFacade lookup() {
+ final Options options = new Options(System.getProperties());
+ final Properties props = new Properties();
+ props.put(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName());
+ final int port = ServerLocal.getPort(-1);
+ if (port > 0) {
+ System.out.println("provider url = " + "http://localhost:" + port + "/tomee/ejb");
+ props.put(Context.PROVIDER_URL, options.get(Context.PROVIDER_URL, "http://localhost:" + port + "/tomee/ejb"));
+ } else {
+ throw new OpenEJBTCKRuntimeException("Please set the tomee port using the system property 'server.http.port'");
+ }
+
+ try {
+ final InitialContext context = new InitialContext(props);
+ return (ExceptionManagerFacade) context.lookup("openejb/ExceptionManagerFacadeBusinessRemote");
+ } catch (final Exception e) {
+ throw new OpenEJBTCKRuntimeException(e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tck/tck-common/src/main/java/org/apache/openejb/tck/util/ServerLocal.java
----------------------------------------------------------------------
diff --git a/tck/tck-common/src/main/java/org/apache/openejb/tck/util/ServerLocal.java b/tck/tck-common/src/main/java/org/apache/openejb/tck/util/ServerLocal.java
index 856c429..422b12b 100644
--- a/tck/tck-common/src/main/java/org/apache/openejb/tck/util/ServerLocal.java
+++ b/tck/tck-common/src/main/java/org/apache/openejb/tck/util/ServerLocal.java
@@ -1,50 +1,50 @@
-/*
- * 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.tck.util;
-
-import org.apache.tomee.util.QuickServerXmlParser;
-
-import java.io.File;
-
-public class ServerLocal {
-
- private ServerLocal() {
- }
-
- /**
- * If the TCK is running against a local server extracted to the target dir
- * then the server.xml will have the port defined already.
- *
- * @param def Default port to use if none is found
- * @return The determined port, the value of 'server.http.port' or the provided default
- */
- public static int getPort(final int def) {
- final String home = System.getProperty("openejb.home", "empty");
-
- if (!"empty".equals(home)) {
- final File serverXml = new File(home, "conf/server.xml");
-
- if (serverXml.exists() && serverXml.isFile()) {
- final QuickServerXmlParser parser = QuickServerXmlParser.parse(serverXml);
-
- return Integer.parseInt(parser.http());
- }
- }
-
- return Integer.getInteger("server.http.port", def);
- }
-}
+/*
+ * 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.tck.util;
+
+import org.apache.tomee.util.QuickServerXmlParser;
+
+import java.io.File;
+
+public class ServerLocal {
+
+ private ServerLocal() {
+ }
+
+ /**
+ * If the TCK is running against a local server extracted to the target dir
+ * then the server.xml will have the port defined already.
+ *
+ * @param def Default port to use if none is found
+ * @return The determined port, the value of 'server.http.port' or the provided default
+ */
+ public static int getPort(final int def) {
+ final String home = System.getProperty("openejb.home", "empty");
+
+ if (!"empty".equals(home)) {
+ final File serverXml = new File(home, "conf/server.xml");
+
+ if (serverXml.exists() && serverXml.isFile()) {
+ final QuickServerXmlParser parser = QuickServerXmlParser.parse(serverXml);
+
+ return Integer.parseInt(parser.http());
+ }
+ }
+
+ return Integer.getInteger("server.http.port", def);
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/apache-tomee/src/main/groovy/commands/SetupCommand.groovy
----------------------------------------------------------------------
diff --git a/tomee/apache-tomee/src/main/groovy/commands/SetupCommand.groovy b/tomee/apache-tomee/src/main/groovy/commands/SetupCommand.groovy
index 1350839..636e8dd 100644
--- a/tomee/apache-tomee/src/main/groovy/commands/SetupCommand.groovy
+++ b/tomee/apache-tomee/src/main/groovy/commands/SetupCommand.groovy
@@ -1,118 +1,118 @@
-/*
- * 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.tomee.installer.Installer
-import org.apache.tomee.installer.Paths
-import org.apache.tools.ant.taskdefs.optional.net.SetProxy
-
-class SetupCommand {
-
- def pom
- def log
- def project
- AntBuilder ant
- def properties
-
- def require(String name) {
- assert name != null
-
- def value = properties.getProperty(name)
- if (!value || value == 'null') value = project.properties.getProperty(name)
- if (!value || value == 'null') value = System.properties.getProperty(name)
- if (value == 'null') value = null
- log.debug("Require property $name = $value")
-
- if (!value) {
- throw new Exception("Missing required property: $name (resolved to null)" as String)
- }
- return value
- }
-
- def deleteWithRetry = {
- try {
- ant.delete(it)
- } catch (e) {
- log.warn("RETRY Deleting: ${it}")
- ant.delete(it)
- }
- }
-
- def execute() {
- String tomcatVersion = require('tomcat.version')
- System.setProperty('tomcat.version', tomcatVersion)
-
- String tomeeVersion = require('tomee.version')
- System.setProperty('tomee.version', tomeeVersion)
-
- String proxyHost = pom.settings.activeProxy?.host ?: ''
- String proxyPort = pom.settings.activeProxy?.port ?: ''
- if (proxyHost && proxyPort) {
- log.info("Setting proxy host=${proxyHost} and proxy port=${proxyPort}")
- new SetProxy(
- proxyHost: proxyHost,
- proxyPort: proxyPort as int,
- proxyUser: pom.settings.activeProxy.username ?: '',
- proxyPassword: pom.settings.activeProxy.password ?: '',
- nonProxyHosts: pom.settings.activeProxy.nonProxyHosts ?: ''
- ).execute()
- }
-
- def workDir = require('tomee.workdir')
- def webapp = require('tomee.webapp')
-
- def dest = "${workDir}/apache-tomcat-${tomcatVersion}.zip" as String
- def catalinaHome = "${workDir}/apache-tomcat-${tomcatVersion}" as String
- System.setProperty('catalina.home', catalinaHome)
- System.setProperty('catalina.base', catalinaHome)
-
- log.info("extracting ${catalinaHome}")
- ant.unzip(src: dest, dest: "${workDir}")
-
- log.info('Deploying the tomee war')
- def localRepo = pom.settings.localRepository
- ant.unzip(src: "${localRepo}/org/apache/tomee/${webapp}/${tomeeVersion}/${webapp}-${tomeeVersion}.war",
- dest: "${workDir}/apache-tomcat-${tomcatVersion}/webapps/tomee")
-
- log.info("Installing to: ${catalinaHome}")
-
-
- Paths paths = new Paths(new File("${catalinaHome}/webapps/tomee" as String))
- Installer installer = new Installer(paths, true)
- installer.installFull()
-
- // clean up duplicate jars since in TomEE it is useless
- // = gain of space ;)
- deleteWithRetry(file: paths.getJAXBImpl())
- deleteWithRetry(file: paths.getOpenEJBTomcatLoaderJar())
- deleteWithRetry(file: paths.findTomEELibJar('jaxb-impl'))
- deleteWithRetry(file: paths.findTomEELibJar("openejb-javaagent-${tomeeVersion}.jar" as String))
- // we need the one without version
-
- deleteWithRetry(file: paths.findOpenEJBWebJar('tomee-loader'))
- deleteWithRetry(file: paths.findOpenEJBWebJar('swizzle-stream'))
-
- log.info('Assigning execute privileges to scripts in Tomcat bin directory')
- ant.chmod(dir: "${workDir}/apache-tomcat-${tomcatVersion}/bin", perm: 'u+x', includes: '**/*.sh')
-
- deleteWithRetry(dir: "${workDir}/apache-tomcat-${tomcatVersion}/webapps/examples")
- deleteWithRetry(dir: "${workDir}/apache-tomcat-${tomcatVersion}/webapps/tomee")
- }
-}
-
+/*
+ * 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.tomee.installer.Installer
+import org.apache.tomee.installer.Paths
+import org.apache.tools.ant.taskdefs.optional.net.SetProxy
+
+class SetupCommand {
+
+ def pom
+ def log
+ def project
+ AntBuilder ant
+ def properties
+
+ def require(String name) {
+ assert name != null
+
+ def value = properties.getProperty(name)
+ if (!value || value == 'null') value = project.properties.getProperty(name)
+ if (!value || value == 'null') value = System.properties.getProperty(name)
+ if (value == 'null') value = null
+ log.debug("Require property $name = $value")
+
+ if (!value) {
+ throw new Exception("Missing required property: $name (resolved to null)" as String)
+ }
+ return value
+ }
+
+ def deleteWithRetry = {
+ try {
+ ant.delete(it)
+ } catch (e) {
+ log.warn("RETRY Deleting: ${it}")
+ ant.delete(it)
+ }
+ }
+
+ def execute() {
+ String tomcatVersion = require('tomcat.version')
+ System.setProperty('tomcat.version', tomcatVersion)
+
+ String tomeeVersion = require('tomee.version')
+ System.setProperty('tomee.version', tomeeVersion)
+
+ String proxyHost = pom.settings.activeProxy?.host ?: ''
+ String proxyPort = pom.settings.activeProxy?.port ?: ''
+ if (proxyHost && proxyPort) {
+ log.info("Setting proxy host=${proxyHost} and proxy port=${proxyPort}")
+ new SetProxy(
+ proxyHost: proxyHost,
+ proxyPort: proxyPort as int,
+ proxyUser: pom.settings.activeProxy.username ?: '',
+ proxyPassword: pom.settings.activeProxy.password ?: '',
+ nonProxyHosts: pom.settings.activeProxy.nonProxyHosts ?: ''
+ ).execute()
+ }
+
+ def workDir = require('tomee.workdir')
+ def webapp = require('tomee.webapp')
+
+ def dest = "${workDir}/apache-tomcat-${tomcatVersion}.zip" as String
+ def catalinaHome = "${workDir}/apache-tomcat-${tomcatVersion}" as String
+ System.setProperty('catalina.home', catalinaHome)
+ System.setProperty('catalina.base', catalinaHome)
+
+ log.info("extracting ${catalinaHome}")
+ ant.unzip(src: dest, dest: "${workDir}")
+
+ log.info('Deploying the tomee war')
+ def localRepo = pom.settings.localRepository
+ ant.unzip(src: "${localRepo}/org/apache/tomee/${webapp}/${tomeeVersion}/${webapp}-${tomeeVersion}.war",
+ dest: "${workDir}/apache-tomcat-${tomcatVersion}/webapps/tomee")
+
+ log.info("Installing to: ${catalinaHome}")
+
+
+ Paths paths = new Paths(new File("${catalinaHome}/webapps/tomee" as String))
+ Installer installer = new Installer(paths, true)
+ installer.installFull()
+
+ // clean up duplicate jars since in TomEE it is useless
+ // = gain of space ;)
+ deleteWithRetry(file: paths.getJAXBImpl())
+ deleteWithRetry(file: paths.getOpenEJBTomcatLoaderJar())
+ deleteWithRetry(file: paths.findTomEELibJar('jaxb-impl'))
+ deleteWithRetry(file: paths.findTomEELibJar("openejb-javaagent-${tomeeVersion}.jar" as String))
+ // we need the one without version
+
+ deleteWithRetry(file: paths.findOpenEJBWebJar('tomee-loader'))
+ deleteWithRetry(file: paths.findOpenEJBWebJar('swizzle-stream'))
+
+ log.info('Assigning execute privileges to scripts in Tomcat bin directory')
+ ant.chmod(dir: "${workDir}/apache-tomcat-${tomcatVersion}/bin", perm: 'u+x', includes: '**/*.sh')
+
+ deleteWithRetry(dir: "${workDir}/apache-tomcat-${tomcatVersion}/webapps/examples")
+ deleteWithRetry(dir: "${workDir}/apache-tomcat-${tomcatVersion}/webapps/tomee")
+ }
+}
+
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/apache-tomee/src/main/java/org/apache/tomee/RemoteTomEEEJBContainer.java
----------------------------------------------------------------------
diff --git a/tomee/apache-tomee/src/main/java/org/apache/tomee/RemoteTomEEEJBContainer.java b/tomee/apache-tomee/src/main/java/org/apache/tomee/RemoteTomEEEJBContainer.java
index b9e36de..4327d82 100644
--- a/tomee/apache-tomee/src/main/java/org/apache/tomee/RemoteTomEEEJBContainer.java
+++ b/tomee/apache-tomee/src/main/java/org/apache/tomee/RemoteTomEEEJBContainer.java
@@ -1,169 +1,169 @@
-/**
- * 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
- * <p/>
- * http://www.apache.org/licenses/LICENSE-2.0
- * <p/>
- * 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.tomee;
-
-import org.apache.geronimo.osgi.locator.ProviderLocator;
-import org.apache.openejb.OpenEJBException;
-import org.apache.openejb.assembler.Deployer;
-import org.apache.openejb.assembler.DeployerEjb;
-import org.apache.openejb.client.RemoteInitialContextFactory;
-import org.apache.openejb.config.RemoteServer;
-import org.apache.openejb.loader.IO;
-import org.apache.tomee.util.QuickServerXmlParser;
-
-import javax.ejb.EJBException;
-import javax.ejb.embeddable.EJBContainer;
-import javax.ejb.spi.EJBContainerProvider;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.validation.ValidationException;
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-public class RemoteTomEEEJBContainer extends EJBContainer {
- private static RemoteTomEEEJBContainer instance;
- private RemoteServer container;
- private InitialContext context;
-
- @Override
- public void close() {
- instance.container.destroy();
- instance.container = null;
- }
-
- @Override
- public Context getContext() {
- return context;
- }
-
- public static class Provider implements EJBContainerProvider {
- private static final List<String> CONTAINER_NAMES = Arrays.asList(RemoteTomEEEJBContainer.class.getName(), "tomee-remote", "remote-tomee");
-
- @Override
- public EJBContainer createEJBContainer(final Map<?, ?> properties) {
- final Object provider = properties.get(EJBContainer.PROVIDER);
- int ejbContainerProviders = 1;
- try {
- ejbContainerProviders = ProviderLocator.getServices(EJBContainerProvider.class.getName(), EJBContainer.class, Thread.currentThread().getContextClassLoader()).size();
- } catch (final Exception e) {
- // no-op
- }
-
- if ((provider == null && ejbContainerProviders > 1)
- || (!RemoteTomEEEJBContainer.class.equals(provider)
- && !CONTAINER_NAMES.contains(String.valueOf(provider)))) {
- return null;
- }
-
- if (instance != null) {
- return instance;
- }
-
- final Object modules = properties.get(EJBContainer.MODULES);
-
- System.getProperties().putAll(properties);
- final File home = new File(System.getProperty("openejb.home", "doesn't exist"));
- if (!home.exists()) {
- throw new IllegalArgumentException("You need to set openejb.home");
- }
-
- final QuickServerXmlParser parser = QuickServerXmlParser.parse(new File(home, "conf/server.xml"));
- final String remoteEjb = System.getProperty(Context.PROVIDER_URL, "http://" + parser.host() + ":" + parser.http() + "/tomee/ejb");
- System.setProperty(RemoteServer.SERVER_SHUTDOWN_PORT, parser.stop());
-
- try {
- instance = new RemoteTomEEEJBContainer();
- instance.container = new RemoteServer();
- instance.container.setPortStartup(Integer.parseInt(parser.http()));
-
- try {
- instance.container.start(Arrays.asList("-Dopenejb.system.apps=true", "-Dtomee.remote.support=true"), "start", true);
- } catch (final Exception e) {
- instance.container.destroy();
- throw e;
- }
-
- instance.context = new InitialContext(new Properties() {{
- setProperty(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName());
- setProperty(Context.PROVIDER_URL, remoteEjb);
- }});
-
- Deployer deployer = null;
- for (int i = 0; i < (properties.containsKey("retries") ? Integer.parseInt(String.class.cast(properties.get("retries"))) : 20); i++) {
- deployer = Deployer.class.cast(instance.context.lookup("openejb/DeployerBusinessRemote"));
- if (deployer != null) {
- break;
- }
- }
- if (deployer == null) {
- throw new TomEERemoteEJBContainerException("Can't lookup deployer, eother increse retries or setup it correctly", new IllegalStateException());
- }
-
- if (modules instanceof File) {
- final File file = File.class.cast(modules);
- deployFile(deployer, file);
- } else if (modules instanceof String) {
- final String path = String.class.cast(modules);
- final File file = new File(path);
- deployFile(deployer, file);
- } else if (modules instanceof String[]) {
- for (final String path : (String[]) modules) {
- deployFile(deployer, new File(path));
- }
- } else if (modules instanceof File[]) {
- for (final File file : (File[]) modules) {
- deployFile(deployer, file);
- }
- } // else suppose already deployed
-
- return instance;
- } catch (final OpenEJBException | MalformedURLException e) {
- throw new EJBException(e);
- } catch (final ValidationException ve) {
- throw ve;
- } catch (final Exception e) {
- if (e instanceof EJBException) {
- throw (EJBException) e;
- }
- throw new TomEERemoteEJBContainerException("initialization exception", e);
- }
- }
- }
-
- private static void deployFile(final Deployer deployer, final File file) throws IOException, OpenEJBException {
- if ("true".equalsIgnoreCase(System.getProperty(DeployerEjb.OPENEJB_USE_BINARIES, "false"))) {
- final Properties props = new Properties();
- final byte[] slurpBinaries = IO.slurp(file).getBytes();
- props.put(DeployerEjb.OPENEJB_VALUE_BINARIES, slurpBinaries);
- props.put(DeployerEjb.OPENEJB_PATH_BINARIES, file.getName());
- deployer.deploy(file.getAbsolutePath(), props);
- } else {
- deployer.deploy(file.getAbsolutePath());
- }
- }
-
- protected static class TomEERemoteEJBContainerException extends RuntimeException {
- protected TomEERemoteEJBContainerException(final String s, final Exception e) {
- super(s, e);
- }
- }
-}
+/**
+ * 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
+ * <p/>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p/>
+ * 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.tomee;
+
+import org.apache.geronimo.osgi.locator.ProviderLocator;
+import org.apache.openejb.OpenEJBException;
+import org.apache.openejb.assembler.Deployer;
+import org.apache.openejb.assembler.DeployerEjb;
+import org.apache.openejb.client.RemoteInitialContextFactory;
+import org.apache.openejb.config.RemoteServer;
+import org.apache.openejb.loader.IO;
+import org.apache.tomee.util.QuickServerXmlParser;
+
+import javax.ejb.EJBException;
+import javax.ejb.embeddable.EJBContainer;
+import javax.ejb.spi.EJBContainerProvider;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.validation.ValidationException;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+
+public class RemoteTomEEEJBContainer extends EJBContainer {
+ private static RemoteTomEEEJBContainer instance;
+ private RemoteServer container;
+ private InitialContext context;
+
+ @Override
+ public void close() {
+ instance.container.destroy();
+ instance.container = null;
+ }
+
+ @Override
+ public Context getContext() {
+ return context;
+ }
+
+ public static class Provider implements EJBContainerProvider {
+ private static final List<String> CONTAINER_NAMES = Arrays.asList(RemoteTomEEEJBContainer.class.getName(), "tomee-remote", "remote-tomee");
+
+ @Override
+ public EJBContainer createEJBContainer(final Map<?, ?> properties) {
+ final Object provider = properties.get(EJBContainer.PROVIDER);
+ int ejbContainerProviders = 1;
+ try {
+ ejbContainerProviders = ProviderLocator.getServices(EJBContainerProvider.class.getName(), EJBContainer.class, Thread.currentThread().getContextClassLoader()).size();
+ } catch (final Exception e) {
+ // no-op
+ }
+
+ if ((provider == null && ejbContainerProviders > 1)
+ || (!RemoteTomEEEJBContainer.class.equals(provider)
+ && !CONTAINER_NAMES.contains(String.valueOf(provider)))) {
+ return null;
+ }
+
+ if (instance != null) {
+ return instance;
+ }
+
+ final Object modules = properties.get(EJBContainer.MODULES);
+
+ System.getProperties().putAll(properties);
+ final File home = new File(System.getProperty("openejb.home", "doesn't exist"));
+ if (!home.exists()) {
+ throw new IllegalArgumentException("You need to set openejb.home");
+ }
+
+ final QuickServerXmlParser parser = QuickServerXmlParser.parse(new File(home, "conf/server.xml"));
+ final String remoteEjb = System.getProperty(Context.PROVIDER_URL, "http://" + parser.host() + ":" + parser.http() + "/tomee/ejb");
+ System.setProperty(RemoteServer.SERVER_SHUTDOWN_PORT, parser.stop());
+
+ try {
+ instance = new RemoteTomEEEJBContainer();
+ instance.container = new RemoteServer();
+ instance.container.setPortStartup(Integer.parseInt(parser.http()));
+
+ try {
+ instance.container.start(Arrays.asList("-Dopenejb.system.apps=true", "-Dtomee.remote.support=true"), "start", true);
+ } catch (final Exception e) {
+ instance.container.destroy();
+ throw e;
+ }
+
+ instance.context = new InitialContext(new Properties() {{
+ setProperty(Context.INITIAL_CONTEXT_FACTORY, RemoteInitialContextFactory.class.getName());
+ setProperty(Context.PROVIDER_URL, remoteEjb);
+ }});
+
+ Deployer deployer = null;
+ for (int i = 0; i < (properties.containsKey("retries") ? Integer.parseInt(String.class.cast(properties.get("retries"))) : 20); i++) {
+ deployer = Deployer.class.cast(instance.context.lookup("openejb/DeployerBusinessRemote"));
+ if (deployer != null) {
+ break;
+ }
+ }
+ if (deployer == null) {
+ throw new TomEERemoteEJBContainerException("Can't lookup deployer, eother increse retries or setup it correctly", new IllegalStateException());
+ }
+
+ if (modules instanceof File) {
+ final File file = File.class.cast(modules);
+ deployFile(deployer, file);
+ } else if (modules instanceof String) {
+ final String path = String.class.cast(modules);
+ final File file = new File(path);
+ deployFile(deployer, file);
+ } else if (modules instanceof String[]) {
+ for (final String path : (String[]) modules) {
+ deployFile(deployer, new File(path));
+ }
+ } else if (modules instanceof File[]) {
+ for (final File file : (File[]) modules) {
+ deployFile(deployer, file);
+ }
+ } // else suppose already deployed
+
+ return instance;
+ } catch (final OpenEJBException | MalformedURLException e) {
+ throw new EJBException(e);
+ } catch (final ValidationException ve) {
+ throw ve;
+ } catch (final Exception e) {
+ if (e instanceof EJBException) {
+ throw (EJBException) e;
+ }
+ throw new TomEERemoteEJBContainerException("initialization exception", e);
+ }
+ }
+ }
+
+ private static void deployFile(final Deployer deployer, final File file) throws IOException, OpenEJBException {
+ if ("true".equalsIgnoreCase(System.getProperty(DeployerEjb.OPENEJB_USE_BINARIES, "false"))) {
+ final Properties props = new Properties();
+ final byte[] slurpBinaries = IO.slurp(file).getBytes();
+ props.put(DeployerEjb.OPENEJB_VALUE_BINARIES, slurpBinaries);
+ props.put(DeployerEjb.OPENEJB_PATH_BINARIES, file.getName());
+ deployer.deploy(file.getAbsolutePath(), props);
+ } else {
+ deployer.deploy(file.getAbsolutePath());
+ }
+ }
+
+ protected static class TomEERemoteEJBContainerException extends RuntimeException {
+ protected TomEERemoteEJBContainerException(final String s, final Exception e) {
+ super(s, e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/apache-tomee/src/main/resources/service.bat
----------------------------------------------------------------------
diff --git a/tomee/apache-tomee/src/main/resources/service.bat b/tomee/apache-tomee/src/main/resources/service.bat
index 5d2efbd..900526b 100644
--- a/tomee/apache-tomee/src/main/resources/service.bat
+++ b/tomee/apache-tomee/src/main/resources/service.bat
@@ -1,226 +1,226 @@
-@echo off
-rem Licensed to the Apache Software Foundation (ASF) under one or more
-rem contributor license agreements. See the NOTICE file distributed with
-rem this work for additional information regarding copyright ownership.
-rem The ASF licenses this file to You under the Apache License, Version 2.0
-rem (the "License"); you may not use this file except in compliance with
-rem the License. You may obtain a copy of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-rem The following line can be used to define a specific jre or jdk path
-rem set "JAVA_HOME=C:/JDK"
-
-REM Prefer a local JRE if we find one in the current bin directory
-IF EXIST "%~dp0jre" (
- SET "JRE_HOME=%~dp0jre"
-)
-
-REM Prefer a local JDK if we find one in the current bin directory
-IF EXIST "%~dp0jdk" (
- SET "JAVA_HOME=%~dp0jdk"
-)
-
-@IF DEFINED ECHO ECHO %ECHO%
-@IF "%OS%" == "Windows_NT" setlocal
-
-IF "%OS%" == "Windows_NT" (
- SET "DIRNAME=%~dp0%"
-) ELSE (
- SET DIRNAME=.\
-)
-
-pushd %DIRNAME%
-
-rem ---------------------------------------------------------------------------
-rem NT Service Install/Uninstall script
-rem
-rem Options
-rem install Install the service using TomEE as service name.
-rem Service is installed using default settings.
-rem remove Remove the service from the System.
-rem
-rem name (optional) If the second argument is present it is considered
-rem to be new service name
-rem
-rem $Id: service.bat 1000718 2010-09-24 06:00:00Z mturk $
-rem ---------------------------------------------------------------------------
-
-SET proc=undefined
-
-IF /i %PROCESSOR_ARCHITECTURE% EQU X86 SET "proc=%~dp0TomEE.x86.exe"
-IF /i %PROCESSOR_ARCHITECTURE% EQU AMD64 SET "proc=%~dp0TomEE.amd64.exe"
-IF /i %PROCESSOR_ARCHITECTURE% EQU IA64 SET "proc=%~dp0TomEE.ia64.exe"
-
-IF /i "%proc%" EQU undefined (
- ECHO Failed to determine OS architecture
- GOTO end
-)
-
-set "SELF=%~dp0%service.bat"
-rem Guess CATALINA_HOME if not defined
-set "CURRENT_DIR=%cd%"
-if DEFINED CATALINA_HOME goto gotHome
-set "CATALINA_HOME=%cd%"
-if exist "%CATALINA_HOME%\bin\service.bat" goto okHome
-rem CD to the upper dir
-cd ..
-set "CATALINA_HOME=%cd%"
-:gotHome
-if exist "%CATALINA_HOME%\bin\service.bat" goto okHome
-echo The service exe was not found...
-echo The CATALINA_HOME environment variable is not defined correctly.
-echo This environment variable is needed to run this program
-goto end
-:okHome
-rem Make sure prerequisite environment variables are set
-if DEFINED JAVA_HOME goto gotJdkHome
-if DEFINED JRE_HOME goto gotJreHome
-echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
-echo Service will try to guess them from the registry.
-goto okJavaHome
-:gotJreHome
-if not exist "%JRE_HOME%\bin\java.exe" goto noJavaHome
-if not exist "%JRE_HOME%\bin\javaw.exe" goto noJavaHome
-goto okJavaHome
-:gotJdkHome
-if not exist "%JAVA_HOME%\jre\bin\java.exe" goto noJavaHome
-if not exist "%JAVA_HOME%\jre\bin\javaw.exe" goto noJavaHome
-if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
-if not "%JRE_HOME%" == "" goto okJavaHome
-set "JRE_HOME=%JAVA_HOME%\jre"
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-echo NB: JAVA_HOME should point to a JDK not a JRE
-goto end
-:okJavaHome
-if DEFINED CATALINA_BASE goto gotBase
-set "CATALINA_BASE=%CATALINA_HOME%"
-:gotBase
-
-set "EXECUTABLE=%proc%"
-
-rem Set default Service name (If you change this then rename also TomEE.exe to the same name)
-set SERVICE_NAME=TomEE
-set PR_DISPLAYNAME=Apache TomEE
-
-if "x%1x" == "xx" goto displayUsage
-set SERVICE_CMD=%1
-shift
-if "x%1x" == "xx" goto checkServiceCmd
-:checkUser
-if "x%1x" == "x/userx" goto runAsUser
-if "x%1x" == "x--userx" goto runAsUser
-set SERVICE_NAME=%1
-set PR_DISPLAYNAME=Apache TomEE (%1)
-shift
-if "x%1x" == "xx" goto checkServiceCmd
-goto checkUser
-:runAsUser
-shift
-if "x%1x" == "xx" goto displayUsage
-set SERVICE_USER=%1
-shift
-runas /env /savecred /user:%SERVICE_USER% "%COMSPEC% /K \"%SELF%\" %SERVICE_CMD% %SERVICE_NAME%"
-goto end
-:checkServiceCmd
-if /i %SERVICE_CMD% == install goto doInstall
-if /i %SERVICE_CMD% == remove goto doRemove
-if /i %SERVICE_CMD% == uninstall goto doRemove
-echo Unknown parameter "%1"
-:displayUsage
-echo.
-echo Usage: service.bat install/remove [service_name] [/user username]
-goto end
-
-:doRemove
-rem Remove the service
-"%EXECUTABLE%" //DS//%SERVICE_NAME%
-if not errorlevel 1 goto removed
-echo Failed removing '%SERVICE_NAME%' service
-goto end
-:removed
-echo The service '%SERVICE_NAME%' has been removed
-goto end
-
-:doInstall
-rem Install the service
-echo Installing the service '%SERVICE_NAME%' ...
-echo Using CATALINA_HOME: "%CATALINA_HOME%"
-echo Using CATALINA_BASE: "%CATALINA_BASE%"
-echo Using JAVA_HOME: "%JAVA_HOME%"
-echo Using JRE_HOME: "%JRE_HOME%"
-
-rem Use the environment variables as an example
-rem Each command line option is prefixed with PR_
-
-set "PR_DESCRIPTION=Apache TomEE - http://tomee.apache.org/"
-set "PR_INSTALL=%EXECUTABLE%"
-set "PR_LOGPATH=%CATALINA_BASE%\logs"
-set "PR_CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_BASE%\bin\tomcat-juli.jar;%CATALINA_HOME%\bin\tomcat-juli.jar"
-rem Set the server jvm from JAVA_HOME
-set "PR_JVM=%JRE_HOME%\bin\server\jvm.dll"
-if exist "%PR_JVM%" goto foundJvm
-rem Set the client jvm from JAVA_HOME
-set "PR_JVM=%JRE_HOME%\bin\client\jvm.dll"
-if exist "%PR_JVM%" goto foundJvm
-set PR_JVM=auto
-:foundJvm
-echo Using JVM: "%PR_JVM%"
-
-"%EXECUTABLE%" //IS//%SERVICE_NAME% ^
- --DisplayName=%SERVICE_NAME% ^
- --StartClass org.apache.catalina.startup.Bootstrap ^
- --StopClass org.apache.catalina.startup.Bootstrap ^
- --StartParams start ^
- --StopParams stop ^
- --Startup auto ^
- --JvmMs=512 ^
- --JvmMx=1024 ^
- --JvmSs=2048 ^
- --StartMode jvm ^
- --StopMode jvm ^
- --LogLevel Info ^
- --LogPrefix TomEE
-
-echo Installed, will now configure TomEE
-
-if not errorlevel 1 goto installed
-echo Failed installing '%SERVICE_NAME%' service
-goto end
-
-:installed
-rem Clear the environment variables. They are not needed any more.
-set PR_DISPLAYNAME=
-set PR_DESCRIPTION=
-set PR_INSTALL=
-set PR_LOGPATH=
-set PR_CLASSPATH=
-set PR_JVM=
-
-rem Set extra parameters
-"%EXECUTABLE%" //US//%SERVICE_NAME% ^
- ++JvmOptions "-javaagent:%CATALINA_HOME%\lib\openejb-javaagent.jar;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed"
-
-rem More extra parameters
-set "PR_LOGPATH=%CATALINA_BASE%\logs"
-set PR_STDOUTPUT=auto
-set PR_STDERROR=auto
-
-rem before this option was added: "++JvmOptions=-Djava.library.path="%CATALINA_BASE%\bin" ^"
-rem the drawback was it was preventing custom native lib to be loaded even if added to Path
-"%EXECUTABLE%" //US//%SERVICE_NAME% ^
- ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;-Djava.awt.headless=true;-XX:+UseParallelGC;-XX:MaxPermSize=256M"
-
-echo The service '%SERVICE_NAME%' has been installed.
-
-:end
-cd "%CURRENT_DIR%"
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements. See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+rem The following line can be used to define a specific jre or jdk path
+rem set "JAVA_HOME=C:/JDK"
+
+REM Prefer a local JRE if we find one in the current bin directory
+IF EXIST "%~dp0jre" (
+ SET "JRE_HOME=%~dp0jre"
+)
+
+REM Prefer a local JDK if we find one in the current bin directory
+IF EXIST "%~dp0jdk" (
+ SET "JAVA_HOME=%~dp0jdk"
+)
+
+@IF DEFINED ECHO ECHO %ECHO%
+@IF "%OS%" == "Windows_NT" setlocal
+
+IF "%OS%" == "Windows_NT" (
+ SET "DIRNAME=%~dp0%"
+) ELSE (
+ SET DIRNAME=.\
+)
+
+pushd %DIRNAME%
+
+rem ---------------------------------------------------------------------------
+rem NT Service Install/Uninstall script
+rem
+rem Options
+rem install Install the service using TomEE as service name.
+rem Service is installed using default settings.
+rem remove Remove the service from the System.
+rem
+rem name (optional) If the second argument is present it is considered
+rem to be new service name
+rem
+rem $Id: service.bat 1000718 2010-09-24 06:00:00Z mturk $
+rem ---------------------------------------------------------------------------
+
+SET proc=undefined
+
+IF /i %PROCESSOR_ARCHITECTURE% EQU X86 SET "proc=%~dp0TomEE.x86.exe"
+IF /i %PROCESSOR_ARCHITECTURE% EQU AMD64 SET "proc=%~dp0TomEE.amd64.exe"
+IF /i %PROCESSOR_ARCHITECTURE% EQU IA64 SET "proc=%~dp0TomEE.ia64.exe"
+
+IF /i "%proc%" EQU undefined (
+ ECHO Failed to determine OS architecture
+ GOTO end
+)
+
+set "SELF=%~dp0%service.bat"
+rem Guess CATALINA_HOME if not defined
+set "CURRENT_DIR=%cd%"
+if DEFINED CATALINA_HOME goto gotHome
+set "CATALINA_HOME=%cd%"
+if exist "%CATALINA_HOME%\bin\service.bat" goto okHome
+rem CD to the upper dir
+cd ..
+set "CATALINA_HOME=%cd%"
+:gotHome
+if exist "%CATALINA_HOME%\bin\service.bat" goto okHome
+echo The service exe was not found...
+echo The CATALINA_HOME environment variable is not defined correctly.
+echo This environment variable is needed to run this program
+goto end
+:okHome
+rem Make sure prerequisite environment variables are set
+if DEFINED JAVA_HOME goto gotJdkHome
+if DEFINED JRE_HOME goto gotJreHome
+echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
+echo Service will try to guess them from the registry.
+goto okJavaHome
+:gotJreHome
+if not exist "%JRE_HOME%\bin\java.exe" goto noJavaHome
+if not exist "%JRE_HOME%\bin\javaw.exe" goto noJavaHome
+goto okJavaHome
+:gotJdkHome
+if not exist "%JAVA_HOME%\jre\bin\java.exe" goto noJavaHome
+if not exist "%JAVA_HOME%\jre\bin\javaw.exe" goto noJavaHome
+if not exist "%JAVA_HOME%\bin\javac.exe" goto noJavaHome
+if not "%JRE_HOME%" == "" goto okJavaHome
+set "JRE_HOME=%JAVA_HOME%\jre"
+goto okJavaHome
+:noJavaHome
+echo The JAVA_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+echo NB: JAVA_HOME should point to a JDK not a JRE
+goto end
+:okJavaHome
+if DEFINED CATALINA_BASE goto gotBase
+set "CATALINA_BASE=%CATALINA_HOME%"
+:gotBase
+
+set "EXECUTABLE=%proc%"
+
+rem Set default Service name (If you change this then rename also TomEE.exe to the same name)
+set SERVICE_NAME=TomEE
+set PR_DISPLAYNAME=Apache TomEE
+
+if "x%1x" == "xx" goto displayUsage
+set SERVICE_CMD=%1
+shift
+if "x%1x" == "xx" goto checkServiceCmd
+:checkUser
+if "x%1x" == "x/userx" goto runAsUser
+if "x%1x" == "x--userx" goto runAsUser
+set SERVICE_NAME=%1
+set PR_DISPLAYNAME=Apache TomEE (%1)
+shift
+if "x%1x" == "xx" goto checkServiceCmd
+goto checkUser
+:runAsUser
+shift
+if "x%1x" == "xx" goto displayUsage
+set SERVICE_USER=%1
+shift
+runas /env /savecred /user:%SERVICE_USER% "%COMSPEC% /K \"%SELF%\" %SERVICE_CMD% %SERVICE_NAME%"
+goto end
+:checkServiceCmd
+if /i %SERVICE_CMD% == install goto doInstall
+if /i %SERVICE_CMD% == remove goto doRemove
+if /i %SERVICE_CMD% == uninstall goto doRemove
+echo Unknown parameter "%1"
+:displayUsage
+echo.
+echo Usage: service.bat install/remove [service_name] [/user username]
+goto end
+
+:doRemove
+rem Remove the service
+"%EXECUTABLE%" //DS//%SERVICE_NAME%
+if not errorlevel 1 goto removed
+echo Failed removing '%SERVICE_NAME%' service
+goto end
+:removed
+echo The service '%SERVICE_NAME%' has been removed
+goto end
+
+:doInstall
+rem Install the service
+echo Installing the service '%SERVICE_NAME%' ...
+echo Using CATALINA_HOME: "%CATALINA_HOME%"
+echo Using CATALINA_BASE: "%CATALINA_BASE%"
+echo Using JAVA_HOME: "%JAVA_HOME%"
+echo Using JRE_HOME: "%JRE_HOME%"
+
+rem Use the environment variables as an example
+rem Each command line option is prefixed with PR_
+
+set "PR_DESCRIPTION=Apache TomEE - http://tomee.apache.org/"
+set "PR_INSTALL=%EXECUTABLE%"
+set "PR_LOGPATH=%CATALINA_BASE%\logs"
+set "PR_CLASSPATH=%CATALINA_HOME%\bin\bootstrap.jar;%CATALINA_BASE%\bin\tomcat-juli.jar;%CATALINA_HOME%\bin\tomcat-juli.jar"
+rem Set the server jvm from JAVA_HOME
+set "PR_JVM=%JRE_HOME%\bin\server\jvm.dll"
+if exist "%PR_JVM%" goto foundJvm
+rem Set the client jvm from JAVA_HOME
+set "PR_JVM=%JRE_HOME%\bin\client\jvm.dll"
+if exist "%PR_JVM%" goto foundJvm
+set PR_JVM=auto
+:foundJvm
+echo Using JVM: "%PR_JVM%"
+
+"%EXECUTABLE%" //IS//%SERVICE_NAME% ^
+ --DisplayName=%SERVICE_NAME% ^
+ --StartClass org.apache.catalina.startup.Bootstrap ^
+ --StopClass org.apache.catalina.startup.Bootstrap ^
+ --StartParams start ^
+ --StopParams stop ^
+ --Startup auto ^
+ --JvmMs=512 ^
+ --JvmMx=1024 ^
+ --JvmSs=2048 ^
+ --StartMode jvm ^
+ --StopMode jvm ^
+ --LogLevel Info ^
+ --LogPrefix TomEE
+
+echo Installed, will now configure TomEE
+
+if not errorlevel 1 goto installed
+echo Failed installing '%SERVICE_NAME%' service
+goto end
+
+:installed
+rem Clear the environment variables. They are not needed any more.
+set PR_DISPLAYNAME=
+set PR_DESCRIPTION=
+set PR_INSTALL=
+set PR_LOGPATH=
+set PR_CLASSPATH=
+set PR_JVM=
+
+rem Set extra parameters
+"%EXECUTABLE%" //US//%SERVICE_NAME% ^
+ ++JvmOptions "-javaagent:%CATALINA_HOME%\lib\openejb-javaagent.jar;-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed"
+
+rem More extra parameters
+set "PR_LOGPATH=%CATALINA_BASE%\logs"
+set PR_STDOUTPUT=auto
+set PR_STDERROR=auto
+
+rem before this option was added: "++JvmOptions=-Djava.library.path="%CATALINA_BASE%\bin" ^"
+rem the drawback was it was preventing custom native lib to be loaded even if added to Path
+"%EXECUTABLE%" //US//%SERVICE_NAME% ^
+ ++JvmOptions "-Djava.io.tmpdir=%CATALINA_BASE%\temp;-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager;-Djava.util.logging.config.file=%CATALINA_BASE%\conf\logging.properties;-Djava.awt.headless=true;-XX:+UseParallelGC;-XX:MaxPermSize=256M"
+
+echo The service '%SERVICE_NAME%' has been installed.
+
+:end
+cd "%CURRENT_DIR%"
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/apache-tomee/src/main/resources/service.install.as.admin.bat
----------------------------------------------------------------------
diff --git a/tomee/apache-tomee/src/main/resources/service.install.as.admin.bat b/tomee/apache-tomee/src/main/resources/service.install.as.admin.bat
index 8569a4d..dcfbe6b 100644
--- a/tomee/apache-tomee/src/main/resources/service.install.as.admin.bat
+++ b/tomee/apache-tomee/src/main/resources/service.install.as.admin.bat
@@ -1,33 +1,33 @@
-@echo off
-cls
-REM================================================
-REM Licensed to the Apache Software Foundation (ASF) under one or more
-REM contributor license agreements. See the NOTICE file distributed with
-REM this work for additional information regarding copyright ownership.
-REM The ASF licenses this file to You under the Apache License, Version 2.0
-REM (the "License"); you may not use this file except in compliance with
-REM the License. You may obtain a copy of the License at
-REM
-REM http://www.apache.org/licenses/LICENSE-2.0
-REM
-REM Unless required by applicable law or agreed to in writing, software
-REM distributed under the License is distributed on an "AS IS" BASIS,
-REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-REM See the License for the specific language governing permissions and
-REM limitations under the License.
-REM _______________________________________________
-REM $Rev$
-REM================================================
-
-@if not "%ECHO%" == "" echo %ECHO%
-@if "%OS%" == "Windows_NT" setlocal
-
-if "%OS%" == "Windows_NT" (
- set "DIRNAME=%~dp0%"
-) else (
- set DIRNAME=.\
-)
-
-pushd %DIRNAME%
-
+@echo off
+cls
+REM================================================
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements. See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License. You may obtain a copy of the License at
+REM
+REM http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+REM _______________________________________________
+REM $Rev$
+REM================================================
+
+@if not "%ECHO%" == "" echo %ECHO%
+@if "%OS%" == "Windows_NT" setlocal
+
+if "%OS%" == "Windows_NT" (
+ set "DIRNAME=%~dp0%"
+) else (
+ set DIRNAME=.\
+)
+
+pushd %DIRNAME%
+
service install
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/apache-tomee/src/main/resources/service.remove.as.admin.bat
----------------------------------------------------------------------
diff --git a/tomee/apache-tomee/src/main/resources/service.remove.as.admin.bat b/tomee/apache-tomee/src/main/resources/service.remove.as.admin.bat
index 3b5d4ac..bc5fe0a 100644
--- a/tomee/apache-tomee/src/main/resources/service.remove.as.admin.bat
+++ b/tomee/apache-tomee/src/main/resources/service.remove.as.admin.bat
@@ -1,33 +1,33 @@
-@echo off
-cls
-REM================================================
-REM Licensed to the Apache Software Foundation (ASF) under one or more
-REM contributor license agreements. See the NOTICE file distributed with
-REM this work for additional information regarding copyright ownership.
-REM The ASF licenses this file to You under the Apache License, Version 2.0
-REM (the "License"); you may not use this file except in compliance with
-REM the License. You may obtain a copy of the License at
-REM
-REM http://www.apache.org/licenses/LICENSE-2.0
-REM
-REM Unless required by applicable law or agreed to in writing, software
-REM distributed under the License is distributed on an "AS IS" BASIS,
-REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-REM See the License for the specific language governing permissions and
-REM limitations under the License.
-REM _______________________________________________
-REM $Rev$
-REM================================================
-
-@if not "%ECHO%" == "" echo %ECHO%
-@if "%OS%" == "Windows_NT" setlocal
-
-if "%OS%" == "Windows_NT" (
- set "DIRNAME=%~dp0%"
-) else (
- set DIRNAME=.\
-)
-
-pushd %DIRNAME%
-
+@echo off
+cls
+REM================================================
+REM Licensed to the Apache Software Foundation (ASF) under one or more
+REM contributor license agreements. See the NOTICE file distributed with
+REM this work for additional information regarding copyright ownership.
+REM The ASF licenses this file to You under the Apache License, Version 2.0
+REM (the "License"); you may not use this file except in compliance with
+REM the License. You may obtain a copy of the License at
+REM
+REM http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing, software
+REM distributed under the License is distributed on an "AS IS" BASIS,
+REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+REM See the License for the specific language governing permissions and
+REM limitations under the License.
+REM _______________________________________________
+REM $Rev$
+REM================================================
+
+@if not "%ECHO%" == "" echo %ECHO%
+@if "%OS%" == "Windows_NT" setlocal
+
+if "%OS%" == "Windows_NT" (
+ set "DIRNAME=%~dp0%"
+) else (
+ set DIRNAME=.\
+)
+
+pushd %DIRNAME%
+
service remove
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/apache-tomee/src/main/resources/tomee.bat
----------------------------------------------------------------------
diff --git a/tomee/apache-tomee/src/main/resources/tomee.bat b/tomee/apache-tomee/src/main/resources/tomee.bat
index ab1bc04..c3a3a5a 100644
--- a/tomee/apache-tomee/src/main/resources/tomee.bat
+++ b/tomee/apache-tomee/src/main/resources/tomee.bat
@@ -1,90 +1,90 @@
-@echo off
-rem Licensed to the Apache Software Foundation (ASF) under one or more
-rem contributor license agreements. See the NOTICE file distributed with
-rem this work for additional information regarding copyright ownership.
-rem The ASF licenses this file to You under the Apache License, Version 2.0
-rem (the "License"); you may not use this file except in compliance with
-rem the License. You may obtain a copy of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing, software
-rem distributed under the License is distributed on an "AS IS" BASIS,
-rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-rem See the License for the specific language governing permissions and
-rem limitations under the License.
-
-if "%OS%" == "Windows_NT" setlocal
-
-set port=8080
-
-rem Guess CATALINA_HOME if not defined
-set "CURRENT_DIR=%cd%"
-if DEFINED CATALINA_HOME goto gotHome
-set "CATALINA_HOME=%CURRENT_DIR%"
-if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
-cd ..
-set "CATALINA_HOME=%cd%"
-cd "%CURRENT_DIR%"
-:gotHome
-
-if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
-echo The CATALINA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-:okHome
-
-rem Copy CATALINA_BASE from CATALINA_HOME if not defined
-if DEFINED CATALINA_BASE goto gotBase
-set "CATALINA_BASE=%CATALINA_HOME%"
-:gotBase
-
-rem Ensure that any user defined CLASSPATH variables are not used on startup,
-rem but allow them to be specified in setenv.bat, in rare case when it is needed.
-set CLASSPATH=
-
-rem Get standard Java environment variables
-if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
-echo Cannot find "%CATALINA_HOME%\bin\setclasspath.bat"
-echo This file is needed to run this program
-goto end
-:okSetclasspath
-call "%CATALINA_HOME%\bin\setclasspath.bat" %1
-if errorlevel 1 goto end
-
-if DEFINED CATALINA_TMPDIR goto gotTmpdir
-set "CATALINA_TMPDIR=%CATALINA_BASE%\temp"
-:gotTmpdir
-
-
-rem create classpath
-setlocal enabledelayedexpansion
-
-set "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\tomcat-juli.jar"
-set lib="%CATALINA_HOME%\lib\"
-echo %lib%
-for %%F in (%lib%/*.jar) do (
- set CLASSPATH=!CLASSPATH!;%%F%
-)
-
-if ""%1"" == ""deploy"" goto doDeploy
-if ""%1"" == ""undeploy"" goto doUndeploy
-if ""%1"" == ""start"" goto unsupportedCmd
-if ""%1"" == ""stop"" goto unsupportedCmd
-goto doExec
-
-:doDeploy
-:doUndeploy
-"%_RUNJAVA%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" org.apache.openejb.cli.Bootstrap %1 -s http://localhost:%port%/tomee/ejb %2
-goto end
-
-:unsupportedCmd
-echo start/stop commands are not compatible with tomee.bat, please use catalina.bar/startup.bat/shutdown.bat
-goto end
-
-:doExec
-"%_RUNJAVA%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" org.apache.openejb.cli.Bootstrap %*
-goto end
-
-:end
-
+@echo off
+rem Licensed to the Apache Software Foundation (ASF) under one or more
+rem contributor license agreements. See the NOTICE file distributed with
+rem this work for additional information regarding copyright ownership.
+rem The ASF licenses this file to You under the Apache License, Version 2.0
+rem (the "License"); you may not use this file except in compliance with
+rem the License. You may obtain a copy of the License at
+rem
+rem http://www.apache.org/licenses/LICENSE-2.0
+rem
+rem Unless required by applicable law or agreed to in writing, software
+rem distributed under the License is distributed on an "AS IS" BASIS,
+rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+rem See the License for the specific language governing permissions and
+rem limitations under the License.
+
+if "%OS%" == "Windows_NT" setlocal
+
+set port=8080
+
+rem Guess CATALINA_HOME if not defined
+set "CURRENT_DIR=%cd%"
+if DEFINED CATALINA_HOME goto gotHome
+set "CATALINA_HOME=%CURRENT_DIR%"
+if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
+cd ..
+set "CATALINA_HOME=%cd%"
+cd "%CURRENT_DIR%"
+:gotHome
+
+if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
+echo The CATALINA_HOME environment variable is not defined correctly
+echo This environment variable is needed to run this program
+goto end
+:okHome
+
+rem Copy CATALINA_BASE from CATALINA_HOME if not defined
+if DEFINED CATALINA_BASE goto gotBase
+set "CATALINA_BASE=%CATALINA_HOME%"
+:gotBase
+
+rem Ensure that any user defined CLASSPATH variables are not used on startup,
+rem but allow them to be specified in setenv.bat, in rare case when it is needed.
+set CLASSPATH=
+
+rem Get standard Java environment variables
+if exist "%CATALINA_HOME%\bin\setclasspath.bat" goto okSetclasspath
+echo Cannot find "%CATALINA_HOME%\bin\setclasspath.bat"
+echo This file is needed to run this program
+goto end
+:okSetclasspath
+call "%CATALINA_HOME%\bin\setclasspath.bat" %1
+if errorlevel 1 goto end
+
+if DEFINED CATALINA_TMPDIR goto gotTmpdir
+set "CATALINA_TMPDIR=%CATALINA_BASE%\temp"
+:gotTmpdir
+
+
+rem create classpath
+setlocal enabledelayedexpansion
+
+set "CLASSPATH=%CLASSPATH%;%CATALINA_HOME%\bin\tomcat-juli.jar"
+set lib="%CATALINA_HOME%\lib\"
+echo %lib%
+for %%F in (%lib%/*.jar) do (
+ set CLASSPATH=!CLASSPATH!;%%F%
+)
+
+if ""%1"" == ""deploy"" goto doDeploy
+if ""%1"" == ""undeploy"" goto doUndeploy
+if ""%1"" == ""start"" goto unsupportedCmd
+if ""%1"" == ""stop"" goto unsupportedCmd
+goto doExec
+
+:doDeploy
+:doUndeploy
+"%_RUNJAVA%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" org.apache.openejb.cli.Bootstrap %1 -s http://localhost:%port%/tomee/ejb %2
+goto end
+
+:unsupportedCmd
+echo start/stop commands are not compatible with tomee.bat, please use catalina.bar/startup.bat/shutdown.bat
+goto end
+
+:doExec
+"%_RUNJAVA%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" org.apache.openejb.cli.Bootstrap %*
+goto end
+
+:end
+
Re: [2/3] tomee git commit: EOL commit
Posted by Andy <an...@gmx.de>.
This is a serious problem that GitHub seems to try and resolve via this
document:
https://help.github.com/articles/dealing-with-line-endings/
There is a slight difference per OS. Have a read,and see how to resolve
it for your OS.
I have followed this document to the letter. Sometimes deleting local
and checking out afresh will help.
It is apparent that we have a mixture of line endings in the repo, so
often whole files are changed without apparent reason, but this is going
to continue for a while it seems.
Andy.
On 19/11/2015 02:55, Romain Manni-Bucau wrote:
> got the same, no idea why - I am configured for unix eol. Just wanted
> to push a commit without logic change before pushing actual logic.
> Andy started a thread on infra about that, not yet sure the outcome to
> be honest.
>
> Romain Manni-Bucau
> @rmannibucau | Blog | Github | LinkedIn | Tomitriber
>
>
> 2015-11-18 17:30 GMT-08:00 Daniel Cunha <da...@gmail.com>:
>> I've the same problem here.
>>
>> On Wed, Nov 18, 2015 at 10:21 PM, Thiago Veronezi <th...@veronezi.org>
>> wrote:
>>
>>> Hey Romain,
>>>
>>> What is this commit about? Removing windows line endings?
>>> Now when I pull the source code, my local git says I have changed files
>>> that I never touched. Am I missing a config locally?
>>>
>>> []s,
>>>
--
Andy Gumbrecht
https://twitter.com/AndyGeeDe
Re: [2/3] tomee git commit: EOL commit
Posted by Romain Manni-Bucau <rm...@gmail.com>.
got the same, no idea why - I am configured for unix eol. Just wanted
to push a commit without logic change before pushing actual logic.
Andy started a thread on infra about that, not yet sure the outcome to
be honest.
Romain Manni-Bucau
@rmannibucau | Blog | Github | LinkedIn | Tomitriber
2015-11-18 17:30 GMT-08:00 Daniel Cunha <da...@gmail.com>:
> I've the same problem here.
>
> On Wed, Nov 18, 2015 at 10:21 PM, Thiago Veronezi <th...@veronezi.org>
> wrote:
>
>> Hey Romain,
>>
>> What is this commit about? Removing windows line endings?
>> Now when I pull the source code, my local git says I have changed files
>> that I never touched. Am I missing a config locally?
>>
>> []s,
>> Thiago
>>
>> On Wed, Nov 18, 2015 at 3:18 PM, <rm...@apache.org> wrote:
>>
>> >
>> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/build.xml
>> > ----------------------------------------------------------------------
>> > diff --git a/tomee/build.xml b/tomee/build.xml
>> > index eff1327..c660e7c 100644
>> > --- a/tomee/build.xml
>> > +++ b/tomee/build.xml
>> > @@ -1,46 +1,46 @@
>> > -<?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="dev-helper" default="web">
>> > -
>> > - <target name="web">
>> > - <copy verbose="true"
>> >
>> todir="apache-tomee/target/apache-tomee-webprofile-7.0.0-SNAPSHOT/webapps/tomee">
>> > - <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.js"/>
>> > - <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.css"/>
>> > - <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.html"/>
>> > - </copy>
>> > - </target>
>> > -
>> > - <target name="rs">
>> > - <copy verbose="true"
>> >
>> todir="apache-tomee/target/apache-tomee-jaxrs-7.0.0-SNAPSHOT/webapps/tomee">
>> > - <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.js"/>
>> > - <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.css"/>
>> > - <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.html"/>
>> > - </copy>
>> > - </target>
>> > -
>> > - <target name="plus">
>> > - <copy verbose="true"
>> >
>> todir="apache-tomee/target/apache-tomee-plus-7.0.0-SNAPSHOT/webapps/tomee">
>> > - <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.js"/>
>> > - <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.css"/>
>> > - <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.html"/>
>> > - </copy>
>> > - </target>
>> > -
>> > -</project>
>> > -
>> > +<?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="dev-helper" default="web">
>> > +
>> > + <target name="web">
>> > + <copy verbose="true"
>> >
>> todir="apache-tomee/target/apache-tomee-webprofile-7.0.0-SNAPSHOT/webapps/tomee">
>> > + <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.js"/>
>> > + <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.css"/>
>> > + <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.html"/>
>> > + </copy>
>> > + </target>
>> > +
>> > + <target name="rs">
>> > + <copy verbose="true"
>> >
>> todir="apache-tomee/target/apache-tomee-jaxrs-7.0.0-SNAPSHOT/webapps/tomee">
>> > + <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.js"/>
>> > + <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.css"/>
>> > + <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.html"/>
>> > + </copy>
>> > + </target>
>> > +
>> > + <target name="plus">
>> > + <copy verbose="true"
>> >
>> todir="apache-tomee/target/apache-tomee-plus-7.0.0-SNAPSHOT/webapps/tomee">
>> > + <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.js"/>
>> > + <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.css"/>
>> > + <fileset dir="tomee-webapp/src/main/webapp"
>> > includes="**/*.html"/>
>> > + </copy>
>> > + </target>
>> > +
>> > +</project>
>> > +
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
>> > ----------------------------------------------------------------------
>> > diff --git
>> >
>> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
>> >
>> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
>> > index 2ca6ac6..2208d91 100644
>> > ---
>> >
>> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
>> > +++
>> >
>> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
>> > @@ -1,165 +1,165 @@
>> > -/*
>> > - * 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.tomee.catalina;
>> > -
>> > -import org.apache.catalina.Container;
>> > -import org.apache.catalina.Context;
>> > -import org.apache.catalina.Globals;
>> > -import org.apache.catalina.Host;
>> > -import org.apache.catalina.core.StandardContext;
>> > -import org.apache.catalina.core.StandardEngine;
>> > -import org.apache.catalina.core.StandardHost;
>> > -import org.apache.catalina.util.ContextName;
>> > -
>> > -import java.io.File;
>> > -import java.io.IOException;
>> > -
>> > -public class Contexts {
>> > - public static String getHostname(final StandardContext ctx) {
>> > - String hostName = null;
>> > - final Container parentHost = ctx.getParent();
>> > - if (parentHost != null) {
>> > - hostName = parentHost.getName();
>> > - }
>> > - if ((hostName == null) || (hostName.length() < 1)) {
>> > - hostName = "_";
>> > - }
>> > - return hostName;
>> > - }
>> > -
>> > - public static File warPath(final Context standardContext) {
>> > - final File file = realWarPath(standardContext);
>> > - if (file == null) {
>> > - return null;
>> > - }
>> > -
>> > - final String name = file.getName();
>> > - if (!file.isDirectory() && name.endsWith(".war")) {
>> > - final File extracted = new File(file.getParentFile(),
>> > name.substring(0, name.length() - ".war".length()));
>> > - if (extracted.exists()) {
>> > - try {
>> > - return extracted.getCanonicalFile();
>> > - } catch (final IOException e) {
>> > - return extracted;
>> > - }
>> > - }
>> > - }
>> > - try {
>> > - return file.getCanonicalFile();
>> > - } catch (final IOException e) {
>> > - return file;
>> > - }
>> > - }
>> > -
>> > - public static File realWarPath(final Context standardContext) {
>> > - if (standardContext == null) {
>> > - return null;
>> > - }
>> > -
>> > - final File docBase;
>> > - Container container = standardContext;
>> > - while (container != null) {
>> > - if (container instanceof Host) {
>> > - break;
>> > - }
>> > - container = container.getParent();
>> > - }
>> > -
>> > - String baseName = null;
>> > - if (standardContext.getDocBase() != null) {
>> > - File file = new File(standardContext.getDocBase());
>> > - if (!file.isAbsolute()) {
>> > - if (container == null) {
>> > - docBase = new File(engineBase(standardContext),
>> > standardContext.getDocBase());
>> > - } else {
>> > - final String appBase = ((Host)
>> > container).getAppBase();
>> > - file = new File(appBase);
>> > - if (!file.isAbsolute()) {
>> > - file = new File(engineBase(standardContext),
>> > appBase);
>> > - }
>> > - docBase = new File(file,
>> > standardContext.getDocBase());
>> > - }
>> > - } else {
>> > - docBase = file;
>> > - }
>> > - } else {
>> > - final String path = standardContext.getPath();
>> > - if (path == null) {
>> > - throw new IllegalStateException("Can't find docBase");
>> > - } else {
>> > - baseName = new ContextName(path,
>> > standardContext.getWebappVersion()).getBaseName();
>> > - docBase = new File(baseName);
>> > - }
>> > - }
>> > -
>> > - if (!docBase.exists() && baseName != null) { // for old
>> > compatibility, will be removed soon
>> > - if (Host.class.isInstance(container)) {
>> > - final File file = new
>> > File(Host.class.cast(container).getAppBaseFile(), baseName);
>> > - if (file.exists()) {
>> > - return file;
>> > - }
>> > - }
>> > - return oldRealWarPath(standardContext);
>> > - }
>> > -
>> > - final String name = docBase.getName();
>> > - if (name.endsWith(".war")) {
>> > - final File extracted = new File(docBase.getParentFile(),
>> > name.substring(0, name.length() - ".war".length()));
>> > - if (extracted.exists()) {
>> > - return extracted;
>> > - }
>> > - }
>> > -
>> > - return docBase;
>> > - }
>> > -
>> > - private static File engineBase(final Context standardContext) {
>> > - final String base =
>> > System.getProperty(Globals.CATALINA_BASE_PROP);
>> > - if( base == null ) {
>> > - final StandardEngine eng = (StandardEngine)
>> > standardContext.getParent().getParent();
>> > - return eng.getCatalinaBase();
>> > - }
>> > - return new File(base);
>> > - }
>> > -
>> > - @Deprecated
>> > - private static File oldRealWarPath(final Context standardContext) {
>> > - String doc = standardContext.getDocBase();
>> > - // handle ROOT case
>> > - if (doc == null || doc.length() == 0) {
>> > - doc = "ROOT";
>> > - }
>> > -
>> > - File war = new File(doc);
>> > - if (war.exists()) {
>> > - return war;
>> > - }
>> > -
>> > - final StandardHost host = (StandardHost)
>> > standardContext.getParent();
>> > - final String base = host.getAppBase();
>> > - war = new File(base, doc);
>> > - if (war.exists()) {
>> > - return war;
>> > - }
>> > -
>> > - war = new File(new File(System.getProperty("catalina.home"),
>> > base), doc);
>> > - if (war.exists()) {
>> > - return war;
>> > - }
>> > - return new File(new File(System.getProperty("catalina.base"),
>> > base), doc); // shouldn't occur
>> > - }
>> > -}
>> > +/*
>> > + * 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.tomee.catalina;
>> > +
>> > +import org.apache.catalina.Container;
>> > +import org.apache.catalina.Context;
>> > +import org.apache.catalina.Globals;
>> > +import org.apache.catalina.Host;
>> > +import org.apache.catalina.core.StandardContext;
>> > +import org.apache.catalina.core.StandardEngine;
>> > +import org.apache.catalina.core.StandardHost;
>> > +import org.apache.catalina.util.ContextName;
>> > +
>> > +import java.io.File;
>> > +import java.io.IOException;
>> > +
>> > +public class Contexts {
>> > + public static String getHostname(final StandardContext ctx) {
>> > + String hostName = null;
>> > + final Container parentHost = ctx.getParent();
>> > + if (parentHost != null) {
>> > + hostName = parentHost.getName();
>> > + }
>> > + if ((hostName == null) || (hostName.length() < 1)) {
>> > + hostName = "_";
>> > + }
>> > + return hostName;
>> > + }
>> > +
>> > + public static File warPath(final Context standardContext) {
>> > + final File file = realWarPath(standardContext);
>> > + if (file == null) {
>> > + return null;
>> > + }
>> > +
>> > + final String name = file.getName();
>> > + if (!file.isDirectory() && name.endsWith(".war")) {
>> > + final File extracted = new File(file.getParentFile(),
>> > name.substring(0, name.length() - ".war".length()));
>> > + if (extracted.exists()) {
>> > + try {
>> > + return extracted.getCanonicalFile();
>> > + } catch (final IOException e) {
>> > + return extracted;
>> > + }
>> > + }
>> > + }
>> > + try {
>> > + return file.getCanonicalFile();
>> > + } catch (final IOException e) {
>> > + return file;
>> > + }
>> > + }
>> > +
>> > + public static File realWarPath(final Context standardContext) {
>> > + if (standardContext == null) {
>> > + return null;
>> > + }
>> > +
>> > + final File docBase;
>> > + Container container = standardContext;
>> > + while (container != null) {
>> > + if (container instanceof Host) {
>> > + break;
>> > + }
>> > + container = container.getParent();
>> > + }
>> > +
>> > + String baseName = null;
>> > + if (standardContext.getDocBase() != null) {
>> > + File file = new File(standardContext.getDocBase());
>> > + if (!file.isAbsolute()) {
>> > + if (container == null) {
>> > + docBase = new File(engineBase(standardContext),
>> > standardContext.getDocBase());
>> > + } else {
>> > + final String appBase = ((Host)
>> > container).getAppBase();
>> > + file = new File(appBase);
>> > + if (!file.isAbsolute()) {
>> > + file = new File(engineBase(standardContext),
>> > appBase);
>> > + }
>> > + docBase = new File(file,
>> > standardContext.getDocBase());
>> > + }
>> > + } else {
>> > + docBase = file;
>> > + }
>> > + } else {
>> > + final String path = standardContext.getPath();
>> > + if (path == null) {
>> > + throw new IllegalStateException("Can't find docBase");
>> > + } else {
>> > + baseName = new ContextName(path,
>> > standardContext.getWebappVersion()).getBaseName();
>> > + docBase = new File(baseName);
>> > + }
>> > + }
>> > +
>> > + if (!docBase.exists() && baseName != null) { // for old
>> > compatibility, will be removed soon
>> > + if (Host.class.isInstance(container)) {
>> > + final File file = new
>> > File(Host.class.cast(container).getAppBaseFile(), baseName);
>> > + if (file.exists()) {
>> > + return file;
>> > + }
>> > + }
>> > + return oldRealWarPath(standardContext);
>> > + }
>> > +
>> > + final String name = docBase.getName();
>> > + if (name.endsWith(".war")) {
>> > + final File extracted = new File(docBase.getParentFile(),
>> > name.substring(0, name.length() - ".war".length()));
>> > + if (extracted.exists()) {
>> > + return extracted;
>> > + }
>> > + }
>> > +
>> > + return docBase;
>> > + }
>> > +
>> > + private static File engineBase(final Context standardContext) {
>> > + final String base =
>> > System.getProperty(Globals.CATALINA_BASE_PROP);
>> > + if( base == null ) {
>> > + final StandardEngine eng = (StandardEngine)
>> > standardContext.getParent().getParent();
>> > + return eng.getCatalinaBase();
>> > + }
>> > + return new File(base);
>> > + }
>> > +
>> > + @Deprecated
>> > + private static File oldRealWarPath(final Context standardContext) {
>> > + String doc = standardContext.getDocBase();
>> > + // handle ROOT case
>> > + if (doc == null || doc.length() == 0) {
>> > + doc = "ROOT";
>> > + }
>> > +
>> > + File war = new File(doc);
>> > + if (war.exists()) {
>> > + return war;
>> > + }
>> > +
>> > + final StandardHost host = (StandardHost)
>> > standardContext.getParent();
>> > + final String base = host.getAppBase();
>> > + war = new File(base, doc);
>> > + if (war.exists()) {
>> > + return war;
>> > + }
>> > +
>> > + war = new File(new File(System.getProperty("catalina.home"),
>> > base), doc);
>> > + if (war.exists()) {
>> > + return war;
>> > + }
>> > + return new File(new File(System.getProperty("catalina.base"),
>> > base), doc); // shouldn't occur
>> > + }
>> > +}
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
>> > ----------------------------------------------------------------------
>> > diff --git
>> >
>> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
>> >
>> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
>> > index eee2d2a..2308db0 100644
>> > ---
>> >
>> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
>> > +++
>> >
>> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
>> > @@ -1,121 +1,121 @@
>> > -/*
>> > - * 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.tomee.catalina;
>> > -
>> > -import org.apache.catalina.Context;
>> > -import org.apache.catalina.LifecycleException;
>> > -import org.apache.catalina.loader.WebappLoader;
>> > -import org.apache.openejb.ClassLoaderUtil;
>> > -import org.apache.openejb.classloader.ClassLoaderConfigurer;
>> > -import org.apache.openejb.classloader.CompositeClassLoaderConfigurer;
>> > -import org.apache.openejb.config.QuickJarsTxtParser;
>> > -import org.apache.openejb.loader.SystemInstance;
>> > -
>> > -import java.io.File;
>> > -
>> > -/**
>> > - * Usage example in META-INF/context.xml
>> > - * <p/>
>> > - * <p/>
>> > - * <Context antiJARLocking="true" >
>> > - * <Loader
>> > - * className="org.apache.tomee.catalina.ProvisioningWebappLoader"
>> > - * searchExternalFirst="true"
>> > - *
>> >
>> virtualClasspath="mvn:commons-el:commons-el:1.0;mvn:commons-el:commons-el:1.0"
>> > - * searchVirtualFirst="true"
>> > - * />
>> > - * </Context>
>> > - */
>> > -public class TomEEWebappLoader extends WebappLoader {
>> > - public static final boolean SKIP_BACKGROUND_PROCESS =
>> >
>> "true".equals(SystemInstance.get().getProperty("tomee.classloader.skip-background-process",
>> > "false"));
>> > -
>> > - private volatile ClassLoader loader;
>> > -
>> > - @Override
>> > - public void backgroundProcess() {
>> > - if (SKIP_BACKGROUND_PROCESS) {
>> > - return;
>> > - }
>> > -
>> > - final ClassLoader classloader = super.getClassLoader();
>> > - if (classloader instanceof TomEEWebappClassLoader) {
>> > - final TomEEWebappClassLoader tomEEWebappClassLoader =
>> > (TomEEWebappClassLoader) classloader;
>> > - tomEEWebappClassLoader.restarting();
>> > - try {
>> > - super.backgroundProcess();
>> > - } finally {
>> > - tomEEWebappClassLoader.restarted();
>> > - }
>> > - } else {
>> > - super.backgroundProcess();
>> > - }
>> > - }
>> > -
>> > - @Override
>> > - public boolean modified() {
>> > - return !SKIP_BACKGROUND_PROCESS && super.modified();
>> > - }
>> > -
>> > - @Override
>> > - protected void stopInternal() throws LifecycleException {
>> > - loader = getClassLoader();
>> > - super.stopInternal();
>> > - }
>> > -
>> > - public void clearLoader() {
>> > - loader = null;
>> > - }
>> > -
>> > - public ClassLoader internalLoader() {
>> > - return loader;
>> > - }
>> > -
>> > - @Override
>> > - protected void startInternal() throws LifecycleException {
>> > - if (getClassLoader() != null) {
>> > - final TomEEWebappClassLoader webappClassLoader =
>> > TomEEWebappClassLoader.class.cast(getClassLoader());
>> > - if (webappClassLoader.isStopped()) {
>> > - webappClassLoader.internalStop();
>> > - }
>> > - }
>> > -
>> > - final Context context = getContext();
>> > -
>> > - ClassLoaderConfigurer configurer =
>> > ClassLoaderUtil.configurer(context.getName());
>> > -
>> > - // WEB-INF/jars.xml
>> > - final File war = Contexts.warPath(Context.class.cast(context));
>> > - final File jarsXml = new File(war, "WEB-INF/" +
>> > QuickJarsTxtParser.FILE_NAME);
>> > - final ClassLoaderConfigurer configurerTxt =
>> > QuickJarsTxtParser.parse(jarsXml);
>> > - if (configurerTxt != null) {
>> > - configurer = new CompositeClassLoaderConfigurer(configurer,
>> > configurerTxt);
>> > - }
>> > -
>> > - TomEEWebappClassLoader.initContext(configurer);
>> > - TomEEWebappClassLoader.initContext(context);
>> > - try {
>> > - super.startInternal();
>> > - } finally {
>> > - TomEEWebappClassLoader.cleanContext();
>> > - }
>> > - }
>> > -
>> > - @Override
>> > - public String toString() {
>> > - return "TomEE" + super.toString();
>> > - }
>> > -}
>> > +/*
>> > + * 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.tomee.catalina;
>> > +
>> > +import org.apache.catalina.Context;
>> > +import org.apache.catalina.LifecycleException;
>> > +import org.apache.catalina.loader.WebappLoader;
>> > +import org.apache.openejb.ClassLoaderUtil;
>> > +import org.apache.openejb.classloader.ClassLoaderConfigurer;
>> > +import org.apache.openejb.classloader.CompositeClassLoaderConfigurer;
>> > +import org.apache.openejb.config.QuickJarsTxtParser;
>> > +import org.apache.openejb.loader.SystemInstance;
>> > +
>> > +import java.io.File;
>> > +
>> > +/**
>> > + * Usage example in META-INF/context.xml
>> > + * <p/>
>> > + * <p/>
>> > + * <Context antiJARLocking="true" >
>> > + * <Loader
>> > + * className="org.apache.tomee.catalina.ProvisioningWebappLoader"
>> > + * searchExternalFirst="true"
>> > + *
>> >
>> virtualClasspath="mvn:commons-el:commons-el:1.0;mvn:commons-el:commons-el:1.0"
>> > + * searchVirtualFirst="true"
>> > + * />
>> > + * </Context>
>> > + */
>> > +public class TomEEWebappLoader extends WebappLoader {
>> > + public static final boolean SKIP_BACKGROUND_PROCESS =
>> >
>> "true".equals(SystemInstance.get().getProperty("tomee.classloader.skip-background-process",
>> > "false"));
>> > +
>> > + private volatile ClassLoader loader;
>> > +
>> > + @Override
>> > + public void backgroundProcess() {
>> > + if (SKIP_BACKGROUND_PROCESS) {
>> > + return;
>> > + }
>> > +
>> > + final ClassLoader classloader = super.getClassLoader();
>> > + if (classloader instanceof TomEEWebappClassLoader) {
>> > + final TomEEWebappClassLoader tomEEWebappClassLoader =
>> > (TomEEWebappClassLoader) classloader;
>> > + tomEEWebappClassLoader.restarting();
>> > + try {
>> > + super.backgroundProcess();
>> > + } finally {
>> > + tomEEWebappClassLoader.restarted();
>> > + }
>> > + } else {
>> > + super.backgroundProcess();
>> > + }
>> > + }
>> > +
>> > + @Override
>> > + public boolean modified() {
>> > + return !SKIP_BACKGROUND_PROCESS && super.modified();
>> > + }
>> > +
>> > + @Override
>> > + protected void stopInternal() throws LifecycleException {
>> > + loader = getClassLoader();
>> > + super.stopInternal();
>> > + }
>> > +
>> > + public void clearLoader() {
>> > + loader = null;
>> > + }
>> > +
>> > + public ClassLoader internalLoader() {
>> > + return loader;
>> > + }
>> > +
>> > + @Override
>> > + protected void startInternal() throws LifecycleException {
>> > + if (getClassLoader() != null) {
>> > + final TomEEWebappClassLoader webappClassLoader =
>> > TomEEWebappClassLoader.class.cast(getClassLoader());
>> > + if (webappClassLoader.isStopped()) {
>> > + webappClassLoader.internalStop();
>> > + }
>> > + }
>> > +
>> > + final Context context = getContext();
>> > +
>> > + ClassLoaderConfigurer configurer =
>> > ClassLoaderUtil.configurer(context.getName());
>> > +
>> > + // WEB-INF/jars.xml
>> > + final File war = Contexts.warPath(Context.class.cast(context));
>> > + final File jarsXml = new File(war, "WEB-INF/" +
>> > QuickJarsTxtParser.FILE_NAME);
>> > + final ClassLoaderConfigurer configurerTxt =
>> > QuickJarsTxtParser.parse(jarsXml);
>> > + if (configurerTxt != null) {
>> > + configurer = new CompositeClassLoaderConfigurer(configurer,
>> > configurerTxt);
>> > + }
>> > +
>> > + TomEEWebappClassLoader.initContext(configurer);
>> > + TomEEWebappClassLoader.initContext(context);
>> > + try {
>> > + super.startInternal();
>> > + } finally {
>> > + TomEEWebappClassLoader.cleanContext();
>> > + }
>> > + }
>> > +
>> > + @Override
>> > + public String toString() {
>> > + return "TomEE" + super.toString();
>> > + }
>> > +}
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
>> > ----------------------------------------------------------------------
>> > diff --git
>> >
>> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
>> >
>> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
>> > index 03fea68..4496e54 100644
>> > ---
>> >
>> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
>> > +++
>> >
>> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
>> > @@ -1,43 +1,43 @@
>> > -/*
>> > - * 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.tomee.catalina;
>> > -
>> > -import org.apache.catalina.core.StandardContext;
>> > -import org.apache.openejb.config.DeploymentLoader;
>> > -
>> > -/**
>> > - * @version $Id$
>> > - */
>> > -public class TomcatDeploymentLoader extends DeploymentLoader {
>> > - private StandardContext standardContext;
>> > - private String moduleId;
>> > -
>> > - public TomcatDeploymentLoader(final StandardContext standardContext,
>> > final String moduleId) {
>> > - this.standardContext = standardContext;
>> > - this.moduleId = moduleId;
>> > - }
>> > -
>> > - @Override
>> > - protected String getContextRoot() {
>> > - return standardContext.getPath();
>> > - }
>> > -
>> > - @Override
>> > - protected String getModuleName() {
>> > - return moduleId;
>> > - }
>> > -}
>> > +/*
>> > + * 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.tomee.catalina;
>> > +
>> > +import org.apache.catalina.core.StandardContext;
>> > +import org.apache.openejb.config.DeploymentLoader;
>> > +
>> > +/**
>> > + * @version $Id$
>> > + */
>> > +public class TomcatDeploymentLoader extends DeploymentLoader {
>> > + private StandardContext standardContext;
>> > + private String moduleId;
>> > +
>> > + public TomcatDeploymentLoader(final StandardContext standardContext,
>> > final String moduleId) {
>> > + this.standardContext = standardContext;
>> > + this.moduleId = moduleId;
>> > + }
>> > +
>> > + @Override
>> > + protected String getContextRoot() {
>> > + return standardContext.getPath();
>> > + }
>> > +
>> > + @Override
>> > + protected String getModuleName() {
>> > + return moduleId;
>> > + }
>> > +}
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
>> > ----------------------------------------------------------------------
>> > diff --git
>> > a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
>> > b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
>> > index 1720f9f..a2c8d06 100644
>> > ---
>> > a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
>> > +++
>> > b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
>> > @@ -1,134 +1,134 @@
>> > -/**
>> > - * 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.tomee.embedded;
>> > -
>> > -import java.io.File;
>> > -import java.util.Set;
>> > -
>> > -import org.apache.commons.cli.CommandLine;
>> > -import org.apache.commons.cli.CommandLineParser;
>> > -import org.apache.commons.cli.HelpFormatter;
>> > -import org.apache.commons.cli.Options;
>> > -import org.apache.commons.cli.ParseException;
>> > -import org.apache.commons.cli.PosixParser;
>> > -import org.apache.openejb.loader.ProvisioningUtil;
>> > -
>> > -import static org.apache.openejb.loader.JarLocation.jarLocation;
>> > -
>> > -public class Main {
>> > - public static final String PORT = "port";
>> > - public static final String SHUTDOWN = "shutdown";
>> > - public static final String PATH = "path";
>> > - public static final String CONTEXT = "context";
>> > - public static final String DIRECTORY = "directory";
>> > - public static final String DOC_BASE = "doc-base";
>> > - public static final String AS_WAR = "as-war";
>> > -
>> > - public static void main(final String[] args) {
>> > - final CommandLineParser parser = new PosixParser();
>> > - final Options options = createOptions();
>> > -
>> > - // parse command line
>> > - final CommandLine line;
>> > - try {
>> > - line = parser.parse(options, args, true);
>> > - } catch (final ParseException exp) {
>> > - new HelpFormatter().printHelp("java -jar
>> > tomee-embedded-user.jar", options);
>> > - return;
>> > - }
>> > -
>> > - // run TomEE
>> > - try {
>> > - final Container container = new
>> > Container(createConfiguration(line));
>> > - final String[] contexts;
>> > - if (line.hasOption(CONTEXT)) {
>> > - contexts = line.getOptionValues(CONTEXT);
>> > - } else {
>> > - contexts = null;
>> > - }
>> > -
>> > - boolean autoWar = true;
>> > - int i = 0;
>> > - if (line.hasOption(PATH)) {
>> > - for (final String path : line.getOptionValues(PATH)) {
>> > - final Set<String> locations =
>> > ProvisioningUtil.realLocation(path);
>> > - for (final String location : locations) {
>> > - final File file = new File(location);
>> > - if (!file.exists()) {
>> > - System.err.println(file.getAbsolutePath() +
>> "
>> > does not exist, skipping");
>> > - continue;
>> > - }
>> > -
>> > - String name =
>> > file.getName().replaceAll("\\.[A-Za-z]+$", "");
>> > - if (contexts != null) {
>> > - name = contexts[i++];
>> > - }
>> > - container.deploy(name, file, true);
>> > - }
>> > - }
>> > - autoWar = false;
>> > - }
>> > - if (line.hasOption(AS_WAR)) {
>> > - container.deployClasspathAsWebApp(contexts == null || i
>> > == contexts.length ? "" : contexts[i],
>> > - line.hasOption(DOC_BASE) ? new
>> > File(line.getOptionValue(DOC_BASE)) : null);
>> > - autoWar = false;
>> > - }
>> > - if (autoWar) { // nothing deployed check if we are a war and
>> > deploy ourself then
>> > - final File me = jarLocation(Main.class);
>> > - if (me.getName().endsWith(".war")) {
>> > - container.deploy(contexts == null || i ==
>> > contexts.length ? "" : contexts[i], me);
>> > - }
>> > - }
>> > -
>> > - Runtime.getRuntime().addShutdownHook(new Thread() {
>> > - @Override
>> > - public void run() {
>> > - try {
>> > - container.stop();
>> > - } catch (final Exception e) {
>> > - e.printStackTrace(); // just log the exception
>> > - }
>> > - }
>> > - });
>> > - container.await();
>> > - } catch (final Exception e) {
>> > - e.printStackTrace();
>> > - }
>> > - }
>> > -
>> > - private static Options createOptions() {
>> > - final Options options = new Options();
>> > - options.addOption(null, PATH, true, "");
>> > - options.addOption(null, CONTEXT, true, "Context name for
>> > applications (same order than paths)");
>> > - options.addOption("p", PORT, true, "TomEE http port");
>> > - options.addOption("s", SHUTDOWN, true, "TomEE shutdown port");
>> > - options.addOption("d", DIRECTORY, true, "TomEE directory");
>> > - options.addOption("c", AS_WAR, false, "deploy classpath as
>> war");
>> > - options.addOption("b", DOC_BASE, true, "when deploy classpath as
>> > war, the doc base");
>> > - return options;
>> > - }
>> > -
>> > - private static Configuration createConfiguration(final CommandLine
>> > args) {
>> > - final Configuration config = new Configuration();
>> > - config.setDir(System.getProperty("java.io.tmpdir"));
>> > - config.setHttpPort(Integer.parseInt(args.getOptionValue(PORT,
>> > "8080")));
>> > -
>> config.setStopPort(Integer.parseInt(args.getOptionValue(SHUTDOWN,
>> > "8005")));
>> > - config.setDir(args.getOptionValue(DIRECTORY, new File(new
>> > File("."), "apache-tomee").getAbsolutePath()));
>> > - return config;
>> > - }
>> > -
>> > -}
>> > +/**
>> > + * 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.tomee.embedded;
>> > +
>> > +import java.io.File;
>> > +import java.util.Set;
>> > +
>> > +import org.apache.commons.cli.CommandLine;
>> > +import org.apache.commons.cli.CommandLineParser;
>> > +import org.apache.commons.cli.HelpFormatter;
>> > +import org.apache.commons.cli.Options;
>> > +import org.apache.commons.cli.ParseException;
>> > +import org.apache.commons.cli.PosixParser;
>> > +import org.apache.openejb.loader.ProvisioningUtil;
>> > +
>> > +import static org.apache.openejb.loader.JarLocation.jarLocation;
>> > +
>> > +public class Main {
>> > + public static final String PORT = "port";
>> > + public static final String SHUTDOWN = "shutdown";
>> > + public static final String PATH = "path";
>> > + public static final String CONTEXT = "context";
>> > + public static final String DIRECTORY = "directory";
>> > + public static final String DOC_BASE = "doc-base";
>> > + public static final String AS_WAR = "as-war";
>> > +
>> > + public static void main(final String[] args) {
>> > + final CommandLineParser parser = new PosixParser();
>> > + final Options options = createOptions();
>> > +
>> > + // parse command line
>> > + final CommandLine line;
>> > + try {
>> > + line = parser.parse(options, args, true);
>> > + } catch (final ParseException exp) {
>> > + new HelpFormatter().printHelp("java -jar
>> > tomee-embedded-user.jar", options);
>> > + return;
>> > + }
>> > +
>> > + // run TomEE
>> > + try {
>> > + final Container container = new
>> > Container(createConfiguration(line));
>> > + final String[] contexts;
>> > + if (line.hasOption(CONTEXT)) {
>> > + contexts = line.getOptionValues(CONTEXT);
>> > + } else {
>> > + contexts = null;
>> > + }
>> > +
>> > + boolean autoWar = true;
>> > + int i = 0;
>> > + if (line.hasOption(PATH)) {
>> > + for (final String path : line.getOptionValues(PATH)) {
>> > + final Set<String> locations =
>> > ProvisioningUtil.realLocation(path);
>> > + for (final String location : locations) {
>> > + final File file = new File(location);
>> > + if (!file.exists()) {
>> > + System.err.println(file.getAbsolutePath() +
>> "
>> > does not exist, skipping");
>> > + continue;
>> > + }
>> > +
>> > + String name =
>> > file.getName().replaceAll("\\.[A-Za-z]+$", "");
>> > + if (contexts != null) {
>> > + name = contexts[i++];
>> > + }
>> > + container.deploy(name, file, true);
>> > + }
>> > + }
>> > + autoWar = false;
>> > + }
>> > + if (line.hasOption(AS_WAR)) {
>> > + container.deployClasspathAsWebApp(contexts == null || i
>> > == contexts.length ? "" : contexts[i],
>> > + line.hasOption(DOC_BASE) ? new
>> > File(line.getOptionValue(DOC_BASE)) : null);
>> > + autoWar = false;
>> > + }
>> > + if (autoWar) { // nothing deployed check if we are a war and
>> > deploy ourself then
>> > + final File me = jarLocation(Main.class);
>> > + if (me.getName().endsWith(".war")) {
>> > + container.deploy(contexts == null || i ==
>> > contexts.length ? "" : contexts[i], me);
>> > + }
>> > + }
>> > +
>> > + Runtime.getRuntime().addShutdownHook(new Thread() {
>> > + @Override
>> > + public void run() {
>> > + try {
>> > + container.stop();
>> > + } catch (final Exception e) {
>> > + e.printStackTrace(); // just log the exception
>> > + }
>> > + }
>> > + });
>> > + container.await();
>> > + } catch (final Exception e) {
>> > + e.printStackTrace();
>> > + }
>> > + }
>> > +
>> > + private static Options createOptions() {
>> > + final Options options = new Options();
>> > + options.addOption(null, PATH, true, "");
>> > + options.addOption(null, CONTEXT, true, "Context name for
>> > applications (same order than paths)");
>> > + options.addOption("p", PORT, true, "TomEE http port");
>> > + options.addOption("s", SHUTDOWN, true, "TomEE shutdown port");
>> > + options.addOption("d", DIRECTORY, true, "TomEE directory");
>> > + options.addOption("c", AS_WAR, false, "deploy classpath as
>> war");
>> > + options.addOption("b", DOC_BASE, true, "when deploy classpath as
>> > war, the doc base");
>> > + return options;
>> > + }
>> > +
>> > + private static Configuration createConfiguration(final CommandLine
>> > args) {
>> > + final Configuration config = new Configuration();
>> > + config.setDir(System.getProperty("java.io.tmpdir"));
>> > + config.setHttpPort(Integer.parseInt(args.getOptionValue(PORT,
>> > "8080")));
>> > +
>> config.setStopPort(Integer.parseInt(args.getOptionValue(SHUTDOWN,
>> > "8005")));
>> > + config.setDir(args.getOptionValue(DIRECTORY, new File(new
>> > File("."), "apache-tomee").getAbsolutePath()));
>> > + return config;
>> > + }
>> > +
>> > +}
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
>> > ----------------------------------------------------------------------
>> > diff --git
>> >
>> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
>> >
>> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
>> > index 1d8fcef..f5a4247 100644
>> > ---
>> >
>> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
>> > +++
>> >
>> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
>> > @@ -1,241 +1,241 @@
>> > -// 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.
>> > -
>> > -//
>> >
>> ============================================================================
>> > -// catalina.policy - Security Policy Permissions for Tomcat 7
>> > -//
>> > -// This file contains a default set of security policies to be enforced
>> > (by the
>> > -// JVM) when Catalina is executed with the "-security" option. In
>> > addition
>> > -// to the permissions granted here, the following additional permissions
>> > are
>> > -// granted specific to each web application:
>> > -//
>> > -// * Read access to its document root directory
>> > -// * Read, write and delete access to its working directory
>> > -//
>> > -// $Id: catalina.policy 1079755 2011-03-09 11:38:38Z markt $
>> > -//
>> >
>> ============================================================================
>> > -
>> > -
>> > -// ========== SYSTEM CODE PERMISSIONS
>> > =========================================
>> > -
>> > -
>> > -// These permissions apply to javac
>> > -grant codeBase "file:${java.home}/lib/-" {
>> > - permission java.security.AllPermission;
>> > -};
>> > -
>> > -// These permissions apply to all shared system extensions
>> > -grant codeBase "file:${java.home}/jre/lib/ext/-" {
>> > - permission java.security.AllPermission;
>> > -};
>> > -
>> > -// These permissions apply to javac when ${java.home] points at
>> > $JAVA_HOME/jre
>> > -grant codeBase "file:${java.home}/../lib/-" {
>> > - permission java.security.AllPermission;
>> > -};
>> > -
>> > -// These permissions apply to all shared system extensions when
>> > -// ${java.home} points at $JAVA_HOME/jre
>> > -grant codeBase "file:${java.home}/lib/ext/-" {
>> > - permission java.security.AllPermission;
>> > -};
>> > -
>> > -
>> > -// ========== CATALINA CODE PERMISSIONS
>> > =======================================
>> > -
>> > -
>> > -// These permissions apply to the daemon code
>> > -grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
>> > - permission java.security.AllPermission;
>> > -};
>> > -
>> > -// These permissions apply to the logging API
>> > -// Note: If tomcat-juli.jar is in ${catalina.base} and not in
>> > ${catalina.home},
>> > -// update this section accordingly.
>> > -// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..}
>> > -grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
>> > - permission java.io.FilePermission
>> > -
>> > "${java.home}${file.separator}lib${file.separator}logging.properties",
>> > "read";
>> > -
>> > - permission java.io.FilePermission
>> > -
>> >
>> "${catalina.base}${file.separator}conf${file.separator}logging.properties",
>> > "read";
>> > - permission java.io.FilePermission
>> > - "${catalina.base}${file.separator}logs", "read, write";
>> > - permission java.io.FilePermission
>> > - "${catalina.base}${file.separator}logs${file.separator}*",
>> > "read, write";
>> > -
>> > - permission java.lang.RuntimePermission "shutdownHooks";
>> > - permission java.lang.RuntimePermission "getClassLoader";
>> > - permission java.lang.RuntimePermission "setContextClassLoader";
>> > -
>> > - permission java.util.logging.LoggingPermission "control";
>> > -
>> > - permission java.util.PropertyPermission
>> > "java.util.logging.config.class", "read";
>> > - permission java.util.PropertyPermission
>> > "java.util.logging.config.file", "read";
>> > - permission java.util.PropertyPermission "catalina.base", "read";
>> > -
>> > - // Note: To enable per context logging configuration, permit
>> read
>> > access to
>> > - // the appropriate file. Be sure that the logging configuration
>> is
>> > - // secure before enabling such access.
>> > - // E.g. for the examples web application:
>> > - // permission java.io.FilePermission
>> > "${catalina.base}${file.separator}
>> > - // webapps${file.separator}examples${file.separator}WEB-INF
>> > - //
>> ${file.separator}classes${file.separator}logging.properties",
>> > "read";
>> > -};
>> > -
>> > -// These permissions apply to the server startup code
>> > -grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
>> > - permission java.security.AllPermission;
>> > -};
>> > -
>> > -// These permissions apply to the servlet API classes
>> > -// and those that are shared across all class loaders
>> > -// located in the "lib" directory
>> > -grant codeBase "file:${catalina.home}/lib/-" {
>> > - permission java.security.AllPermission;
>> > -};
>> > -
>> > -
>> > -// If using a per instance lib directory, i.e. ${catalina.base}/lib,
>> > -// then the following permission will need to be uncommented
>> > -// grant codeBase "file:${catalina.base}/lib/-" {
>> > -// permission java.security.AllPermission;
>> > -// };
>> > -
>> > -
>> > -// ========== WEB APPLICATION PERMISSIONS
>> > =====================================
>> > -
>> > -
>> > -// These permissions are granted by default to all web applications
>> > -// In addition, a web application will be given a read FilePermission
>> > -// and JndiPermission for all files and directories in its document
>> root.
>> > -grant {
>> > - // Required for JNDI lookup of named JDBC DataSource's and
>> > - // javamail named MimePart DataSource used to send mail
>> > - permission java.util.PropertyPermission "java.home", "read";
>> > - permission java.util.PropertyPermission "java.naming.*", "read";
>> > - permission java.util.PropertyPermission "javax.sql.*", "read";
>> > -
>> > - // OS Specific properties to allow read access
>> > - permission java.util.PropertyPermission "os.name", "read";
>> > - permission java.util.PropertyPermission "os.version", "read";
>> > - permission java.util.PropertyPermission "os.arch", "read";
>> > - permission java.util.PropertyPermission "file.separator", "read";
>> > - permission java.util.PropertyPermission "path.separator", "read";
>> > - permission java.util.PropertyPermission "line.separator", "read";
>> > -
>> > - // JVM properties to allow read access
>> > - permission java.util.PropertyPermission "java.version", "read";
>> > - permission java.util.PropertyPermission "java.vendor", "read";
>> > - permission java.util.PropertyPermission "java.vendor.url", "read";
>> > - permission java.util.PropertyPermission "java.class.version",
>> "read";
>> > - permission java.util.PropertyPermission
>> "java.specification.version",
>> > "read";
>> > - permission java.util.PropertyPermission "java.specification.vendor",
>> > "read";
>> > - permission java.util.PropertyPermission "java.specification.name",
>> > "read";
>> > -
>> > - permission java.util.PropertyPermission
>> > "java.vm.specification.version", "read";
>> > - permission java.util.PropertyPermission
>> > "java.vm.specification.vendor", "read";
>> > - permission java.util.PropertyPermission "java.vm.specification.name
>> ",
>> > "read";
>> > - permission java.util.PropertyPermission "java.vm.version", "read";
>> > - permission java.util.PropertyPermission "java.vm.vendor", "read";
>> > - permission java.util.PropertyPermission "java.vm.name", "read";
>> > -
>> > - // Required for OpenJMX
>> > - permission java.lang.RuntimePermission "getAttribute";
>> > -
>> > - // Allow read of JAXP compliant XML parser debug
>> > - permission java.util.PropertyPermission "jaxp.debug", "read";
>> > -
>> > - // All JSPs need to be able to read this package
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.tomcat";
>> > -
>> > - // Precompiled JSPs need access to these packages.
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.jasper.el";
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.jasper.runtime";
>> > - permission java.lang.RuntimePermission
>> > - "accessClassInPackage.org.apache.jasper.runtime.*";
>> > -
>> > - // Precompiled JSPs need access to these system properties.
>> > - permission java.util.PropertyPermission
>> > - "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read";
>> > - permission java.util.PropertyPermission
>> > - "org.apache.el.parser.COERCE_TO_ZERO", "read";
>> > -
>> > - // The cookie code needs these.
>> > - permission java.util.PropertyPermission
>> > - "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
>> > - permission java.util.PropertyPermission
>> > - "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
>> > - permission java.util.PropertyPermission
>> > - "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR",
>> > "read";
>> > -
>> > - // Applications using Comet need to be able to access this package
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.comet";
>> > -};
>> > -
>> > -
>> > -// The Manager application needs access to the following packages to
>> > support the
>> > -// session display functionality. These settings support the following
>> > -// configurations:
>> > -// - default CATALINA_HOME == CATALINA_BASE
>> > -// - CATALINA_HOME != CATALINA_BASE, per instance Manager in
>> CATALINA_BASE
>> > -// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME
>> > -grant codeBase "file:${catalina.base}/webapps/manager/-" {
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina";
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.ha.session";
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.manager";
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.manager.util";
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.util";
>> > -};
>> > -grant codeBase "file:${catalina.home}/webapps/manager/-" {
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina";
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.ha.session";
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.manager";
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.manager.util";
>> > - permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.util";
>> > -};
>> > -
>> > -// You can assign additional permissions to particular web applications
>> by
>> > -// adding additional "grant" entries here, based on the code base for
>> that
>> > -// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
>> > -//
>> > -// Different permissions can be granted to JSP pages, classes loaded
>> from
>> > -// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
>> > -// directory, or even to individual jar files in the /WEB-INF/lib/
>> > directory.
>> > -//
>> > -// For instance, assume that the standard "examples" application
>> > -// included a JDBC driver that needed to establish a network connection
>> > to the
>> > -// corresponding database and used the scrape taglib to get the weather
>> > from
>> > -// the NOAA web server. You might create a "grant" entries like this:
>> > -//
>> > -// The permissions granted to the context root directory apply to JSP
>> > pages.
>> > -// grant codeBase "file:${catalina.base}/webapps/examples/-" {
>> > -// permission java.net.SocketPermission "dbhost.mycompany.com:5432
>> ",
>> > "connect";
>> > -// permission java.net.SocketPermission "*.noaa.gov:80",
>> "connect";
>> > -// };
>> > -//
>> > -// The permissions granted to the context WEB-INF/classes directory
>> > -// grant codeBase
>> > "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
>> > -// };
>> > -//
>> > -// The permission granted to your JDBC driver
>> > -// grant codeBase
>> > "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
>> > -// permission java.net.SocketPermission "dbhost.mycompany.com:5432
>> ",
>> > "connect";
>> > -// };
>> > -// The permission granted to the scrape taglib
>> > -// grant codeBase
>> > "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
>> > -// permission java.net.SocketPermission "*.noaa.gov:80",
>> "connect";
>> > -// };
>> > -
>> > +// 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.
>> > +
>> > +//
>> >
>> ============================================================================
>> > +// catalina.policy - Security Policy Permissions for Tomcat 7
>> > +//
>> > +// This file contains a default set of security policies to be enforced
>> > (by the
>> > +// JVM) when Catalina is executed with the "-security" option. In
>> > addition
>> > +// to the permissions granted here, the following additional permissions
>> > are
>> > +// granted specific to each web application:
>> > +//
>> > +// * Read access to its document root directory
>> > +// * Read, write and delete access to its working directory
>> > +//
>> > +// $Id: catalina.policy 1079755 2011-03-09 11:38:38Z markt $
>> > +//
>> >
>> ============================================================================
>> > +
>> > +
>> > +// ========== SYSTEM CODE PERMISSIONS
>> > =========================================
>> > +
>> > +
>> > +// These permissions apply to javac
>> > +grant codeBase "file:${java.home}/lib/-" {
>> > + permission java.security.AllPermission;
>> > +};
>> > +
>> > +// These permissions apply to all shared system extensions
>> > +grant codeBase "file:${java.home}/jre/lib/ext/-" {
>> > + permission java.security.AllPermission;
>> > +};
>> > +
>> > +// These permissions apply to javac when ${java.home] points at
>> > $JAVA_HOME/jre
>> > +grant codeBase "file:${java.home}/../lib/-" {
>> > + permission java.security.AllPermission;
>> > +};
>> > +
>> > +// These permissions apply to all shared system extensions when
>> > +// ${java.home} points at $JAVA_HOME/jre
>> > +grant codeBase "file:${java.home}/lib/ext/-" {
>> > + permission java.security.AllPermission;
>> > +};
>> > +
>> > +
>> > +// ========== CATALINA CODE PERMISSIONS
>> > =======================================
>> > +
>> > +
>> > +// These permissions apply to the daemon code
>> > +grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
>> > + permission java.security.AllPermission;
>> > +};
>> > +
>> > +// These permissions apply to the logging API
>> > +// Note: If tomcat-juli.jar is in ${catalina.base} and not in
>> > ${catalina.home},
>> > +// update this section accordingly.
>> > +// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..}
>> > +grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
>> > + permission java.io.FilePermission
>> > +
>> > "${java.home}${file.separator}lib${file.separator}logging.properties",
>> > "read";
>> > +
>> > + permission java.io.FilePermission
>> > +
>> >
>> "${catalina.base}${file.separator}conf${file.separator}logging.properties",
>> > "read";
>> > + permission java.io.FilePermission
>> > + "${catalina.base}${file.separator}logs", "read, write";
>> > + permission java.io.FilePermission
>> > + "${catalina.base}${file.separator}logs${file.separator}*",
>> > "read, write";
>> > +
>> > + permission java.lang.RuntimePermission "shutdownHooks";
>> > + permission java.lang.RuntimePermission "getClassLoader";
>> > + permission java.lang.RuntimePermission "setContextClassLoader";
>> > +
>> > + permission java.util.logging.LoggingPermission "control";
>> > +
>> > + permission java.util.PropertyPermission
>> > "java.util.logging.config.class", "read";
>> > + permission java.util.PropertyPermission
>> > "java.util.logging.config.file", "read";
>> > + permission java.util.PropertyPermission "catalina.base", "read";
>> > +
>> > + // Note: To enable per context logging configuration, permit
>> read
>> > access to
>> > + // the appropriate file. Be sure that the logging configuration
>> is
>> > + // secure before enabling such access.
>> > + // E.g. for the examples web application:
>> > + // permission java.io.FilePermission
>> > "${catalina.base}${file.separator}
>> > + // webapps${file.separator}examples${file.separator}WEB-INF
>> > + //
>> ${file.separator}classes${file.separator}logging.properties",
>> > "read";
>> > +};
>> > +
>> > +// These permissions apply to the server startup code
>> > +grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
>> > + permission java.security.AllPermission;
>> > +};
>> > +
>> > +// These permissions apply to the servlet API classes
>> > +// and those that are shared across all class loaders
>> > +// located in the "lib" directory
>> > +grant codeBase "file:${catalina.home}/lib/-" {
>> > + permission java.security.AllPermission;
>> > +};
>> > +
>> > +
>> > +// If using a per instance lib directory, i.e. ${catalina.base}/lib,
>> > +// then the following permission will need to be uncommented
>> > +// grant codeBase "file:${catalina.base}/lib/-" {
>> > +// permission java.security.AllPermission;
>> > +// };
>> > +
>> > +
>> > +// ========== WEB APPLICATION PERMISSIONS
>> > =====================================
>> > +
>> > +
>> > +// These permissions are granted by default to all web applications
>> > +// In addition, a web application will be given a read FilePermission
>> > +// and JndiPermission for all files and directories in its document
>> root.
>> > +grant {
>> > + // Required for JNDI lookup of named JDBC DataSource's and
>> > + // javamail named MimePart DataSource used to send mail
>> > + permission java.util.PropertyPermission "java.home", "read";
>> > + permission java.util.PropertyPermission "java.naming.*", "read";
>> > + permission java.util.PropertyPermission "javax.sql.*", "read";
>> > +
>> > + // OS Specific properties to allow read access
>> > + permission java.util.PropertyPermission "os.name", "read";
>> > + permission java.util.PropertyPermission "os.version", "read";
>> > + permission java.util.PropertyPermission "os.arch", "read";
>> > + permission java.util.PropertyPermission "file.separator", "read";
>> > + permission java.util.PropertyPermission "path.separator", "read";
>> > + permission java.util.PropertyPermission "line.separator", "read";
>> > +
>> > + // JVM properties to allow read access
>> > + permission java.util.PropertyPermission "java.version", "read";
>> > + permission java.util.PropertyPermission "java.vendor", "read";
>> > + permission java.util.PropertyPermission "java.vendor.url", "read";
>> > + permission java.util.PropertyPermission "java.class.version",
>> "read";
>> > + permission java.util.PropertyPermission
>> "java.specification.version",
>> > "read";
>> > + permission java.util.PropertyPermission "java.specification.vendor",
>> > "read";
>> > + permission java.util.PropertyPermission "java.specification.name",
>> > "read";
>> > +
>> > + permission java.util.PropertyPermission
>> > "java.vm.specification.version", "read";
>> > + permission java.util.PropertyPermission
>> > "java.vm.specification.vendor", "read";
>> > + permission java.util.PropertyPermission "java.vm.specification.name
>> ",
>> > "read";
>> > + permission java.util.PropertyPermission "java.vm.version", "read";
>> > + permission java.util.PropertyPermission "java.vm.vendor", "read";
>> > + permission java.util.PropertyPermission "java.vm.name", "read";
>> > +
>> > + // Required for OpenJMX
>> > + permission java.lang.RuntimePermission "getAttribute";
>> > +
>> > + // Allow read of JAXP compliant XML parser debug
>> > + permission java.util.PropertyPermission "jaxp.debug", "read";
>> > +
>> > + // All JSPs need to be able to read this package
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.tomcat";
>> > +
>> > + // Precompiled JSPs need access to these packages.
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.jasper.el";
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.jasper.runtime";
>> > + permission java.lang.RuntimePermission
>> > + "accessClassInPackage.org.apache.jasper.runtime.*";
>> > +
>> > + // Precompiled JSPs need access to these system properties.
>> > + permission java.util.PropertyPermission
>> > + "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read";
>> > + permission java.util.PropertyPermission
>> > + "org.apache.el.parser.COERCE_TO_ZERO", "read";
>> > +
>> > + // The cookie code needs these.
>> > + permission java.util.PropertyPermission
>> > + "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
>> > + permission java.util.PropertyPermission
>> > + "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
>> > + permission java.util.PropertyPermission
>> > + "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR",
>> > "read";
>> > +
>> > + // Applications using Comet need to be able to access this package
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.comet";
>> > +};
>> > +
>> > +
>> > +// The Manager application needs access to the following packages to
>> > support the
>> > +// session display functionality. These settings support the following
>> > +// configurations:
>> > +// - default CATALINA_HOME == CATALINA_BASE
>> > +// - CATALINA_HOME != CATALINA_BASE, per instance Manager in
>> CATALINA_BASE
>> > +// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME
>> > +grant codeBase "file:${catalina.base}/webapps/manager/-" {
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina";
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.ha.session";
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.manager";
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.manager.util";
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.util";
>> > +};
>> > +grant codeBase "file:${catalina.home}/webapps/manager/-" {
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina";
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.ha.session";
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.manager";
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.manager.util";
>> > + permission java.lang.RuntimePermission
>> > "accessClassInPackage.org.apache.catalina.util";
>> > +};
>> > +
>> > +// You can assign additional permissions to particular web applications
>> by
>> > +// adding additional "grant" entries here, based on the code base for
>> that
>> > +// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
>> > +//
>> > +// Different permissions can be granted to JSP pages, classes loaded
>> from
>> > +// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
>> > +// directory, or even to individual jar files in the /WEB-INF/lib/
>> > directory.
>> > +//
>> > +// For instance, assume that the standard "examples" application
>> > +// included a JDBC driver that needed to establish a network connection
>> > to the
>> > +// corresponding database and used the scrape taglib to get the weather
>> > from
>> > +// the NOAA web server. You might create a "grant" entries like this:
>> > +//
>> > +// The permissions granted to the context root directory apply to JSP
>> > pages.
>> > +// grant codeBase "file:${catalina.base}/webapps/examples/-" {
>> > +// permission java.net.SocketPermission "dbhost.mycompany.com:5432
>> ",
>> > "connect";
>> > +// permission java.net.SocketPermission "*.noaa.gov:80",
>> "connect";
>> > +// };
>> > +//
>> > +// The permissions granted to the context WEB-INF/classes directory
>> > +// grant codeBase
>> > "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
>> > +// };
>> > +//
>> > +// The permission granted to your JDBC driver
>> > +// grant codeBase
>> > "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
>> > +// permission java.net.SocketPermission "dbhost.mycompany.com:5432
>> ",
>> > "connect";
>> > +// };
>> > +// The permission granted to the scrape taglib
>> > +// grant codeBase
>> > "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
>> > +// permission java.net.SocketPermission "*.noaa.gov:80",
>> "connect";
>> > +// };
>> > +
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
>> > ----------------------------------------------------------------------
>> > diff --git
>> >
>> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
>> >
>> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
>> > index 5089043..ff86449 100644
>> > ---
>> >
>> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
>> > +++
>> >
>> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
>> > @@ -1,122 +1,122 @@
>> > -# 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.
>> > -
>> > -#
>> > -# List of comma-separated packages that start with or equal this string
>> > -# will cause a security exception to be thrown when
>> > -# passed to checkPackageAccess unless the
>> > -# corresponding RuntimePermission ("accessClassInPackage."+package) has
>> > -# been granted.
>> >
>> >
>> -package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
>> > -#
>> > -# List of comma-separated packages that start with or equal this string
>> > -# will cause a security exception to be thrown when
>> > -# passed to checkPackageDefinition unless the
>> > -# corresponding RuntimePermission ("defineClassInPackage."+package) has
>> > -# been granted.
>> > -#
>> > -# by default, no packages are restricted for definition, and none of
>> > -# the class loaders supplied with the JDK call checkPackageDefinition.
>> > -#
>> >
>> >
>> -package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
>> > -
>> > -#
>> > -#
>> > -# List of comma-separated paths defining the contents of the "common"
>> > -# classloader. Prefixes should be used to define what is the repository
>> > type.
>> > -# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
>> > absolute.
>> > -# If left as blank,the JVM system loader will be used as Catalina's
>> > "common"
>> > -# loader.
>> > -# Examples:
>> > -# "foo": Add this folder as a class repository
>> > -# "foo/*.jar": Add all the JARs of the specified folder as class
>> > -# repositories
>> > -# "foo/bar.jar": Add bar.jar as a class repository
>> >
>> >
>> -common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
>> > -
>> > -#
>> > -# List of comma-separated paths defining the contents of the "server"
>> > -# classloader. Prefixes should be used to define what is the repository
>> > type.
>> > -# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
>> > absolute.
>> > -# If left as blank, the "common" loader will be used as Catalina's
>> > "server"
>> > -# loader.
>> > -# Examples:
>> > -# "foo": Add this folder as a class repository
>> > -# "foo/*.jar": Add all the JARs of the specified folder as class
>> > -# repositories
>> > -# "foo/bar.jar": Add bar.jar as a class repository
>> > -server.loader=
>> > -
>> > -#
>> > -# List of comma-separated paths defining the contents of the "shared"
>> > -# classloader. Prefixes should be used to define what is the repository
>> > type.
>> > -# Path may be relative to the CATALINA_BASE path or absolute. If left as
>> > blank,
>> > -# the "common" loader will be used as Catalina's "shared" loader.
>> > -# Examples:
>> > -# "foo": Add this folder as a class repository
>> > -# "foo/*.jar": Add all the JARs of the specified folder as class
>> > -# repositories
>> > -# "foo/bar.jar": Add bar.jar as a class repository
>> > -# Please note that for single jars, e.g. bar.jar, you need the URL form
>> > -# starting with file:.
>> > -shared.loader=
>> > -
>> > -# List of JAR files that should not be scanned for configuration
>> > information
>> > -# such as web fragments, TLD files etc. It must be a comma separated
>> list
>> > of
>> > -# JAR file names.
>> > -# The JARs listed below include:
>> > -# - Tomcat Bootstrap JARs
>> > -# - Tomcat API JARs
>> > -# - Catalina JARs
>> > -# - Jasper JARs
>> > -# - Tomcat JARs
>> > -# - Common non-Tomcat JARs
>> > -# - Sun JDK JARs
>> > -# - Apple JDK JARs
>> > -tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
>> > -bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
>> > -annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\
>> > -catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\
>> > -jasper.jar,jasper-el.jar,ecj-*.jar,\
>> > -tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\
>> >
>> >
>> -tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\
>> > -commons-beanutils*.jar,commons-collections*.jar,commons-dbcp*.jar,\
>> > -commons-digester*.jar,commons-fileupload*.jar,commons-logging*.jar,\
>> > -commons-pool*.jar,\
>> > -bcprov-*.jar,\
>> > -ant.jar,jmx.jar,jmx-tools.jar,\
>> > -xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
>> >
>> >
>> -dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunpkcs11.jar,tools.jar,\
>> > -apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\
>> > -j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\
>> > -mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\
>> > -hsqldb-*,openejb-core-*,xbean-*,derby*,mbean-annotation-*,\
>> >
>> >
>> -javassit*,commons-*,swizzle-stream-*,serp-*,geronimo-javamail-*,geronimo-mail-*,\
>> >
>> >
>> -openejb-jee-*,openejb-core-*,openejb-loader-*,openejb-api-*,openejb-derby*,\
>> > -openwebbeans-ejb-*,openwebbeans-impl-*,\
>> > -bval-*,\
>> >
>> >
>> -tomee-loader-*,openejb-javaagent-*,openejb-ejbd-*,scannotation-*,openejb-server-*,\
>> > -openjpa-*,quartz-*,openejb-http-*,kahadb-*
>> > -
>> > -#
>> > -# String cache configuration.
>> > -tomcat.util.buf.StringCache.byte.enabled=true
>> > -#tomcat.util.buf.StringCache.char.enabled=true
>> > -#tomcat.util.buf.StringCache.trainThreshold=500000
>> > -#tomcat.util.buf.StringCache.cacheSize=5000
>> > -
>> > -http.port=${tomcatHttpPort}
>> > -shutdown.port=${tomcatShutdownPort}
>> > +# 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.
>> > +
>> > +#
>> > +# List of comma-separated packages that start with or equal this string
>> > +# will cause a security exception to be thrown when
>> > +# passed to checkPackageAccess unless the
>> > +# corresponding RuntimePermission ("accessClassInPackage."+package) has
>> > +# been granted.
>> >
>> >
>> +package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
>> > +#
>> > +# List of comma-separated packages that start with or equal this string
>> > +# will cause a security exception to be thrown when
>> > +# passed to checkPackageDefinition unless the
>> > +# corresponding RuntimePermission ("defineClassInPackage."+package) has
>> > +# been granted.
>> > +#
>> > +# by default, no packages are restricted for definition, and none of
>> > +# the class loaders supplied with the JDK call checkPackageDefinition.
>> > +#
>> >
>> >
>> +package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
>> > +
>> > +#
>> > +#
>> > +# List of comma-separated paths defining the contents of the "common"
>> > +# classloader. Prefixes should be used to define what is the repository
>> > type.
>> > +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
>> > absolute.
>> > +# If left as blank,the JVM system loader will be used as Catalina's
>> > "common"
>> > +# loader.
>> > +# Examples:
>> > +# "foo": Add this folder as a class repository
>> > +# "foo/*.jar": Add all the JARs of the specified folder as class
>> > +# repositories
>> > +# "foo/bar.jar": Add bar.jar as a class repository
>> >
>> >
>> +common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
>> > +
>> > +#
>> > +# List of comma-separated paths defining the contents of the "server"
>> > +# classloader. Prefixes should be used to define what is the repository
>> > type.
>> > +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
>> > absolute.
>> > +# If left as blank, the "common" loader will be used as Catalina's
>> > "server"
>> > +# loader.
>> > +# Examples:
>> > +# "foo": Add this folder as a class repository
>> > +# "foo/*.jar": Add all the JARs of the specified folder as class
>> > +# repositories
>> > +# "foo/bar.jar": Add bar.jar as a class repository
>> > +server.loader=
>> > +
>> > +#
>> > +# List of comma-separated paths defining the contents of the "shared"
>> > +# classloader. Prefixes should be used to define what is the repository
>> > type.
>> > +# Path may be relative to the CATALINA_BASE path or absolute. If left as
>> > blank,
>> > +# the "common" loader will be used as Catalina's "shared" loader.
>> > +# Examples:
>> > +# "foo": Add this folder as a class repository
>> > +# "foo/*.jar": Add all the JARs of the specified folder as class
>> > +# repositories
>> > +# "foo/bar.jar": Add bar.jar as a class repository
>> > +# Please note that for single jars, e.g. bar.jar, you need the URL form
>> > +# starting with file:.
>> > +shared.loader=
>> > +
>> > +# List of JAR files that should not be scanned for configuration
>> > information
>> > +# such as web fragments, TLD files etc. It must be a comma separated
>> list
>> > of
>> > +# JAR file names.
>> > +# The JARs listed below include:
>> > +# - Tomcat Bootstrap JARs
>> > +# - Tomcat API JARs
>> > +# - Catalina JARs
>> > +# - Jasper JARs
>> > +# - Tomcat JARs
>> > +# - Common non-Tomcat JARs
>> > +# - Sun JDK JARs
>> > +# - Apple JDK JARs
>> > +tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
>> > +bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
>> > +annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\
>> > +catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\
>> > +jasper.jar,jasper-el.jar,ecj-*.jar,\
>> > +tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\
>> >
>> >
>> +tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\
>> > +commons-beanutils*.jar,commons-collections*.jar,commons-dbcp*.jar,\
>> > +commons-digester*.jar,commons-fileupload*.jar,commons-logging*.jar,\
>> > +commons-pool*.jar,\
>> > +bcprov-*.jar,\
>> > +ant.jar,jmx.jar,jmx-tools.jar,\
>> > +xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
>> >
>> >
>> +dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunpkcs11.jar,tools.jar,\
>> > +apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\
>> > +j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\
>> > +mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\
>> > +hsqldb-*,openejb-core-*,xbean-*,derby*,mbean-annotation-*,\
>> >
>> >
>> +javassit*,commons-*,swizzle-stream-*,serp-*,geronimo-javamail-*,geronimo-mail-*,\
>> >
>> >
>> +openejb-jee-*,openejb-core-*,openejb-loader-*,openejb-api-*,openejb-derby*,\
>> > +openwebbeans-ejb-*,openwebbeans-impl-*,\
>> > +bval-*,\
>> >
>> >
>> +tomee-loader-*,openejb-javaagent-*,openejb-ejbd-*,scannotation-*,openejb-server-*,\
>> > +openjpa-*,quartz-*,openejb-http-*,kahadb-*
>> > +
>> > +#
>> > +# String cache configuration.
>> > +tomcat.util.buf.StringCache.byte.enabled=true
>> > +#tomcat.util.buf.StringCache.char.enabled=true
>> > +#tomcat.util.buf.StringCache.trainThreshold=500000
>> > +#tomcat.util.buf.StringCache.cacheSize=5000
>> > +
>> > +http.port=${tomcatHttpPort}
>> > +shutdown.port=${tomcatShutdownPort}
>> > shutdown.command=${tomcatShutdownCommand}
>> > \ No newline at end of file
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
>> > ----------------------------------------------------------------------
>> > diff --git
>> > a/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
>> > b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
>> > index abbc097..8f828b9 100644
>> > ---
>> > a/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
>> > +++
>> > b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
>> > @@ -1,26 +1,26 @@
>> > -/**
>> > - * 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.tomee.embedded;
>> > -
>> > -import javax.ejb.Singleton;
>> > -
>> > -@Singleton
>> > -public class ABean {
>> > - public String embedded() {
>> > - return "ok";
>> > - }
>> > -}
>> > +/**
>> > + * 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.tomee.embedded;
>> > +
>> > +import javax.ejb.Singleton;
>> > +
>> > +@Singleton
>> > +public class ABean {
>> > + public String embedded() {
>> > + return "ok";
>> > + }
>> > +}
>> >
>> >
>> >
>> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
>> > ----------------------------------------------------------------------
>> > diff --git a/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
>> > b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
>> > index e0d7a63..b1514dd 100644
>> > --- a/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
>> > +++ b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
>> > @@ -1,19 +1,19 @@
>> > -<?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.
>> > --->
>> > -<beans />
>> > +<?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.
>> > +-->
>> > +<beans />
>> >
>> >
>>
>
>
>
> --
> Daniel Cunha
> https://twitter.com/dvlc_
> http://www.tomitribe.com
Re: [2/3] tomee git commit: EOL commit
Posted by Daniel Cunha <da...@gmail.com>.
I've the same problem here.
On Wed, Nov 18, 2015 at 10:21 PM, Thiago Veronezi <th...@veronezi.org>
wrote:
> Hey Romain,
>
> What is this commit about? Removing windows line endings?
> Now when I pull the source code, my local git says I have changed files
> that I never touched. Am I missing a config locally?
>
> []s,
> Thiago
>
> On Wed, Nov 18, 2015 at 3:18 PM, <rm...@apache.org> wrote:
>
> >
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/build.xml
> > ----------------------------------------------------------------------
> > diff --git a/tomee/build.xml b/tomee/build.xml
> > index eff1327..c660e7c 100644
> > --- a/tomee/build.xml
> > +++ b/tomee/build.xml
> > @@ -1,46 +1,46 @@
> > -<?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="dev-helper" default="web">
> > -
> > - <target name="web">
> > - <copy verbose="true"
> >
> todir="apache-tomee/target/apache-tomee-webprofile-7.0.0-SNAPSHOT/webapps/tomee">
> > - <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.js"/>
> > - <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.css"/>
> > - <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.html"/>
> > - </copy>
> > - </target>
> > -
> > - <target name="rs">
> > - <copy verbose="true"
> >
> todir="apache-tomee/target/apache-tomee-jaxrs-7.0.0-SNAPSHOT/webapps/tomee">
> > - <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.js"/>
> > - <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.css"/>
> > - <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.html"/>
> > - </copy>
> > - </target>
> > -
> > - <target name="plus">
> > - <copy verbose="true"
> >
> todir="apache-tomee/target/apache-tomee-plus-7.0.0-SNAPSHOT/webapps/tomee">
> > - <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.js"/>
> > - <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.css"/>
> > - <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.html"/>
> > - </copy>
> > - </target>
> > -
> > -</project>
> > -
> > +<?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="dev-helper" default="web">
> > +
> > + <target name="web">
> > + <copy verbose="true"
> >
> todir="apache-tomee/target/apache-tomee-webprofile-7.0.0-SNAPSHOT/webapps/tomee">
> > + <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.js"/>
> > + <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.css"/>
> > + <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.html"/>
> > + </copy>
> > + </target>
> > +
> > + <target name="rs">
> > + <copy verbose="true"
> >
> todir="apache-tomee/target/apache-tomee-jaxrs-7.0.0-SNAPSHOT/webapps/tomee">
> > + <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.js"/>
> > + <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.css"/>
> > + <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.html"/>
> > + </copy>
> > + </target>
> > +
> > + <target name="plus">
> > + <copy verbose="true"
> >
> todir="apache-tomee/target/apache-tomee-plus-7.0.0-SNAPSHOT/webapps/tomee">
> > + <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.js"/>
> > + <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.css"/>
> > + <fileset dir="tomee-webapp/src/main/webapp"
> > includes="**/*.html"/>
> > + </copy>
> > + </target>
> > +
> > +</project>
> > +
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
> > ----------------------------------------------------------------------
> > diff --git
> >
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
> >
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
> > index 2ca6ac6..2208d91 100644
> > ---
> >
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
> > +++
> >
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
> > @@ -1,165 +1,165 @@
> > -/*
> > - * 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.tomee.catalina;
> > -
> > -import org.apache.catalina.Container;
> > -import org.apache.catalina.Context;
> > -import org.apache.catalina.Globals;
> > -import org.apache.catalina.Host;
> > -import org.apache.catalina.core.StandardContext;
> > -import org.apache.catalina.core.StandardEngine;
> > -import org.apache.catalina.core.StandardHost;
> > -import org.apache.catalina.util.ContextName;
> > -
> > -import java.io.File;
> > -import java.io.IOException;
> > -
> > -public class Contexts {
> > - public static String getHostname(final StandardContext ctx) {
> > - String hostName = null;
> > - final Container parentHost = ctx.getParent();
> > - if (parentHost != null) {
> > - hostName = parentHost.getName();
> > - }
> > - if ((hostName == null) || (hostName.length() < 1)) {
> > - hostName = "_";
> > - }
> > - return hostName;
> > - }
> > -
> > - public static File warPath(final Context standardContext) {
> > - final File file = realWarPath(standardContext);
> > - if (file == null) {
> > - return null;
> > - }
> > -
> > - final String name = file.getName();
> > - if (!file.isDirectory() && name.endsWith(".war")) {
> > - final File extracted = new File(file.getParentFile(),
> > name.substring(0, name.length() - ".war".length()));
> > - if (extracted.exists()) {
> > - try {
> > - return extracted.getCanonicalFile();
> > - } catch (final IOException e) {
> > - return extracted;
> > - }
> > - }
> > - }
> > - try {
> > - return file.getCanonicalFile();
> > - } catch (final IOException e) {
> > - return file;
> > - }
> > - }
> > -
> > - public static File realWarPath(final Context standardContext) {
> > - if (standardContext == null) {
> > - return null;
> > - }
> > -
> > - final File docBase;
> > - Container container = standardContext;
> > - while (container != null) {
> > - if (container instanceof Host) {
> > - break;
> > - }
> > - container = container.getParent();
> > - }
> > -
> > - String baseName = null;
> > - if (standardContext.getDocBase() != null) {
> > - File file = new File(standardContext.getDocBase());
> > - if (!file.isAbsolute()) {
> > - if (container == null) {
> > - docBase = new File(engineBase(standardContext),
> > standardContext.getDocBase());
> > - } else {
> > - final String appBase = ((Host)
> > container).getAppBase();
> > - file = new File(appBase);
> > - if (!file.isAbsolute()) {
> > - file = new File(engineBase(standardContext),
> > appBase);
> > - }
> > - docBase = new File(file,
> > standardContext.getDocBase());
> > - }
> > - } else {
> > - docBase = file;
> > - }
> > - } else {
> > - final String path = standardContext.getPath();
> > - if (path == null) {
> > - throw new IllegalStateException("Can't find docBase");
> > - } else {
> > - baseName = new ContextName(path,
> > standardContext.getWebappVersion()).getBaseName();
> > - docBase = new File(baseName);
> > - }
> > - }
> > -
> > - if (!docBase.exists() && baseName != null) { // for old
> > compatibility, will be removed soon
> > - if (Host.class.isInstance(container)) {
> > - final File file = new
> > File(Host.class.cast(container).getAppBaseFile(), baseName);
> > - if (file.exists()) {
> > - return file;
> > - }
> > - }
> > - return oldRealWarPath(standardContext);
> > - }
> > -
> > - final String name = docBase.getName();
> > - if (name.endsWith(".war")) {
> > - final File extracted = new File(docBase.getParentFile(),
> > name.substring(0, name.length() - ".war".length()));
> > - if (extracted.exists()) {
> > - return extracted;
> > - }
> > - }
> > -
> > - return docBase;
> > - }
> > -
> > - private static File engineBase(final Context standardContext) {
> > - final String base =
> > System.getProperty(Globals.CATALINA_BASE_PROP);
> > - if( base == null ) {
> > - final StandardEngine eng = (StandardEngine)
> > standardContext.getParent().getParent();
> > - return eng.getCatalinaBase();
> > - }
> > - return new File(base);
> > - }
> > -
> > - @Deprecated
> > - private static File oldRealWarPath(final Context standardContext) {
> > - String doc = standardContext.getDocBase();
> > - // handle ROOT case
> > - if (doc == null || doc.length() == 0) {
> > - doc = "ROOT";
> > - }
> > -
> > - File war = new File(doc);
> > - if (war.exists()) {
> > - return war;
> > - }
> > -
> > - final StandardHost host = (StandardHost)
> > standardContext.getParent();
> > - final String base = host.getAppBase();
> > - war = new File(base, doc);
> > - if (war.exists()) {
> > - return war;
> > - }
> > -
> > - war = new File(new File(System.getProperty("catalina.home"),
> > base), doc);
> > - if (war.exists()) {
> > - return war;
> > - }
> > - return new File(new File(System.getProperty("catalina.base"),
> > base), doc); // shouldn't occur
> > - }
> > -}
> > +/*
> > + * 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.tomee.catalina;
> > +
> > +import org.apache.catalina.Container;
> > +import org.apache.catalina.Context;
> > +import org.apache.catalina.Globals;
> > +import org.apache.catalina.Host;
> > +import org.apache.catalina.core.StandardContext;
> > +import org.apache.catalina.core.StandardEngine;
> > +import org.apache.catalina.core.StandardHost;
> > +import org.apache.catalina.util.ContextName;
> > +
> > +import java.io.File;
> > +import java.io.IOException;
> > +
> > +public class Contexts {
> > + public static String getHostname(final StandardContext ctx) {
> > + String hostName = null;
> > + final Container parentHost = ctx.getParent();
> > + if (parentHost != null) {
> > + hostName = parentHost.getName();
> > + }
> > + if ((hostName == null) || (hostName.length() < 1)) {
> > + hostName = "_";
> > + }
> > + return hostName;
> > + }
> > +
> > + public static File warPath(final Context standardContext) {
> > + final File file = realWarPath(standardContext);
> > + if (file == null) {
> > + return null;
> > + }
> > +
> > + final String name = file.getName();
> > + if (!file.isDirectory() && name.endsWith(".war")) {
> > + final File extracted = new File(file.getParentFile(),
> > name.substring(0, name.length() - ".war".length()));
> > + if (extracted.exists()) {
> > + try {
> > + return extracted.getCanonicalFile();
> > + } catch (final IOException e) {
> > + return extracted;
> > + }
> > + }
> > + }
> > + try {
> > + return file.getCanonicalFile();
> > + } catch (final IOException e) {
> > + return file;
> > + }
> > + }
> > +
> > + public static File realWarPath(final Context standardContext) {
> > + if (standardContext == null) {
> > + return null;
> > + }
> > +
> > + final File docBase;
> > + Container container = standardContext;
> > + while (container != null) {
> > + if (container instanceof Host) {
> > + break;
> > + }
> > + container = container.getParent();
> > + }
> > +
> > + String baseName = null;
> > + if (standardContext.getDocBase() != null) {
> > + File file = new File(standardContext.getDocBase());
> > + if (!file.isAbsolute()) {
> > + if (container == null) {
> > + docBase = new File(engineBase(standardContext),
> > standardContext.getDocBase());
> > + } else {
> > + final String appBase = ((Host)
> > container).getAppBase();
> > + file = new File(appBase);
> > + if (!file.isAbsolute()) {
> > + file = new File(engineBase(standardContext),
> > appBase);
> > + }
> > + docBase = new File(file,
> > standardContext.getDocBase());
> > + }
> > + } else {
> > + docBase = file;
> > + }
> > + } else {
> > + final String path = standardContext.getPath();
> > + if (path == null) {
> > + throw new IllegalStateException("Can't find docBase");
> > + } else {
> > + baseName = new ContextName(path,
> > standardContext.getWebappVersion()).getBaseName();
> > + docBase = new File(baseName);
> > + }
> > + }
> > +
> > + if (!docBase.exists() && baseName != null) { // for old
> > compatibility, will be removed soon
> > + if (Host.class.isInstance(container)) {
> > + final File file = new
> > File(Host.class.cast(container).getAppBaseFile(), baseName);
> > + if (file.exists()) {
> > + return file;
> > + }
> > + }
> > + return oldRealWarPath(standardContext);
> > + }
> > +
> > + final String name = docBase.getName();
> > + if (name.endsWith(".war")) {
> > + final File extracted = new File(docBase.getParentFile(),
> > name.substring(0, name.length() - ".war".length()));
> > + if (extracted.exists()) {
> > + return extracted;
> > + }
> > + }
> > +
> > + return docBase;
> > + }
> > +
> > + private static File engineBase(final Context standardContext) {
> > + final String base =
> > System.getProperty(Globals.CATALINA_BASE_PROP);
> > + if( base == null ) {
> > + final StandardEngine eng = (StandardEngine)
> > standardContext.getParent().getParent();
> > + return eng.getCatalinaBase();
> > + }
> > + return new File(base);
> > + }
> > +
> > + @Deprecated
> > + private static File oldRealWarPath(final Context standardContext) {
> > + String doc = standardContext.getDocBase();
> > + // handle ROOT case
> > + if (doc == null || doc.length() == 0) {
> > + doc = "ROOT";
> > + }
> > +
> > + File war = new File(doc);
> > + if (war.exists()) {
> > + return war;
> > + }
> > +
> > + final StandardHost host = (StandardHost)
> > standardContext.getParent();
> > + final String base = host.getAppBase();
> > + war = new File(base, doc);
> > + if (war.exists()) {
> > + return war;
> > + }
> > +
> > + war = new File(new File(System.getProperty("catalina.home"),
> > base), doc);
> > + if (war.exists()) {
> > + return war;
> > + }
> > + return new File(new File(System.getProperty("catalina.base"),
> > base), doc); // shouldn't occur
> > + }
> > +}
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
> > ----------------------------------------------------------------------
> > diff --git
> >
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
> >
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
> > index eee2d2a..2308db0 100644
> > ---
> >
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
> > +++
> >
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
> > @@ -1,121 +1,121 @@
> > -/*
> > - * 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.tomee.catalina;
> > -
> > -import org.apache.catalina.Context;
> > -import org.apache.catalina.LifecycleException;
> > -import org.apache.catalina.loader.WebappLoader;
> > -import org.apache.openejb.ClassLoaderUtil;
> > -import org.apache.openejb.classloader.ClassLoaderConfigurer;
> > -import org.apache.openejb.classloader.CompositeClassLoaderConfigurer;
> > -import org.apache.openejb.config.QuickJarsTxtParser;
> > -import org.apache.openejb.loader.SystemInstance;
> > -
> > -import java.io.File;
> > -
> > -/**
> > - * Usage example in META-INF/context.xml
> > - * <p/>
> > - * <p/>
> > - * <Context antiJARLocking="true" >
> > - * <Loader
> > - * className="org.apache.tomee.catalina.ProvisioningWebappLoader"
> > - * searchExternalFirst="true"
> > - *
> >
> virtualClasspath="mvn:commons-el:commons-el:1.0;mvn:commons-el:commons-el:1.0"
> > - * searchVirtualFirst="true"
> > - * />
> > - * </Context>
> > - */
> > -public class TomEEWebappLoader extends WebappLoader {
> > - public static final boolean SKIP_BACKGROUND_PROCESS =
> >
> "true".equals(SystemInstance.get().getProperty("tomee.classloader.skip-background-process",
> > "false"));
> > -
> > - private volatile ClassLoader loader;
> > -
> > - @Override
> > - public void backgroundProcess() {
> > - if (SKIP_BACKGROUND_PROCESS) {
> > - return;
> > - }
> > -
> > - final ClassLoader classloader = super.getClassLoader();
> > - if (classloader instanceof TomEEWebappClassLoader) {
> > - final TomEEWebappClassLoader tomEEWebappClassLoader =
> > (TomEEWebappClassLoader) classloader;
> > - tomEEWebappClassLoader.restarting();
> > - try {
> > - super.backgroundProcess();
> > - } finally {
> > - tomEEWebappClassLoader.restarted();
> > - }
> > - } else {
> > - super.backgroundProcess();
> > - }
> > - }
> > -
> > - @Override
> > - public boolean modified() {
> > - return !SKIP_BACKGROUND_PROCESS && super.modified();
> > - }
> > -
> > - @Override
> > - protected void stopInternal() throws LifecycleException {
> > - loader = getClassLoader();
> > - super.stopInternal();
> > - }
> > -
> > - public void clearLoader() {
> > - loader = null;
> > - }
> > -
> > - public ClassLoader internalLoader() {
> > - return loader;
> > - }
> > -
> > - @Override
> > - protected void startInternal() throws LifecycleException {
> > - if (getClassLoader() != null) {
> > - final TomEEWebappClassLoader webappClassLoader =
> > TomEEWebappClassLoader.class.cast(getClassLoader());
> > - if (webappClassLoader.isStopped()) {
> > - webappClassLoader.internalStop();
> > - }
> > - }
> > -
> > - final Context context = getContext();
> > -
> > - ClassLoaderConfigurer configurer =
> > ClassLoaderUtil.configurer(context.getName());
> > -
> > - // WEB-INF/jars.xml
> > - final File war = Contexts.warPath(Context.class.cast(context));
> > - final File jarsXml = new File(war, "WEB-INF/" +
> > QuickJarsTxtParser.FILE_NAME);
> > - final ClassLoaderConfigurer configurerTxt =
> > QuickJarsTxtParser.parse(jarsXml);
> > - if (configurerTxt != null) {
> > - configurer = new CompositeClassLoaderConfigurer(configurer,
> > configurerTxt);
> > - }
> > -
> > - TomEEWebappClassLoader.initContext(configurer);
> > - TomEEWebappClassLoader.initContext(context);
> > - try {
> > - super.startInternal();
> > - } finally {
> > - TomEEWebappClassLoader.cleanContext();
> > - }
> > - }
> > -
> > - @Override
> > - public String toString() {
> > - return "TomEE" + super.toString();
> > - }
> > -}
> > +/*
> > + * 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.tomee.catalina;
> > +
> > +import org.apache.catalina.Context;
> > +import org.apache.catalina.LifecycleException;
> > +import org.apache.catalina.loader.WebappLoader;
> > +import org.apache.openejb.ClassLoaderUtil;
> > +import org.apache.openejb.classloader.ClassLoaderConfigurer;
> > +import org.apache.openejb.classloader.CompositeClassLoaderConfigurer;
> > +import org.apache.openejb.config.QuickJarsTxtParser;
> > +import org.apache.openejb.loader.SystemInstance;
> > +
> > +import java.io.File;
> > +
> > +/**
> > + * Usage example in META-INF/context.xml
> > + * <p/>
> > + * <p/>
> > + * <Context antiJARLocking="true" >
> > + * <Loader
> > + * className="org.apache.tomee.catalina.ProvisioningWebappLoader"
> > + * searchExternalFirst="true"
> > + *
> >
> virtualClasspath="mvn:commons-el:commons-el:1.0;mvn:commons-el:commons-el:1.0"
> > + * searchVirtualFirst="true"
> > + * />
> > + * </Context>
> > + */
> > +public class TomEEWebappLoader extends WebappLoader {
> > + public static final boolean SKIP_BACKGROUND_PROCESS =
> >
> "true".equals(SystemInstance.get().getProperty("tomee.classloader.skip-background-process",
> > "false"));
> > +
> > + private volatile ClassLoader loader;
> > +
> > + @Override
> > + public void backgroundProcess() {
> > + if (SKIP_BACKGROUND_PROCESS) {
> > + return;
> > + }
> > +
> > + final ClassLoader classloader = super.getClassLoader();
> > + if (classloader instanceof TomEEWebappClassLoader) {
> > + final TomEEWebappClassLoader tomEEWebappClassLoader =
> > (TomEEWebappClassLoader) classloader;
> > + tomEEWebappClassLoader.restarting();
> > + try {
> > + super.backgroundProcess();
> > + } finally {
> > + tomEEWebappClassLoader.restarted();
> > + }
> > + } else {
> > + super.backgroundProcess();
> > + }
> > + }
> > +
> > + @Override
> > + public boolean modified() {
> > + return !SKIP_BACKGROUND_PROCESS && super.modified();
> > + }
> > +
> > + @Override
> > + protected void stopInternal() throws LifecycleException {
> > + loader = getClassLoader();
> > + super.stopInternal();
> > + }
> > +
> > + public void clearLoader() {
> > + loader = null;
> > + }
> > +
> > + public ClassLoader internalLoader() {
> > + return loader;
> > + }
> > +
> > + @Override
> > + protected void startInternal() throws LifecycleException {
> > + if (getClassLoader() != null) {
> > + final TomEEWebappClassLoader webappClassLoader =
> > TomEEWebappClassLoader.class.cast(getClassLoader());
> > + if (webappClassLoader.isStopped()) {
> > + webappClassLoader.internalStop();
> > + }
> > + }
> > +
> > + final Context context = getContext();
> > +
> > + ClassLoaderConfigurer configurer =
> > ClassLoaderUtil.configurer(context.getName());
> > +
> > + // WEB-INF/jars.xml
> > + final File war = Contexts.warPath(Context.class.cast(context));
> > + final File jarsXml = new File(war, "WEB-INF/" +
> > QuickJarsTxtParser.FILE_NAME);
> > + final ClassLoaderConfigurer configurerTxt =
> > QuickJarsTxtParser.parse(jarsXml);
> > + if (configurerTxt != null) {
> > + configurer = new CompositeClassLoaderConfigurer(configurer,
> > configurerTxt);
> > + }
> > +
> > + TomEEWebappClassLoader.initContext(configurer);
> > + TomEEWebappClassLoader.initContext(context);
> > + try {
> > + super.startInternal();
> > + } finally {
> > + TomEEWebappClassLoader.cleanContext();
> > + }
> > + }
> > +
> > + @Override
> > + public String toString() {
> > + return "TomEE" + super.toString();
> > + }
> > +}
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
> > ----------------------------------------------------------------------
> > diff --git
> >
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
> >
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
> > index 03fea68..4496e54 100644
> > ---
> >
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
> > +++
> >
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
> > @@ -1,43 +1,43 @@
> > -/*
> > - * 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.tomee.catalina;
> > -
> > -import org.apache.catalina.core.StandardContext;
> > -import org.apache.openejb.config.DeploymentLoader;
> > -
> > -/**
> > - * @version $Id$
> > - */
> > -public class TomcatDeploymentLoader extends DeploymentLoader {
> > - private StandardContext standardContext;
> > - private String moduleId;
> > -
> > - public TomcatDeploymentLoader(final StandardContext standardContext,
> > final String moduleId) {
> > - this.standardContext = standardContext;
> > - this.moduleId = moduleId;
> > - }
> > -
> > - @Override
> > - protected String getContextRoot() {
> > - return standardContext.getPath();
> > - }
> > -
> > - @Override
> > - protected String getModuleName() {
> > - return moduleId;
> > - }
> > -}
> > +/*
> > + * 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.tomee.catalina;
> > +
> > +import org.apache.catalina.core.StandardContext;
> > +import org.apache.openejb.config.DeploymentLoader;
> > +
> > +/**
> > + * @version $Id$
> > + */
> > +public class TomcatDeploymentLoader extends DeploymentLoader {
> > + private StandardContext standardContext;
> > + private String moduleId;
> > +
> > + public TomcatDeploymentLoader(final StandardContext standardContext,
> > final String moduleId) {
> > + this.standardContext = standardContext;
> > + this.moduleId = moduleId;
> > + }
> > +
> > + @Override
> > + protected String getContextRoot() {
> > + return standardContext.getPath();
> > + }
> > +
> > + @Override
> > + protected String getModuleName() {
> > + return moduleId;
> > + }
> > +}
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
> > ----------------------------------------------------------------------
> > diff --git
> > a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
> > b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
> > index 1720f9f..a2c8d06 100644
> > ---
> > a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
> > +++
> > b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
> > @@ -1,134 +1,134 @@
> > -/**
> > - * 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.tomee.embedded;
> > -
> > -import java.io.File;
> > -import java.util.Set;
> > -
> > -import org.apache.commons.cli.CommandLine;
> > -import org.apache.commons.cli.CommandLineParser;
> > -import org.apache.commons.cli.HelpFormatter;
> > -import org.apache.commons.cli.Options;
> > -import org.apache.commons.cli.ParseException;
> > -import org.apache.commons.cli.PosixParser;
> > -import org.apache.openejb.loader.ProvisioningUtil;
> > -
> > -import static org.apache.openejb.loader.JarLocation.jarLocation;
> > -
> > -public class Main {
> > - public static final String PORT = "port";
> > - public static final String SHUTDOWN = "shutdown";
> > - public static final String PATH = "path";
> > - public static final String CONTEXT = "context";
> > - public static final String DIRECTORY = "directory";
> > - public static final String DOC_BASE = "doc-base";
> > - public static final String AS_WAR = "as-war";
> > -
> > - public static void main(final String[] args) {
> > - final CommandLineParser parser = new PosixParser();
> > - final Options options = createOptions();
> > -
> > - // parse command line
> > - final CommandLine line;
> > - try {
> > - line = parser.parse(options, args, true);
> > - } catch (final ParseException exp) {
> > - new HelpFormatter().printHelp("java -jar
> > tomee-embedded-user.jar", options);
> > - return;
> > - }
> > -
> > - // run TomEE
> > - try {
> > - final Container container = new
> > Container(createConfiguration(line));
> > - final String[] contexts;
> > - if (line.hasOption(CONTEXT)) {
> > - contexts = line.getOptionValues(CONTEXT);
> > - } else {
> > - contexts = null;
> > - }
> > -
> > - boolean autoWar = true;
> > - int i = 0;
> > - if (line.hasOption(PATH)) {
> > - for (final String path : line.getOptionValues(PATH)) {
> > - final Set<String> locations =
> > ProvisioningUtil.realLocation(path);
> > - for (final String location : locations) {
> > - final File file = new File(location);
> > - if (!file.exists()) {
> > - System.err.println(file.getAbsolutePath() +
> "
> > does not exist, skipping");
> > - continue;
> > - }
> > -
> > - String name =
> > file.getName().replaceAll("\\.[A-Za-z]+$", "");
> > - if (contexts != null) {
> > - name = contexts[i++];
> > - }
> > - container.deploy(name, file, true);
> > - }
> > - }
> > - autoWar = false;
> > - }
> > - if (line.hasOption(AS_WAR)) {
> > - container.deployClasspathAsWebApp(contexts == null || i
> > == contexts.length ? "" : contexts[i],
> > - line.hasOption(DOC_BASE) ? new
> > File(line.getOptionValue(DOC_BASE)) : null);
> > - autoWar = false;
> > - }
> > - if (autoWar) { // nothing deployed check if we are a war and
> > deploy ourself then
> > - final File me = jarLocation(Main.class);
> > - if (me.getName().endsWith(".war")) {
> > - container.deploy(contexts == null || i ==
> > contexts.length ? "" : contexts[i], me);
> > - }
> > - }
> > -
> > - Runtime.getRuntime().addShutdownHook(new Thread() {
> > - @Override
> > - public void run() {
> > - try {
> > - container.stop();
> > - } catch (final Exception e) {
> > - e.printStackTrace(); // just log the exception
> > - }
> > - }
> > - });
> > - container.await();
> > - } catch (final Exception e) {
> > - e.printStackTrace();
> > - }
> > - }
> > -
> > - private static Options createOptions() {
> > - final Options options = new Options();
> > - options.addOption(null, PATH, true, "");
> > - options.addOption(null, CONTEXT, true, "Context name for
> > applications (same order than paths)");
> > - options.addOption("p", PORT, true, "TomEE http port");
> > - options.addOption("s", SHUTDOWN, true, "TomEE shutdown port");
> > - options.addOption("d", DIRECTORY, true, "TomEE directory");
> > - options.addOption("c", AS_WAR, false, "deploy classpath as
> war");
> > - options.addOption("b", DOC_BASE, true, "when deploy classpath as
> > war, the doc base");
> > - return options;
> > - }
> > -
> > - private static Configuration createConfiguration(final CommandLine
> > args) {
> > - final Configuration config = new Configuration();
> > - config.setDir(System.getProperty("java.io.tmpdir"));
> > - config.setHttpPort(Integer.parseInt(args.getOptionValue(PORT,
> > "8080")));
> > -
> config.setStopPort(Integer.parseInt(args.getOptionValue(SHUTDOWN,
> > "8005")));
> > - config.setDir(args.getOptionValue(DIRECTORY, new File(new
> > File("."), "apache-tomee").getAbsolutePath()));
> > - return config;
> > - }
> > -
> > -}
> > +/**
> > + * 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.tomee.embedded;
> > +
> > +import java.io.File;
> > +import java.util.Set;
> > +
> > +import org.apache.commons.cli.CommandLine;
> > +import org.apache.commons.cli.CommandLineParser;
> > +import org.apache.commons.cli.HelpFormatter;
> > +import org.apache.commons.cli.Options;
> > +import org.apache.commons.cli.ParseException;
> > +import org.apache.commons.cli.PosixParser;
> > +import org.apache.openejb.loader.ProvisioningUtil;
> > +
> > +import static org.apache.openejb.loader.JarLocation.jarLocation;
> > +
> > +public class Main {
> > + public static final String PORT = "port";
> > + public static final String SHUTDOWN = "shutdown";
> > + public static final String PATH = "path";
> > + public static final String CONTEXT = "context";
> > + public static final String DIRECTORY = "directory";
> > + public static final String DOC_BASE = "doc-base";
> > + public static final String AS_WAR = "as-war";
> > +
> > + public static void main(final String[] args) {
> > + final CommandLineParser parser = new PosixParser();
> > + final Options options = createOptions();
> > +
> > + // parse command line
> > + final CommandLine line;
> > + try {
> > + line = parser.parse(options, args, true);
> > + } catch (final ParseException exp) {
> > + new HelpFormatter().printHelp("java -jar
> > tomee-embedded-user.jar", options);
> > + return;
> > + }
> > +
> > + // run TomEE
> > + try {
> > + final Container container = new
> > Container(createConfiguration(line));
> > + final String[] contexts;
> > + if (line.hasOption(CONTEXT)) {
> > + contexts = line.getOptionValues(CONTEXT);
> > + } else {
> > + contexts = null;
> > + }
> > +
> > + boolean autoWar = true;
> > + int i = 0;
> > + if (line.hasOption(PATH)) {
> > + for (final String path : line.getOptionValues(PATH)) {
> > + final Set<String> locations =
> > ProvisioningUtil.realLocation(path);
> > + for (final String location : locations) {
> > + final File file = new File(location);
> > + if (!file.exists()) {
> > + System.err.println(file.getAbsolutePath() +
> "
> > does not exist, skipping");
> > + continue;
> > + }
> > +
> > + String name =
> > file.getName().replaceAll("\\.[A-Za-z]+$", "");
> > + if (contexts != null) {
> > + name = contexts[i++];
> > + }
> > + container.deploy(name, file, true);
> > + }
> > + }
> > + autoWar = false;
> > + }
> > + if (line.hasOption(AS_WAR)) {
> > + container.deployClasspathAsWebApp(contexts == null || i
> > == contexts.length ? "" : contexts[i],
> > + line.hasOption(DOC_BASE) ? new
> > File(line.getOptionValue(DOC_BASE)) : null);
> > + autoWar = false;
> > + }
> > + if (autoWar) { // nothing deployed check if we are a war and
> > deploy ourself then
> > + final File me = jarLocation(Main.class);
> > + if (me.getName().endsWith(".war")) {
> > + container.deploy(contexts == null || i ==
> > contexts.length ? "" : contexts[i], me);
> > + }
> > + }
> > +
> > + Runtime.getRuntime().addShutdownHook(new Thread() {
> > + @Override
> > + public void run() {
> > + try {
> > + container.stop();
> > + } catch (final Exception e) {
> > + e.printStackTrace(); // just log the exception
> > + }
> > + }
> > + });
> > + container.await();
> > + } catch (final Exception e) {
> > + e.printStackTrace();
> > + }
> > + }
> > +
> > + private static Options createOptions() {
> > + final Options options = new Options();
> > + options.addOption(null, PATH, true, "");
> > + options.addOption(null, CONTEXT, true, "Context name for
> > applications (same order than paths)");
> > + options.addOption("p", PORT, true, "TomEE http port");
> > + options.addOption("s", SHUTDOWN, true, "TomEE shutdown port");
> > + options.addOption("d", DIRECTORY, true, "TomEE directory");
> > + options.addOption("c", AS_WAR, false, "deploy classpath as
> war");
> > + options.addOption("b", DOC_BASE, true, "when deploy classpath as
> > war, the doc base");
> > + return options;
> > + }
> > +
> > + private static Configuration createConfiguration(final CommandLine
> > args) {
> > + final Configuration config = new Configuration();
> > + config.setDir(System.getProperty("java.io.tmpdir"));
> > + config.setHttpPort(Integer.parseInt(args.getOptionValue(PORT,
> > "8080")));
> > +
> config.setStopPort(Integer.parseInt(args.getOptionValue(SHUTDOWN,
> > "8005")));
> > + config.setDir(args.getOptionValue(DIRECTORY, new File(new
> > File("."), "apache-tomee").getAbsolutePath()));
> > + return config;
> > + }
> > +
> > +}
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
> > ----------------------------------------------------------------------
> > diff --git
> >
> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
> >
> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
> > index 1d8fcef..f5a4247 100644
> > ---
> >
> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
> > +++
> >
> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
> > @@ -1,241 +1,241 @@
> > -// 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.
> > -
> > -//
> >
> ============================================================================
> > -// catalina.policy - Security Policy Permissions for Tomcat 7
> > -//
> > -// This file contains a default set of security policies to be enforced
> > (by the
> > -// JVM) when Catalina is executed with the "-security" option. In
> > addition
> > -// to the permissions granted here, the following additional permissions
> > are
> > -// granted specific to each web application:
> > -//
> > -// * Read access to its document root directory
> > -// * Read, write and delete access to its working directory
> > -//
> > -// $Id: catalina.policy 1079755 2011-03-09 11:38:38Z markt $
> > -//
> >
> ============================================================================
> > -
> > -
> > -// ========== SYSTEM CODE PERMISSIONS
> > =========================================
> > -
> > -
> > -// These permissions apply to javac
> > -grant codeBase "file:${java.home}/lib/-" {
> > - permission java.security.AllPermission;
> > -};
> > -
> > -// These permissions apply to all shared system extensions
> > -grant codeBase "file:${java.home}/jre/lib/ext/-" {
> > - permission java.security.AllPermission;
> > -};
> > -
> > -// These permissions apply to javac when ${java.home] points at
> > $JAVA_HOME/jre
> > -grant codeBase "file:${java.home}/../lib/-" {
> > - permission java.security.AllPermission;
> > -};
> > -
> > -// These permissions apply to all shared system extensions when
> > -// ${java.home} points at $JAVA_HOME/jre
> > -grant codeBase "file:${java.home}/lib/ext/-" {
> > - permission java.security.AllPermission;
> > -};
> > -
> > -
> > -// ========== CATALINA CODE PERMISSIONS
> > =======================================
> > -
> > -
> > -// These permissions apply to the daemon code
> > -grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
> > - permission java.security.AllPermission;
> > -};
> > -
> > -// These permissions apply to the logging API
> > -// Note: If tomcat-juli.jar is in ${catalina.base} and not in
> > ${catalina.home},
> > -// update this section accordingly.
> > -// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..}
> > -grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
> > - permission java.io.FilePermission
> > -
> > "${java.home}${file.separator}lib${file.separator}logging.properties",
> > "read";
> > -
> > - permission java.io.FilePermission
> > -
> >
> "${catalina.base}${file.separator}conf${file.separator}logging.properties",
> > "read";
> > - permission java.io.FilePermission
> > - "${catalina.base}${file.separator}logs", "read, write";
> > - permission java.io.FilePermission
> > - "${catalina.base}${file.separator}logs${file.separator}*",
> > "read, write";
> > -
> > - permission java.lang.RuntimePermission "shutdownHooks";
> > - permission java.lang.RuntimePermission "getClassLoader";
> > - permission java.lang.RuntimePermission "setContextClassLoader";
> > -
> > - permission java.util.logging.LoggingPermission "control";
> > -
> > - permission java.util.PropertyPermission
> > "java.util.logging.config.class", "read";
> > - permission java.util.PropertyPermission
> > "java.util.logging.config.file", "read";
> > - permission java.util.PropertyPermission "catalina.base", "read";
> > -
> > - // Note: To enable per context logging configuration, permit
> read
> > access to
> > - // the appropriate file. Be sure that the logging configuration
> is
> > - // secure before enabling such access.
> > - // E.g. for the examples web application:
> > - // permission java.io.FilePermission
> > "${catalina.base}${file.separator}
> > - // webapps${file.separator}examples${file.separator}WEB-INF
> > - //
> ${file.separator}classes${file.separator}logging.properties",
> > "read";
> > -};
> > -
> > -// These permissions apply to the server startup code
> > -grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
> > - permission java.security.AllPermission;
> > -};
> > -
> > -// These permissions apply to the servlet API classes
> > -// and those that are shared across all class loaders
> > -// located in the "lib" directory
> > -grant codeBase "file:${catalina.home}/lib/-" {
> > - permission java.security.AllPermission;
> > -};
> > -
> > -
> > -// If using a per instance lib directory, i.e. ${catalina.base}/lib,
> > -// then the following permission will need to be uncommented
> > -// grant codeBase "file:${catalina.base}/lib/-" {
> > -// permission java.security.AllPermission;
> > -// };
> > -
> > -
> > -// ========== WEB APPLICATION PERMISSIONS
> > =====================================
> > -
> > -
> > -// These permissions are granted by default to all web applications
> > -// In addition, a web application will be given a read FilePermission
> > -// and JndiPermission for all files and directories in its document
> root.
> > -grant {
> > - // Required for JNDI lookup of named JDBC DataSource's and
> > - // javamail named MimePart DataSource used to send mail
> > - permission java.util.PropertyPermission "java.home", "read";
> > - permission java.util.PropertyPermission "java.naming.*", "read";
> > - permission java.util.PropertyPermission "javax.sql.*", "read";
> > -
> > - // OS Specific properties to allow read access
> > - permission java.util.PropertyPermission "os.name", "read";
> > - permission java.util.PropertyPermission "os.version", "read";
> > - permission java.util.PropertyPermission "os.arch", "read";
> > - permission java.util.PropertyPermission "file.separator", "read";
> > - permission java.util.PropertyPermission "path.separator", "read";
> > - permission java.util.PropertyPermission "line.separator", "read";
> > -
> > - // JVM properties to allow read access
> > - permission java.util.PropertyPermission "java.version", "read";
> > - permission java.util.PropertyPermission "java.vendor", "read";
> > - permission java.util.PropertyPermission "java.vendor.url", "read";
> > - permission java.util.PropertyPermission "java.class.version",
> "read";
> > - permission java.util.PropertyPermission
> "java.specification.version",
> > "read";
> > - permission java.util.PropertyPermission "java.specification.vendor",
> > "read";
> > - permission java.util.PropertyPermission "java.specification.name",
> > "read";
> > -
> > - permission java.util.PropertyPermission
> > "java.vm.specification.version", "read";
> > - permission java.util.PropertyPermission
> > "java.vm.specification.vendor", "read";
> > - permission java.util.PropertyPermission "java.vm.specification.name
> ",
> > "read";
> > - permission java.util.PropertyPermission "java.vm.version", "read";
> > - permission java.util.PropertyPermission "java.vm.vendor", "read";
> > - permission java.util.PropertyPermission "java.vm.name", "read";
> > -
> > - // Required for OpenJMX
> > - permission java.lang.RuntimePermission "getAttribute";
> > -
> > - // Allow read of JAXP compliant XML parser debug
> > - permission java.util.PropertyPermission "jaxp.debug", "read";
> > -
> > - // All JSPs need to be able to read this package
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.tomcat";
> > -
> > - // Precompiled JSPs need access to these packages.
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.jasper.el";
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.jasper.runtime";
> > - permission java.lang.RuntimePermission
> > - "accessClassInPackage.org.apache.jasper.runtime.*";
> > -
> > - // Precompiled JSPs need access to these system properties.
> > - permission java.util.PropertyPermission
> > - "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read";
> > - permission java.util.PropertyPermission
> > - "org.apache.el.parser.COERCE_TO_ZERO", "read";
> > -
> > - // The cookie code needs these.
> > - permission java.util.PropertyPermission
> > - "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
> > - permission java.util.PropertyPermission
> > - "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
> > - permission java.util.PropertyPermission
> > - "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR",
> > "read";
> > -
> > - // Applications using Comet need to be able to access this package
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.comet";
> > -};
> > -
> > -
> > -// The Manager application needs access to the following packages to
> > support the
> > -// session display functionality. These settings support the following
> > -// configurations:
> > -// - default CATALINA_HOME == CATALINA_BASE
> > -// - CATALINA_HOME != CATALINA_BASE, per instance Manager in
> CATALINA_BASE
> > -// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME
> > -grant codeBase "file:${catalina.base}/webapps/manager/-" {
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina";
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.ha.session";
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.manager";
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.manager.util";
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.util";
> > -};
> > -grant codeBase "file:${catalina.home}/webapps/manager/-" {
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina";
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.ha.session";
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.manager";
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.manager.util";
> > - permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.util";
> > -};
> > -
> > -// You can assign additional permissions to particular web applications
> by
> > -// adding additional "grant" entries here, based on the code base for
> that
> > -// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
> > -//
> > -// Different permissions can be granted to JSP pages, classes loaded
> from
> > -// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
> > -// directory, or even to individual jar files in the /WEB-INF/lib/
> > directory.
> > -//
> > -// For instance, assume that the standard "examples" application
> > -// included a JDBC driver that needed to establish a network connection
> > to the
> > -// corresponding database and used the scrape taglib to get the weather
> > from
> > -// the NOAA web server. You might create a "grant" entries like this:
> > -//
> > -// The permissions granted to the context root directory apply to JSP
> > pages.
> > -// grant codeBase "file:${catalina.base}/webapps/examples/-" {
> > -// permission java.net.SocketPermission "dbhost.mycompany.com:5432
> ",
> > "connect";
> > -// permission java.net.SocketPermission "*.noaa.gov:80",
> "connect";
> > -// };
> > -//
> > -// The permissions granted to the context WEB-INF/classes directory
> > -// grant codeBase
> > "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
> > -// };
> > -//
> > -// The permission granted to your JDBC driver
> > -// grant codeBase
> > "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
> > -// permission java.net.SocketPermission "dbhost.mycompany.com:5432
> ",
> > "connect";
> > -// };
> > -// The permission granted to the scrape taglib
> > -// grant codeBase
> > "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
> > -// permission java.net.SocketPermission "*.noaa.gov:80",
> "connect";
> > -// };
> > -
> > +// 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.
> > +
> > +//
> >
> ============================================================================
> > +// catalina.policy - Security Policy Permissions for Tomcat 7
> > +//
> > +// This file contains a default set of security policies to be enforced
> > (by the
> > +// JVM) when Catalina is executed with the "-security" option. In
> > addition
> > +// to the permissions granted here, the following additional permissions
> > are
> > +// granted specific to each web application:
> > +//
> > +// * Read access to its document root directory
> > +// * Read, write and delete access to its working directory
> > +//
> > +// $Id: catalina.policy 1079755 2011-03-09 11:38:38Z markt $
> > +//
> >
> ============================================================================
> > +
> > +
> > +// ========== SYSTEM CODE PERMISSIONS
> > =========================================
> > +
> > +
> > +// These permissions apply to javac
> > +grant codeBase "file:${java.home}/lib/-" {
> > + permission java.security.AllPermission;
> > +};
> > +
> > +// These permissions apply to all shared system extensions
> > +grant codeBase "file:${java.home}/jre/lib/ext/-" {
> > + permission java.security.AllPermission;
> > +};
> > +
> > +// These permissions apply to javac when ${java.home] points at
> > $JAVA_HOME/jre
> > +grant codeBase "file:${java.home}/../lib/-" {
> > + permission java.security.AllPermission;
> > +};
> > +
> > +// These permissions apply to all shared system extensions when
> > +// ${java.home} points at $JAVA_HOME/jre
> > +grant codeBase "file:${java.home}/lib/ext/-" {
> > + permission java.security.AllPermission;
> > +};
> > +
> > +
> > +// ========== CATALINA CODE PERMISSIONS
> > =======================================
> > +
> > +
> > +// These permissions apply to the daemon code
> > +grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
> > + permission java.security.AllPermission;
> > +};
> > +
> > +// These permissions apply to the logging API
> > +// Note: If tomcat-juli.jar is in ${catalina.base} and not in
> > ${catalina.home},
> > +// update this section accordingly.
> > +// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..}
> > +grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
> > + permission java.io.FilePermission
> > +
> > "${java.home}${file.separator}lib${file.separator}logging.properties",
> > "read";
> > +
> > + permission java.io.FilePermission
> > +
> >
> "${catalina.base}${file.separator}conf${file.separator}logging.properties",
> > "read";
> > + permission java.io.FilePermission
> > + "${catalina.base}${file.separator}logs", "read, write";
> > + permission java.io.FilePermission
> > + "${catalina.base}${file.separator}logs${file.separator}*",
> > "read, write";
> > +
> > + permission java.lang.RuntimePermission "shutdownHooks";
> > + permission java.lang.RuntimePermission "getClassLoader";
> > + permission java.lang.RuntimePermission "setContextClassLoader";
> > +
> > + permission java.util.logging.LoggingPermission "control";
> > +
> > + permission java.util.PropertyPermission
> > "java.util.logging.config.class", "read";
> > + permission java.util.PropertyPermission
> > "java.util.logging.config.file", "read";
> > + permission java.util.PropertyPermission "catalina.base", "read";
> > +
> > + // Note: To enable per context logging configuration, permit
> read
> > access to
> > + // the appropriate file. Be sure that the logging configuration
> is
> > + // secure before enabling such access.
> > + // E.g. for the examples web application:
> > + // permission java.io.FilePermission
> > "${catalina.base}${file.separator}
> > + // webapps${file.separator}examples${file.separator}WEB-INF
> > + //
> ${file.separator}classes${file.separator}logging.properties",
> > "read";
> > +};
> > +
> > +// These permissions apply to the server startup code
> > +grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
> > + permission java.security.AllPermission;
> > +};
> > +
> > +// These permissions apply to the servlet API classes
> > +// and those that are shared across all class loaders
> > +// located in the "lib" directory
> > +grant codeBase "file:${catalina.home}/lib/-" {
> > + permission java.security.AllPermission;
> > +};
> > +
> > +
> > +// If using a per instance lib directory, i.e. ${catalina.base}/lib,
> > +// then the following permission will need to be uncommented
> > +// grant codeBase "file:${catalina.base}/lib/-" {
> > +// permission java.security.AllPermission;
> > +// };
> > +
> > +
> > +// ========== WEB APPLICATION PERMISSIONS
> > =====================================
> > +
> > +
> > +// These permissions are granted by default to all web applications
> > +// In addition, a web application will be given a read FilePermission
> > +// and JndiPermission for all files and directories in its document
> root.
> > +grant {
> > + // Required for JNDI lookup of named JDBC DataSource's and
> > + // javamail named MimePart DataSource used to send mail
> > + permission java.util.PropertyPermission "java.home", "read";
> > + permission java.util.PropertyPermission "java.naming.*", "read";
> > + permission java.util.PropertyPermission "javax.sql.*", "read";
> > +
> > + // OS Specific properties to allow read access
> > + permission java.util.PropertyPermission "os.name", "read";
> > + permission java.util.PropertyPermission "os.version", "read";
> > + permission java.util.PropertyPermission "os.arch", "read";
> > + permission java.util.PropertyPermission "file.separator", "read";
> > + permission java.util.PropertyPermission "path.separator", "read";
> > + permission java.util.PropertyPermission "line.separator", "read";
> > +
> > + // JVM properties to allow read access
> > + permission java.util.PropertyPermission "java.version", "read";
> > + permission java.util.PropertyPermission "java.vendor", "read";
> > + permission java.util.PropertyPermission "java.vendor.url", "read";
> > + permission java.util.PropertyPermission "java.class.version",
> "read";
> > + permission java.util.PropertyPermission
> "java.specification.version",
> > "read";
> > + permission java.util.PropertyPermission "java.specification.vendor",
> > "read";
> > + permission java.util.PropertyPermission "java.specification.name",
> > "read";
> > +
> > + permission java.util.PropertyPermission
> > "java.vm.specification.version", "read";
> > + permission java.util.PropertyPermission
> > "java.vm.specification.vendor", "read";
> > + permission java.util.PropertyPermission "java.vm.specification.name
> ",
> > "read";
> > + permission java.util.PropertyPermission "java.vm.version", "read";
> > + permission java.util.PropertyPermission "java.vm.vendor", "read";
> > + permission java.util.PropertyPermission "java.vm.name", "read";
> > +
> > + // Required for OpenJMX
> > + permission java.lang.RuntimePermission "getAttribute";
> > +
> > + // Allow read of JAXP compliant XML parser debug
> > + permission java.util.PropertyPermission "jaxp.debug", "read";
> > +
> > + // All JSPs need to be able to read this package
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.tomcat";
> > +
> > + // Precompiled JSPs need access to these packages.
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.jasper.el";
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.jasper.runtime";
> > + permission java.lang.RuntimePermission
> > + "accessClassInPackage.org.apache.jasper.runtime.*";
> > +
> > + // Precompiled JSPs need access to these system properties.
> > + permission java.util.PropertyPermission
> > + "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read";
> > + permission java.util.PropertyPermission
> > + "org.apache.el.parser.COERCE_TO_ZERO", "read";
> > +
> > + // The cookie code needs these.
> > + permission java.util.PropertyPermission
> > + "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
> > + permission java.util.PropertyPermission
> > + "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
> > + permission java.util.PropertyPermission
> > + "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR",
> > "read";
> > +
> > + // Applications using Comet need to be able to access this package
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.comet";
> > +};
> > +
> > +
> > +// The Manager application needs access to the following packages to
> > support the
> > +// session display functionality. These settings support the following
> > +// configurations:
> > +// - default CATALINA_HOME == CATALINA_BASE
> > +// - CATALINA_HOME != CATALINA_BASE, per instance Manager in
> CATALINA_BASE
> > +// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME
> > +grant codeBase "file:${catalina.base}/webapps/manager/-" {
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina";
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.ha.session";
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.manager";
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.manager.util";
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.util";
> > +};
> > +grant codeBase "file:${catalina.home}/webapps/manager/-" {
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina";
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.ha.session";
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.manager";
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.manager.util";
> > + permission java.lang.RuntimePermission
> > "accessClassInPackage.org.apache.catalina.util";
> > +};
> > +
> > +// You can assign additional permissions to particular web applications
> by
> > +// adding additional "grant" entries here, based on the code base for
> that
> > +// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
> > +//
> > +// Different permissions can be granted to JSP pages, classes loaded
> from
> > +// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
> > +// directory, or even to individual jar files in the /WEB-INF/lib/
> > directory.
> > +//
> > +// For instance, assume that the standard "examples" application
> > +// included a JDBC driver that needed to establish a network connection
> > to the
> > +// corresponding database and used the scrape taglib to get the weather
> > from
> > +// the NOAA web server. You might create a "grant" entries like this:
> > +//
> > +// The permissions granted to the context root directory apply to JSP
> > pages.
> > +// grant codeBase "file:${catalina.base}/webapps/examples/-" {
> > +// permission java.net.SocketPermission "dbhost.mycompany.com:5432
> ",
> > "connect";
> > +// permission java.net.SocketPermission "*.noaa.gov:80",
> "connect";
> > +// };
> > +//
> > +// The permissions granted to the context WEB-INF/classes directory
> > +// grant codeBase
> > "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
> > +// };
> > +//
> > +// The permission granted to your JDBC driver
> > +// grant codeBase
> > "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
> > +// permission java.net.SocketPermission "dbhost.mycompany.com:5432
> ",
> > "connect";
> > +// };
> > +// The permission granted to the scrape taglib
> > +// grant codeBase
> > "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
> > +// permission java.net.SocketPermission "*.noaa.gov:80",
> "connect";
> > +// };
> > +
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
> > ----------------------------------------------------------------------
> > diff --git
> >
> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
> >
> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
> > index 5089043..ff86449 100644
> > ---
> >
> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
> > +++
> >
> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
> > @@ -1,122 +1,122 @@
> > -# 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.
> > -
> > -#
> > -# List of comma-separated packages that start with or equal this string
> > -# will cause a security exception to be thrown when
> > -# passed to checkPackageAccess unless the
> > -# corresponding RuntimePermission ("accessClassInPackage."+package) has
> > -# been granted.
> >
> >
> -package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
> > -#
> > -# List of comma-separated packages that start with or equal this string
> > -# will cause a security exception to be thrown when
> > -# passed to checkPackageDefinition unless the
> > -# corresponding RuntimePermission ("defineClassInPackage."+package) has
> > -# been granted.
> > -#
> > -# by default, no packages are restricted for definition, and none of
> > -# the class loaders supplied with the JDK call checkPackageDefinition.
> > -#
> >
> >
> -package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
> > -
> > -#
> > -#
> > -# List of comma-separated paths defining the contents of the "common"
> > -# classloader. Prefixes should be used to define what is the repository
> > type.
> > -# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
> > absolute.
> > -# If left as blank,the JVM system loader will be used as Catalina's
> > "common"
> > -# loader.
> > -# Examples:
> > -# "foo": Add this folder as a class repository
> > -# "foo/*.jar": Add all the JARs of the specified folder as class
> > -# repositories
> > -# "foo/bar.jar": Add bar.jar as a class repository
> >
> >
> -common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
> > -
> > -#
> > -# List of comma-separated paths defining the contents of the "server"
> > -# classloader. Prefixes should be used to define what is the repository
> > type.
> > -# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
> > absolute.
> > -# If left as blank, the "common" loader will be used as Catalina's
> > "server"
> > -# loader.
> > -# Examples:
> > -# "foo": Add this folder as a class repository
> > -# "foo/*.jar": Add all the JARs of the specified folder as class
> > -# repositories
> > -# "foo/bar.jar": Add bar.jar as a class repository
> > -server.loader=
> > -
> > -#
> > -# List of comma-separated paths defining the contents of the "shared"
> > -# classloader. Prefixes should be used to define what is the repository
> > type.
> > -# Path may be relative to the CATALINA_BASE path or absolute. If left as
> > blank,
> > -# the "common" loader will be used as Catalina's "shared" loader.
> > -# Examples:
> > -# "foo": Add this folder as a class repository
> > -# "foo/*.jar": Add all the JARs of the specified folder as class
> > -# repositories
> > -# "foo/bar.jar": Add bar.jar as a class repository
> > -# Please note that for single jars, e.g. bar.jar, you need the URL form
> > -# starting with file:.
> > -shared.loader=
> > -
> > -# List of JAR files that should not be scanned for configuration
> > information
> > -# such as web fragments, TLD files etc. It must be a comma separated
> list
> > of
> > -# JAR file names.
> > -# The JARs listed below include:
> > -# - Tomcat Bootstrap JARs
> > -# - Tomcat API JARs
> > -# - Catalina JARs
> > -# - Jasper JARs
> > -# - Tomcat JARs
> > -# - Common non-Tomcat JARs
> > -# - Sun JDK JARs
> > -# - Apple JDK JARs
> > -tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
> > -bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
> > -annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\
> > -catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\
> > -jasper.jar,jasper-el.jar,ecj-*.jar,\
> > -tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\
> >
> >
> -tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\
> > -commons-beanutils*.jar,commons-collections*.jar,commons-dbcp*.jar,\
> > -commons-digester*.jar,commons-fileupload*.jar,commons-logging*.jar,\
> > -commons-pool*.jar,\
> > -bcprov-*.jar,\
> > -ant.jar,jmx.jar,jmx-tools.jar,\
> > -xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
> >
> >
> -dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunpkcs11.jar,tools.jar,\
> > -apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\
> > -j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\
> > -mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\
> > -hsqldb-*,openejb-core-*,xbean-*,derby*,mbean-annotation-*,\
> >
> >
> -javassit*,commons-*,swizzle-stream-*,serp-*,geronimo-javamail-*,geronimo-mail-*,\
> >
> >
> -openejb-jee-*,openejb-core-*,openejb-loader-*,openejb-api-*,openejb-derby*,\
> > -openwebbeans-ejb-*,openwebbeans-impl-*,\
> > -bval-*,\
> >
> >
> -tomee-loader-*,openejb-javaagent-*,openejb-ejbd-*,scannotation-*,openejb-server-*,\
> > -openjpa-*,quartz-*,openejb-http-*,kahadb-*
> > -
> > -#
> > -# String cache configuration.
> > -tomcat.util.buf.StringCache.byte.enabled=true
> > -#tomcat.util.buf.StringCache.char.enabled=true
> > -#tomcat.util.buf.StringCache.trainThreshold=500000
> > -#tomcat.util.buf.StringCache.cacheSize=5000
> > -
> > -http.port=${tomcatHttpPort}
> > -shutdown.port=${tomcatShutdownPort}
> > +# 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.
> > +
> > +#
> > +# List of comma-separated packages that start with or equal this string
> > +# will cause a security exception to be thrown when
> > +# passed to checkPackageAccess unless the
> > +# corresponding RuntimePermission ("accessClassInPackage."+package) has
> > +# been granted.
> >
> >
> +package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
> > +#
> > +# List of comma-separated packages that start with or equal this string
> > +# will cause a security exception to be thrown when
> > +# passed to checkPackageDefinition unless the
> > +# corresponding RuntimePermission ("defineClassInPackage."+package) has
> > +# been granted.
> > +#
> > +# by default, no packages are restricted for definition, and none of
> > +# the class loaders supplied with the JDK call checkPackageDefinition.
> > +#
> >
> >
> +package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
> > +
> > +#
> > +#
> > +# List of comma-separated paths defining the contents of the "common"
> > +# classloader. Prefixes should be used to define what is the repository
> > type.
> > +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
> > absolute.
> > +# If left as blank,the JVM system loader will be used as Catalina's
> > "common"
> > +# loader.
> > +# Examples:
> > +# "foo": Add this folder as a class repository
> > +# "foo/*.jar": Add all the JARs of the specified folder as class
> > +# repositories
> > +# "foo/bar.jar": Add bar.jar as a class repository
> >
> >
> +common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
> > +
> > +#
> > +# List of comma-separated paths defining the contents of the "server"
> > +# classloader. Prefixes should be used to define what is the repository
> > type.
> > +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
> > absolute.
> > +# If left as blank, the "common" loader will be used as Catalina's
> > "server"
> > +# loader.
> > +# Examples:
> > +# "foo": Add this folder as a class repository
> > +# "foo/*.jar": Add all the JARs of the specified folder as class
> > +# repositories
> > +# "foo/bar.jar": Add bar.jar as a class repository
> > +server.loader=
> > +
> > +#
> > +# List of comma-separated paths defining the contents of the "shared"
> > +# classloader. Prefixes should be used to define what is the repository
> > type.
> > +# Path may be relative to the CATALINA_BASE path or absolute. If left as
> > blank,
> > +# the "common" loader will be used as Catalina's "shared" loader.
> > +# Examples:
> > +# "foo": Add this folder as a class repository
> > +# "foo/*.jar": Add all the JARs of the specified folder as class
> > +# repositories
> > +# "foo/bar.jar": Add bar.jar as a class repository
> > +# Please note that for single jars, e.g. bar.jar, you need the URL form
> > +# starting with file:.
> > +shared.loader=
> > +
> > +# List of JAR files that should not be scanned for configuration
> > information
> > +# such as web fragments, TLD files etc. It must be a comma separated
> list
> > of
> > +# JAR file names.
> > +# The JARs listed below include:
> > +# - Tomcat Bootstrap JARs
> > +# - Tomcat API JARs
> > +# - Catalina JARs
> > +# - Jasper JARs
> > +# - Tomcat JARs
> > +# - Common non-Tomcat JARs
> > +# - Sun JDK JARs
> > +# - Apple JDK JARs
> > +tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
> > +bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
> > +annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\
> > +catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\
> > +jasper.jar,jasper-el.jar,ecj-*.jar,\
> > +tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\
> >
> >
> +tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\
> > +commons-beanutils*.jar,commons-collections*.jar,commons-dbcp*.jar,\
> > +commons-digester*.jar,commons-fileupload*.jar,commons-logging*.jar,\
> > +commons-pool*.jar,\
> > +bcprov-*.jar,\
> > +ant.jar,jmx.jar,jmx-tools.jar,\
> > +xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
> >
> >
> +dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunpkcs11.jar,tools.jar,\
> > +apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\
> > +j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\
> > +mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\
> > +hsqldb-*,openejb-core-*,xbean-*,derby*,mbean-annotation-*,\
> >
> >
> +javassit*,commons-*,swizzle-stream-*,serp-*,geronimo-javamail-*,geronimo-mail-*,\
> >
> >
> +openejb-jee-*,openejb-core-*,openejb-loader-*,openejb-api-*,openejb-derby*,\
> > +openwebbeans-ejb-*,openwebbeans-impl-*,\
> > +bval-*,\
> >
> >
> +tomee-loader-*,openejb-javaagent-*,openejb-ejbd-*,scannotation-*,openejb-server-*,\
> > +openjpa-*,quartz-*,openejb-http-*,kahadb-*
> > +
> > +#
> > +# String cache configuration.
> > +tomcat.util.buf.StringCache.byte.enabled=true
> > +#tomcat.util.buf.StringCache.char.enabled=true
> > +#tomcat.util.buf.StringCache.trainThreshold=500000
> > +#tomcat.util.buf.StringCache.cacheSize=5000
> > +
> > +http.port=${tomcatHttpPort}
> > +shutdown.port=${tomcatShutdownPort}
> > shutdown.command=${tomcatShutdownCommand}
> > \ No newline at end of file
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
> > ----------------------------------------------------------------------
> > diff --git
> > a/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
> > b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
> > index abbc097..8f828b9 100644
> > ---
> > a/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
> > +++
> > b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
> > @@ -1,26 +1,26 @@
> > -/**
> > - * 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.tomee.embedded;
> > -
> > -import javax.ejb.Singleton;
> > -
> > -@Singleton
> > -public class ABean {
> > - public String embedded() {
> > - return "ok";
> > - }
> > -}
> > +/**
> > + * 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.tomee.embedded;
> > +
> > +import javax.ejb.Singleton;
> > +
> > +@Singleton
> > +public class ABean {
> > + public String embedded() {
> > + return "ok";
> > + }
> > +}
> >
> >
> >
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
> > ----------------------------------------------------------------------
> > diff --git a/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
> > b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
> > index e0d7a63..b1514dd 100644
> > --- a/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
> > +++ b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
> > @@ -1,19 +1,19 @@
> > -<?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.
> > --->
> > -<beans />
> > +<?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.
> > +-->
> > +<beans />
> >
> >
>
--
Daniel Cunha
https://twitter.com/dvlc_
http://www.tomitribe.com
Re: [2/3] tomee git commit: EOL commit
Posted by Thiago Veronezi <th...@veronezi.org>.
Hey Romain,
What is this commit about? Removing windows line endings?
Now when I pull the source code, my local git says I have changed files
that I never touched. Am I missing a config locally?
[]s,
Thiago
On Wed, Nov 18, 2015 at 3:18 PM, <rm...@apache.org> wrote:
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/build.xml
> ----------------------------------------------------------------------
> diff --git a/tomee/build.xml b/tomee/build.xml
> index eff1327..c660e7c 100644
> --- a/tomee/build.xml
> +++ b/tomee/build.xml
> @@ -1,46 +1,46 @@
> -<?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="dev-helper" default="web">
> -
> - <target name="web">
> - <copy verbose="true"
> todir="apache-tomee/target/apache-tomee-webprofile-7.0.0-SNAPSHOT/webapps/tomee">
> - <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.js"/>
> - <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.css"/>
> - <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.html"/>
> - </copy>
> - </target>
> -
> - <target name="rs">
> - <copy verbose="true"
> todir="apache-tomee/target/apache-tomee-jaxrs-7.0.0-SNAPSHOT/webapps/tomee">
> - <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.js"/>
> - <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.css"/>
> - <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.html"/>
> - </copy>
> - </target>
> -
> - <target name="plus">
> - <copy verbose="true"
> todir="apache-tomee/target/apache-tomee-plus-7.0.0-SNAPSHOT/webapps/tomee">
> - <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.js"/>
> - <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.css"/>
> - <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.html"/>
> - </copy>
> - </target>
> -
> -</project>
> -
> +<?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="dev-helper" default="web">
> +
> + <target name="web">
> + <copy verbose="true"
> todir="apache-tomee/target/apache-tomee-webprofile-7.0.0-SNAPSHOT/webapps/tomee">
> + <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.js"/>
> + <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.css"/>
> + <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.html"/>
> + </copy>
> + </target>
> +
> + <target name="rs">
> + <copy verbose="true"
> todir="apache-tomee/target/apache-tomee-jaxrs-7.0.0-SNAPSHOT/webapps/tomee">
> + <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.js"/>
> + <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.css"/>
> + <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.html"/>
> + </copy>
> + </target>
> +
> + <target name="plus">
> + <copy verbose="true"
> todir="apache-tomee/target/apache-tomee-plus-7.0.0-SNAPSHOT/webapps/tomee">
> + <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.js"/>
> + <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.css"/>
> + <fileset dir="tomee-webapp/src/main/webapp"
> includes="**/*.html"/>
> + </copy>
> + </target>
> +
> +</project>
> +
>
>
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
> ----------------------------------------------------------------------
> diff --git
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
> index 2ca6ac6..2208d91 100644
> ---
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
> +++
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
> @@ -1,165 +1,165 @@
> -/*
> - * 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.tomee.catalina;
> -
> -import org.apache.catalina.Container;
> -import org.apache.catalina.Context;
> -import org.apache.catalina.Globals;
> -import org.apache.catalina.Host;
> -import org.apache.catalina.core.StandardContext;
> -import org.apache.catalina.core.StandardEngine;
> -import org.apache.catalina.core.StandardHost;
> -import org.apache.catalina.util.ContextName;
> -
> -import java.io.File;
> -import java.io.IOException;
> -
> -public class Contexts {
> - public static String getHostname(final StandardContext ctx) {
> - String hostName = null;
> - final Container parentHost = ctx.getParent();
> - if (parentHost != null) {
> - hostName = parentHost.getName();
> - }
> - if ((hostName == null) || (hostName.length() < 1)) {
> - hostName = "_";
> - }
> - return hostName;
> - }
> -
> - public static File warPath(final Context standardContext) {
> - final File file = realWarPath(standardContext);
> - if (file == null) {
> - return null;
> - }
> -
> - final String name = file.getName();
> - if (!file.isDirectory() && name.endsWith(".war")) {
> - final File extracted = new File(file.getParentFile(),
> name.substring(0, name.length() - ".war".length()));
> - if (extracted.exists()) {
> - try {
> - return extracted.getCanonicalFile();
> - } catch (final IOException e) {
> - return extracted;
> - }
> - }
> - }
> - try {
> - return file.getCanonicalFile();
> - } catch (final IOException e) {
> - return file;
> - }
> - }
> -
> - public static File realWarPath(final Context standardContext) {
> - if (standardContext == null) {
> - return null;
> - }
> -
> - final File docBase;
> - Container container = standardContext;
> - while (container != null) {
> - if (container instanceof Host) {
> - break;
> - }
> - container = container.getParent();
> - }
> -
> - String baseName = null;
> - if (standardContext.getDocBase() != null) {
> - File file = new File(standardContext.getDocBase());
> - if (!file.isAbsolute()) {
> - if (container == null) {
> - docBase = new File(engineBase(standardContext),
> standardContext.getDocBase());
> - } else {
> - final String appBase = ((Host)
> container).getAppBase();
> - file = new File(appBase);
> - if (!file.isAbsolute()) {
> - file = new File(engineBase(standardContext),
> appBase);
> - }
> - docBase = new File(file,
> standardContext.getDocBase());
> - }
> - } else {
> - docBase = file;
> - }
> - } else {
> - final String path = standardContext.getPath();
> - if (path == null) {
> - throw new IllegalStateException("Can't find docBase");
> - } else {
> - baseName = new ContextName(path,
> standardContext.getWebappVersion()).getBaseName();
> - docBase = new File(baseName);
> - }
> - }
> -
> - if (!docBase.exists() && baseName != null) { // for old
> compatibility, will be removed soon
> - if (Host.class.isInstance(container)) {
> - final File file = new
> File(Host.class.cast(container).getAppBaseFile(), baseName);
> - if (file.exists()) {
> - return file;
> - }
> - }
> - return oldRealWarPath(standardContext);
> - }
> -
> - final String name = docBase.getName();
> - if (name.endsWith(".war")) {
> - final File extracted = new File(docBase.getParentFile(),
> name.substring(0, name.length() - ".war".length()));
> - if (extracted.exists()) {
> - return extracted;
> - }
> - }
> -
> - return docBase;
> - }
> -
> - private static File engineBase(final Context standardContext) {
> - final String base =
> System.getProperty(Globals.CATALINA_BASE_PROP);
> - if( base == null ) {
> - final StandardEngine eng = (StandardEngine)
> standardContext.getParent().getParent();
> - return eng.getCatalinaBase();
> - }
> - return new File(base);
> - }
> -
> - @Deprecated
> - private static File oldRealWarPath(final Context standardContext) {
> - String doc = standardContext.getDocBase();
> - // handle ROOT case
> - if (doc == null || doc.length() == 0) {
> - doc = "ROOT";
> - }
> -
> - File war = new File(doc);
> - if (war.exists()) {
> - return war;
> - }
> -
> - final StandardHost host = (StandardHost)
> standardContext.getParent();
> - final String base = host.getAppBase();
> - war = new File(base, doc);
> - if (war.exists()) {
> - return war;
> - }
> -
> - war = new File(new File(System.getProperty("catalina.home"),
> base), doc);
> - if (war.exists()) {
> - return war;
> - }
> - return new File(new File(System.getProperty("catalina.base"),
> base), doc); // shouldn't occur
> - }
> -}
> +/*
> + * 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.tomee.catalina;
> +
> +import org.apache.catalina.Container;
> +import org.apache.catalina.Context;
> +import org.apache.catalina.Globals;
> +import org.apache.catalina.Host;
> +import org.apache.catalina.core.StandardContext;
> +import org.apache.catalina.core.StandardEngine;
> +import org.apache.catalina.core.StandardHost;
> +import org.apache.catalina.util.ContextName;
> +
> +import java.io.File;
> +import java.io.IOException;
> +
> +public class Contexts {
> + public static String getHostname(final StandardContext ctx) {
> + String hostName = null;
> + final Container parentHost = ctx.getParent();
> + if (parentHost != null) {
> + hostName = parentHost.getName();
> + }
> + if ((hostName == null) || (hostName.length() < 1)) {
> + hostName = "_";
> + }
> + return hostName;
> + }
> +
> + public static File warPath(final Context standardContext) {
> + final File file = realWarPath(standardContext);
> + if (file == null) {
> + return null;
> + }
> +
> + final String name = file.getName();
> + if (!file.isDirectory() && name.endsWith(".war")) {
> + final File extracted = new File(file.getParentFile(),
> name.substring(0, name.length() - ".war".length()));
> + if (extracted.exists()) {
> + try {
> + return extracted.getCanonicalFile();
> + } catch (final IOException e) {
> + return extracted;
> + }
> + }
> + }
> + try {
> + return file.getCanonicalFile();
> + } catch (final IOException e) {
> + return file;
> + }
> + }
> +
> + public static File realWarPath(final Context standardContext) {
> + if (standardContext == null) {
> + return null;
> + }
> +
> + final File docBase;
> + Container container = standardContext;
> + while (container != null) {
> + if (container instanceof Host) {
> + break;
> + }
> + container = container.getParent();
> + }
> +
> + String baseName = null;
> + if (standardContext.getDocBase() != null) {
> + File file = new File(standardContext.getDocBase());
> + if (!file.isAbsolute()) {
> + if (container == null) {
> + docBase = new File(engineBase(standardContext),
> standardContext.getDocBase());
> + } else {
> + final String appBase = ((Host)
> container).getAppBase();
> + file = new File(appBase);
> + if (!file.isAbsolute()) {
> + file = new File(engineBase(standardContext),
> appBase);
> + }
> + docBase = new File(file,
> standardContext.getDocBase());
> + }
> + } else {
> + docBase = file;
> + }
> + } else {
> + final String path = standardContext.getPath();
> + if (path == null) {
> + throw new IllegalStateException("Can't find docBase");
> + } else {
> + baseName = new ContextName(path,
> standardContext.getWebappVersion()).getBaseName();
> + docBase = new File(baseName);
> + }
> + }
> +
> + if (!docBase.exists() && baseName != null) { // for old
> compatibility, will be removed soon
> + if (Host.class.isInstance(container)) {
> + final File file = new
> File(Host.class.cast(container).getAppBaseFile(), baseName);
> + if (file.exists()) {
> + return file;
> + }
> + }
> + return oldRealWarPath(standardContext);
> + }
> +
> + final String name = docBase.getName();
> + if (name.endsWith(".war")) {
> + final File extracted = new File(docBase.getParentFile(),
> name.substring(0, name.length() - ".war".length()));
> + if (extracted.exists()) {
> + return extracted;
> + }
> + }
> +
> + return docBase;
> + }
> +
> + private static File engineBase(final Context standardContext) {
> + final String base =
> System.getProperty(Globals.CATALINA_BASE_PROP);
> + if( base == null ) {
> + final StandardEngine eng = (StandardEngine)
> standardContext.getParent().getParent();
> + return eng.getCatalinaBase();
> + }
> + return new File(base);
> + }
> +
> + @Deprecated
> + private static File oldRealWarPath(final Context standardContext) {
> + String doc = standardContext.getDocBase();
> + // handle ROOT case
> + if (doc == null || doc.length() == 0) {
> + doc = "ROOT";
> + }
> +
> + File war = new File(doc);
> + if (war.exists()) {
> + return war;
> + }
> +
> + final StandardHost host = (StandardHost)
> standardContext.getParent();
> + final String base = host.getAppBase();
> + war = new File(base, doc);
> + if (war.exists()) {
> + return war;
> + }
> +
> + war = new File(new File(System.getProperty("catalina.home"),
> base), doc);
> + if (war.exists()) {
> + return war;
> + }
> + return new File(new File(System.getProperty("catalina.base"),
> base), doc); // shouldn't occur
> + }
> +}
>
>
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
> ----------------------------------------------------------------------
> diff --git
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
> index eee2d2a..2308db0 100644
> ---
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
> +++
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
> @@ -1,121 +1,121 @@
> -/*
> - * 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.tomee.catalina;
> -
> -import org.apache.catalina.Context;
> -import org.apache.catalina.LifecycleException;
> -import org.apache.catalina.loader.WebappLoader;
> -import org.apache.openejb.ClassLoaderUtil;
> -import org.apache.openejb.classloader.ClassLoaderConfigurer;
> -import org.apache.openejb.classloader.CompositeClassLoaderConfigurer;
> -import org.apache.openejb.config.QuickJarsTxtParser;
> -import org.apache.openejb.loader.SystemInstance;
> -
> -import java.io.File;
> -
> -/**
> - * Usage example in META-INF/context.xml
> - * <p/>
> - * <p/>
> - * <Context antiJARLocking="true" >
> - * <Loader
> - * className="org.apache.tomee.catalina.ProvisioningWebappLoader"
> - * searchExternalFirst="true"
> - *
> virtualClasspath="mvn:commons-el:commons-el:1.0;mvn:commons-el:commons-el:1.0"
> - * searchVirtualFirst="true"
> - * />
> - * </Context>
> - */
> -public class TomEEWebappLoader extends WebappLoader {
> - public static final boolean SKIP_BACKGROUND_PROCESS =
> "true".equals(SystemInstance.get().getProperty("tomee.classloader.skip-background-process",
> "false"));
> -
> - private volatile ClassLoader loader;
> -
> - @Override
> - public void backgroundProcess() {
> - if (SKIP_BACKGROUND_PROCESS) {
> - return;
> - }
> -
> - final ClassLoader classloader = super.getClassLoader();
> - if (classloader instanceof TomEEWebappClassLoader) {
> - final TomEEWebappClassLoader tomEEWebappClassLoader =
> (TomEEWebappClassLoader) classloader;
> - tomEEWebappClassLoader.restarting();
> - try {
> - super.backgroundProcess();
> - } finally {
> - tomEEWebappClassLoader.restarted();
> - }
> - } else {
> - super.backgroundProcess();
> - }
> - }
> -
> - @Override
> - public boolean modified() {
> - return !SKIP_BACKGROUND_PROCESS && super.modified();
> - }
> -
> - @Override
> - protected void stopInternal() throws LifecycleException {
> - loader = getClassLoader();
> - super.stopInternal();
> - }
> -
> - public void clearLoader() {
> - loader = null;
> - }
> -
> - public ClassLoader internalLoader() {
> - return loader;
> - }
> -
> - @Override
> - protected void startInternal() throws LifecycleException {
> - if (getClassLoader() != null) {
> - final TomEEWebappClassLoader webappClassLoader =
> TomEEWebappClassLoader.class.cast(getClassLoader());
> - if (webappClassLoader.isStopped()) {
> - webappClassLoader.internalStop();
> - }
> - }
> -
> - final Context context = getContext();
> -
> - ClassLoaderConfigurer configurer =
> ClassLoaderUtil.configurer(context.getName());
> -
> - // WEB-INF/jars.xml
> - final File war = Contexts.warPath(Context.class.cast(context));
> - final File jarsXml = new File(war, "WEB-INF/" +
> QuickJarsTxtParser.FILE_NAME);
> - final ClassLoaderConfigurer configurerTxt =
> QuickJarsTxtParser.parse(jarsXml);
> - if (configurerTxt != null) {
> - configurer = new CompositeClassLoaderConfigurer(configurer,
> configurerTxt);
> - }
> -
> - TomEEWebappClassLoader.initContext(configurer);
> - TomEEWebappClassLoader.initContext(context);
> - try {
> - super.startInternal();
> - } finally {
> - TomEEWebappClassLoader.cleanContext();
> - }
> - }
> -
> - @Override
> - public String toString() {
> - return "TomEE" + super.toString();
> - }
> -}
> +/*
> + * 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.tomee.catalina;
> +
> +import org.apache.catalina.Context;
> +import org.apache.catalina.LifecycleException;
> +import org.apache.catalina.loader.WebappLoader;
> +import org.apache.openejb.ClassLoaderUtil;
> +import org.apache.openejb.classloader.ClassLoaderConfigurer;
> +import org.apache.openejb.classloader.CompositeClassLoaderConfigurer;
> +import org.apache.openejb.config.QuickJarsTxtParser;
> +import org.apache.openejb.loader.SystemInstance;
> +
> +import java.io.File;
> +
> +/**
> + * Usage example in META-INF/context.xml
> + * <p/>
> + * <p/>
> + * <Context antiJARLocking="true" >
> + * <Loader
> + * className="org.apache.tomee.catalina.ProvisioningWebappLoader"
> + * searchExternalFirst="true"
> + *
> virtualClasspath="mvn:commons-el:commons-el:1.0;mvn:commons-el:commons-el:1.0"
> + * searchVirtualFirst="true"
> + * />
> + * </Context>
> + */
> +public class TomEEWebappLoader extends WebappLoader {
> + public static final boolean SKIP_BACKGROUND_PROCESS =
> "true".equals(SystemInstance.get().getProperty("tomee.classloader.skip-background-process",
> "false"));
> +
> + private volatile ClassLoader loader;
> +
> + @Override
> + public void backgroundProcess() {
> + if (SKIP_BACKGROUND_PROCESS) {
> + return;
> + }
> +
> + final ClassLoader classloader = super.getClassLoader();
> + if (classloader instanceof TomEEWebappClassLoader) {
> + final TomEEWebappClassLoader tomEEWebappClassLoader =
> (TomEEWebappClassLoader) classloader;
> + tomEEWebappClassLoader.restarting();
> + try {
> + super.backgroundProcess();
> + } finally {
> + tomEEWebappClassLoader.restarted();
> + }
> + } else {
> + super.backgroundProcess();
> + }
> + }
> +
> + @Override
> + public boolean modified() {
> + return !SKIP_BACKGROUND_PROCESS && super.modified();
> + }
> +
> + @Override
> + protected void stopInternal() throws LifecycleException {
> + loader = getClassLoader();
> + super.stopInternal();
> + }
> +
> + public void clearLoader() {
> + loader = null;
> + }
> +
> + public ClassLoader internalLoader() {
> + return loader;
> + }
> +
> + @Override
> + protected void startInternal() throws LifecycleException {
> + if (getClassLoader() != null) {
> + final TomEEWebappClassLoader webappClassLoader =
> TomEEWebappClassLoader.class.cast(getClassLoader());
> + if (webappClassLoader.isStopped()) {
> + webappClassLoader.internalStop();
> + }
> + }
> +
> + final Context context = getContext();
> +
> + ClassLoaderConfigurer configurer =
> ClassLoaderUtil.configurer(context.getName());
> +
> + // WEB-INF/jars.xml
> + final File war = Contexts.warPath(Context.class.cast(context));
> + final File jarsXml = new File(war, "WEB-INF/" +
> QuickJarsTxtParser.FILE_NAME);
> + final ClassLoaderConfigurer configurerTxt =
> QuickJarsTxtParser.parse(jarsXml);
> + if (configurerTxt != null) {
> + configurer = new CompositeClassLoaderConfigurer(configurer,
> configurerTxt);
> + }
> +
> + TomEEWebappClassLoader.initContext(configurer);
> + TomEEWebappClassLoader.initContext(context);
> + try {
> + super.startInternal();
> + } finally {
> + TomEEWebappClassLoader.cleanContext();
> + }
> + }
> +
> + @Override
> + public String toString() {
> + return "TomEE" + super.toString();
> + }
> +}
>
>
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
> ----------------------------------------------------------------------
> diff --git
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
> index 03fea68..4496e54 100644
> ---
> a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
> +++
> b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
> @@ -1,43 +1,43 @@
> -/*
> - * 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.tomee.catalina;
> -
> -import org.apache.catalina.core.StandardContext;
> -import org.apache.openejb.config.DeploymentLoader;
> -
> -/**
> - * @version $Id$
> - */
> -public class TomcatDeploymentLoader extends DeploymentLoader {
> - private StandardContext standardContext;
> - private String moduleId;
> -
> - public TomcatDeploymentLoader(final StandardContext standardContext,
> final String moduleId) {
> - this.standardContext = standardContext;
> - this.moduleId = moduleId;
> - }
> -
> - @Override
> - protected String getContextRoot() {
> - return standardContext.getPath();
> - }
> -
> - @Override
> - protected String getModuleName() {
> - return moduleId;
> - }
> -}
> +/*
> + * 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.tomee.catalina;
> +
> +import org.apache.catalina.core.StandardContext;
> +import org.apache.openejb.config.DeploymentLoader;
> +
> +/**
> + * @version $Id$
> + */
> +public class TomcatDeploymentLoader extends DeploymentLoader {
> + private StandardContext standardContext;
> + private String moduleId;
> +
> + public TomcatDeploymentLoader(final StandardContext standardContext,
> final String moduleId) {
> + this.standardContext = standardContext;
> + this.moduleId = moduleId;
> + }
> +
> + @Override
> + protected String getContextRoot() {
> + return standardContext.getPath();
> + }
> +
> + @Override
> + protected String getModuleName() {
> + return moduleId;
> + }
> +}
>
>
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
> ----------------------------------------------------------------------
> diff --git
> a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
> b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
> index 1720f9f..a2c8d06 100644
> ---
> a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
> +++
> b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
> @@ -1,134 +1,134 @@
> -/**
> - * 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.tomee.embedded;
> -
> -import java.io.File;
> -import java.util.Set;
> -
> -import org.apache.commons.cli.CommandLine;
> -import org.apache.commons.cli.CommandLineParser;
> -import org.apache.commons.cli.HelpFormatter;
> -import org.apache.commons.cli.Options;
> -import org.apache.commons.cli.ParseException;
> -import org.apache.commons.cli.PosixParser;
> -import org.apache.openejb.loader.ProvisioningUtil;
> -
> -import static org.apache.openejb.loader.JarLocation.jarLocation;
> -
> -public class Main {
> - public static final String PORT = "port";
> - public static final String SHUTDOWN = "shutdown";
> - public static final String PATH = "path";
> - public static final String CONTEXT = "context";
> - public static final String DIRECTORY = "directory";
> - public static final String DOC_BASE = "doc-base";
> - public static final String AS_WAR = "as-war";
> -
> - public static void main(final String[] args) {
> - final CommandLineParser parser = new PosixParser();
> - final Options options = createOptions();
> -
> - // parse command line
> - final CommandLine line;
> - try {
> - line = parser.parse(options, args, true);
> - } catch (final ParseException exp) {
> - new HelpFormatter().printHelp("java -jar
> tomee-embedded-user.jar", options);
> - return;
> - }
> -
> - // run TomEE
> - try {
> - final Container container = new
> Container(createConfiguration(line));
> - final String[] contexts;
> - if (line.hasOption(CONTEXT)) {
> - contexts = line.getOptionValues(CONTEXT);
> - } else {
> - contexts = null;
> - }
> -
> - boolean autoWar = true;
> - int i = 0;
> - if (line.hasOption(PATH)) {
> - for (final String path : line.getOptionValues(PATH)) {
> - final Set<String> locations =
> ProvisioningUtil.realLocation(path);
> - for (final String location : locations) {
> - final File file = new File(location);
> - if (!file.exists()) {
> - System.err.println(file.getAbsolutePath() + "
> does not exist, skipping");
> - continue;
> - }
> -
> - String name =
> file.getName().replaceAll("\\.[A-Za-z]+$", "");
> - if (contexts != null) {
> - name = contexts[i++];
> - }
> - container.deploy(name, file, true);
> - }
> - }
> - autoWar = false;
> - }
> - if (line.hasOption(AS_WAR)) {
> - container.deployClasspathAsWebApp(contexts == null || i
> == contexts.length ? "" : contexts[i],
> - line.hasOption(DOC_BASE) ? new
> File(line.getOptionValue(DOC_BASE)) : null);
> - autoWar = false;
> - }
> - if (autoWar) { // nothing deployed check if we are a war and
> deploy ourself then
> - final File me = jarLocation(Main.class);
> - if (me.getName().endsWith(".war")) {
> - container.deploy(contexts == null || i ==
> contexts.length ? "" : contexts[i], me);
> - }
> - }
> -
> - Runtime.getRuntime().addShutdownHook(new Thread() {
> - @Override
> - public void run() {
> - try {
> - container.stop();
> - } catch (final Exception e) {
> - e.printStackTrace(); // just log the exception
> - }
> - }
> - });
> - container.await();
> - } catch (final Exception e) {
> - e.printStackTrace();
> - }
> - }
> -
> - private static Options createOptions() {
> - final Options options = new Options();
> - options.addOption(null, PATH, true, "");
> - options.addOption(null, CONTEXT, true, "Context name for
> applications (same order than paths)");
> - options.addOption("p", PORT, true, "TomEE http port");
> - options.addOption("s", SHUTDOWN, true, "TomEE shutdown port");
> - options.addOption("d", DIRECTORY, true, "TomEE directory");
> - options.addOption("c", AS_WAR, false, "deploy classpath as war");
> - options.addOption("b", DOC_BASE, true, "when deploy classpath as
> war, the doc base");
> - return options;
> - }
> -
> - private static Configuration createConfiguration(final CommandLine
> args) {
> - final Configuration config = new Configuration();
> - config.setDir(System.getProperty("java.io.tmpdir"));
> - config.setHttpPort(Integer.parseInt(args.getOptionValue(PORT,
> "8080")));
> - config.setStopPort(Integer.parseInt(args.getOptionValue(SHUTDOWN,
> "8005")));
> - config.setDir(args.getOptionValue(DIRECTORY, new File(new
> File("."), "apache-tomee").getAbsolutePath()));
> - return config;
> - }
> -
> -}
> +/**
> + * 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.tomee.embedded;
> +
> +import java.io.File;
> +import java.util.Set;
> +
> +import org.apache.commons.cli.CommandLine;
> +import org.apache.commons.cli.CommandLineParser;
> +import org.apache.commons.cli.HelpFormatter;
> +import org.apache.commons.cli.Options;
> +import org.apache.commons.cli.ParseException;
> +import org.apache.commons.cli.PosixParser;
> +import org.apache.openejb.loader.ProvisioningUtil;
> +
> +import static org.apache.openejb.loader.JarLocation.jarLocation;
> +
> +public class Main {
> + public static final String PORT = "port";
> + public static final String SHUTDOWN = "shutdown";
> + public static final String PATH = "path";
> + public static final String CONTEXT = "context";
> + public static final String DIRECTORY = "directory";
> + public static final String DOC_BASE = "doc-base";
> + public static final String AS_WAR = "as-war";
> +
> + public static void main(final String[] args) {
> + final CommandLineParser parser = new PosixParser();
> + final Options options = createOptions();
> +
> + // parse command line
> + final CommandLine line;
> + try {
> + line = parser.parse(options, args, true);
> + } catch (final ParseException exp) {
> + new HelpFormatter().printHelp("java -jar
> tomee-embedded-user.jar", options);
> + return;
> + }
> +
> + // run TomEE
> + try {
> + final Container container = new
> Container(createConfiguration(line));
> + final String[] contexts;
> + if (line.hasOption(CONTEXT)) {
> + contexts = line.getOptionValues(CONTEXT);
> + } else {
> + contexts = null;
> + }
> +
> + boolean autoWar = true;
> + int i = 0;
> + if (line.hasOption(PATH)) {
> + for (final String path : line.getOptionValues(PATH)) {
> + final Set<String> locations =
> ProvisioningUtil.realLocation(path);
> + for (final String location : locations) {
> + final File file = new File(location);
> + if (!file.exists()) {
> + System.err.println(file.getAbsolutePath() + "
> does not exist, skipping");
> + continue;
> + }
> +
> + String name =
> file.getName().replaceAll("\\.[A-Za-z]+$", "");
> + if (contexts != null) {
> + name = contexts[i++];
> + }
> + container.deploy(name, file, true);
> + }
> + }
> + autoWar = false;
> + }
> + if (line.hasOption(AS_WAR)) {
> + container.deployClasspathAsWebApp(contexts == null || i
> == contexts.length ? "" : contexts[i],
> + line.hasOption(DOC_BASE) ? new
> File(line.getOptionValue(DOC_BASE)) : null);
> + autoWar = false;
> + }
> + if (autoWar) { // nothing deployed check if we are a war and
> deploy ourself then
> + final File me = jarLocation(Main.class);
> + if (me.getName().endsWith(".war")) {
> + container.deploy(contexts == null || i ==
> contexts.length ? "" : contexts[i], me);
> + }
> + }
> +
> + Runtime.getRuntime().addShutdownHook(new Thread() {
> + @Override
> + public void run() {
> + try {
> + container.stop();
> + } catch (final Exception e) {
> + e.printStackTrace(); // just log the exception
> + }
> + }
> + });
> + container.await();
> + } catch (final Exception e) {
> + e.printStackTrace();
> + }
> + }
> +
> + private static Options createOptions() {
> + final Options options = new Options();
> + options.addOption(null, PATH, true, "");
> + options.addOption(null, CONTEXT, true, "Context name for
> applications (same order than paths)");
> + options.addOption("p", PORT, true, "TomEE http port");
> + options.addOption("s", SHUTDOWN, true, "TomEE shutdown port");
> + options.addOption("d", DIRECTORY, true, "TomEE directory");
> + options.addOption("c", AS_WAR, false, "deploy classpath as war");
> + options.addOption("b", DOC_BASE, true, "when deploy classpath as
> war, the doc base");
> + return options;
> + }
> +
> + private static Configuration createConfiguration(final CommandLine
> args) {
> + final Configuration config = new Configuration();
> + config.setDir(System.getProperty("java.io.tmpdir"));
> + config.setHttpPort(Integer.parseInt(args.getOptionValue(PORT,
> "8080")));
> + config.setStopPort(Integer.parseInt(args.getOptionValue(SHUTDOWN,
> "8005")));
> + config.setDir(args.getOptionValue(DIRECTORY, new File(new
> File("."), "apache-tomee").getAbsolutePath()));
> + return config;
> + }
> +
> +}
>
>
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
> ----------------------------------------------------------------------
> diff --git
> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
> index 1d8fcef..f5a4247 100644
> ---
> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
> +++
> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
> @@ -1,241 +1,241 @@
> -// 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.
> -
> -//
> ============================================================================
> -// catalina.policy - Security Policy Permissions for Tomcat 7
> -//
> -// This file contains a default set of security policies to be enforced
> (by the
> -// JVM) when Catalina is executed with the "-security" option. In
> addition
> -// to the permissions granted here, the following additional permissions
> are
> -// granted specific to each web application:
> -//
> -// * Read access to its document root directory
> -// * Read, write and delete access to its working directory
> -//
> -// $Id: catalina.policy 1079755 2011-03-09 11:38:38Z markt $
> -//
> ============================================================================
> -
> -
> -// ========== SYSTEM CODE PERMISSIONS
> =========================================
> -
> -
> -// These permissions apply to javac
> -grant codeBase "file:${java.home}/lib/-" {
> - permission java.security.AllPermission;
> -};
> -
> -// These permissions apply to all shared system extensions
> -grant codeBase "file:${java.home}/jre/lib/ext/-" {
> - permission java.security.AllPermission;
> -};
> -
> -// These permissions apply to javac when ${java.home] points at
> $JAVA_HOME/jre
> -grant codeBase "file:${java.home}/../lib/-" {
> - permission java.security.AllPermission;
> -};
> -
> -// These permissions apply to all shared system extensions when
> -// ${java.home} points at $JAVA_HOME/jre
> -grant codeBase "file:${java.home}/lib/ext/-" {
> - permission java.security.AllPermission;
> -};
> -
> -
> -// ========== CATALINA CODE PERMISSIONS
> =======================================
> -
> -
> -// These permissions apply to the daemon code
> -grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
> - permission java.security.AllPermission;
> -};
> -
> -// These permissions apply to the logging API
> -// Note: If tomcat-juli.jar is in ${catalina.base} and not in
> ${catalina.home},
> -// update this section accordingly.
> -// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..}
> -grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
> - permission java.io.FilePermission
> -
> "${java.home}${file.separator}lib${file.separator}logging.properties",
> "read";
> -
> - permission java.io.FilePermission
> -
> "${catalina.base}${file.separator}conf${file.separator}logging.properties",
> "read";
> - permission java.io.FilePermission
> - "${catalina.base}${file.separator}logs", "read, write";
> - permission java.io.FilePermission
> - "${catalina.base}${file.separator}logs${file.separator}*",
> "read, write";
> -
> - permission java.lang.RuntimePermission "shutdownHooks";
> - permission java.lang.RuntimePermission "getClassLoader";
> - permission java.lang.RuntimePermission "setContextClassLoader";
> -
> - permission java.util.logging.LoggingPermission "control";
> -
> - permission java.util.PropertyPermission
> "java.util.logging.config.class", "read";
> - permission java.util.PropertyPermission
> "java.util.logging.config.file", "read";
> - permission java.util.PropertyPermission "catalina.base", "read";
> -
> - // Note: To enable per context logging configuration, permit read
> access to
> - // the appropriate file. Be sure that the logging configuration is
> - // secure before enabling such access.
> - // E.g. for the examples web application:
> - // permission java.io.FilePermission
> "${catalina.base}${file.separator}
> - // webapps${file.separator}examples${file.separator}WEB-INF
> - // ${file.separator}classes${file.separator}logging.properties",
> "read";
> -};
> -
> -// These permissions apply to the server startup code
> -grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
> - permission java.security.AllPermission;
> -};
> -
> -// These permissions apply to the servlet API classes
> -// and those that are shared across all class loaders
> -// located in the "lib" directory
> -grant codeBase "file:${catalina.home}/lib/-" {
> - permission java.security.AllPermission;
> -};
> -
> -
> -// If using a per instance lib directory, i.e. ${catalina.base}/lib,
> -// then the following permission will need to be uncommented
> -// grant codeBase "file:${catalina.base}/lib/-" {
> -// permission java.security.AllPermission;
> -// };
> -
> -
> -// ========== WEB APPLICATION PERMISSIONS
> =====================================
> -
> -
> -// These permissions are granted by default to all web applications
> -// In addition, a web application will be given a read FilePermission
> -// and JndiPermission for all files and directories in its document root.
> -grant {
> - // Required for JNDI lookup of named JDBC DataSource's and
> - // javamail named MimePart DataSource used to send mail
> - permission java.util.PropertyPermission "java.home", "read";
> - permission java.util.PropertyPermission "java.naming.*", "read";
> - permission java.util.PropertyPermission "javax.sql.*", "read";
> -
> - // OS Specific properties to allow read access
> - permission java.util.PropertyPermission "os.name", "read";
> - permission java.util.PropertyPermission "os.version", "read";
> - permission java.util.PropertyPermission "os.arch", "read";
> - permission java.util.PropertyPermission "file.separator", "read";
> - permission java.util.PropertyPermission "path.separator", "read";
> - permission java.util.PropertyPermission "line.separator", "read";
> -
> - // JVM properties to allow read access
> - permission java.util.PropertyPermission "java.version", "read";
> - permission java.util.PropertyPermission "java.vendor", "read";
> - permission java.util.PropertyPermission "java.vendor.url", "read";
> - permission java.util.PropertyPermission "java.class.version", "read";
> - permission java.util.PropertyPermission "java.specification.version",
> "read";
> - permission java.util.PropertyPermission "java.specification.vendor",
> "read";
> - permission java.util.PropertyPermission "java.specification.name",
> "read";
> -
> - permission java.util.PropertyPermission
> "java.vm.specification.version", "read";
> - permission java.util.PropertyPermission
> "java.vm.specification.vendor", "read";
> - permission java.util.PropertyPermission "java.vm.specification.name",
> "read";
> - permission java.util.PropertyPermission "java.vm.version", "read";
> - permission java.util.PropertyPermission "java.vm.vendor", "read";
> - permission java.util.PropertyPermission "java.vm.name", "read";
> -
> - // Required for OpenJMX
> - permission java.lang.RuntimePermission "getAttribute";
> -
> - // Allow read of JAXP compliant XML parser debug
> - permission java.util.PropertyPermission "jaxp.debug", "read";
> -
> - // All JSPs need to be able to read this package
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.tomcat";
> -
> - // Precompiled JSPs need access to these packages.
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.jasper.el";
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.jasper.runtime";
> - permission java.lang.RuntimePermission
> - "accessClassInPackage.org.apache.jasper.runtime.*";
> -
> - // Precompiled JSPs need access to these system properties.
> - permission java.util.PropertyPermission
> - "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read";
> - permission java.util.PropertyPermission
> - "org.apache.el.parser.COERCE_TO_ZERO", "read";
> -
> - // The cookie code needs these.
> - permission java.util.PropertyPermission
> - "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
> - permission java.util.PropertyPermission
> - "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
> - permission java.util.PropertyPermission
> - "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR",
> "read";
> -
> - // Applications using Comet need to be able to access this package
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.comet";
> -};
> -
> -
> -// The Manager application needs access to the following packages to
> support the
> -// session display functionality. These settings support the following
> -// configurations:
> -// - default CATALINA_HOME == CATALINA_BASE
> -// - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE
> -// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME
> -grant codeBase "file:${catalina.base}/webapps/manager/-" {
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina";
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.ha.session";
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.manager";
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.manager.util";
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.util";
> -};
> -grant codeBase "file:${catalina.home}/webapps/manager/-" {
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina";
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.ha.session";
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.manager";
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.manager.util";
> - permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.util";
> -};
> -
> -// You can assign additional permissions to particular web applications by
> -// adding additional "grant" entries here, based on the code base for that
> -// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
> -//
> -// Different permissions can be granted to JSP pages, classes loaded from
> -// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
> -// directory, or even to individual jar files in the /WEB-INF/lib/
> directory.
> -//
> -// For instance, assume that the standard "examples" application
> -// included a JDBC driver that needed to establish a network connection
> to the
> -// corresponding database and used the scrape taglib to get the weather
> from
> -// the NOAA web server. You might create a "grant" entries like this:
> -//
> -// The permissions granted to the context root directory apply to JSP
> pages.
> -// grant codeBase "file:${catalina.base}/webapps/examples/-" {
> -// permission java.net.SocketPermission "dbhost.mycompany.com:5432",
> "connect";
> -// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
> -// };
> -//
> -// The permissions granted to the context WEB-INF/classes directory
> -// grant codeBase
> "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
> -// };
> -//
> -// The permission granted to your JDBC driver
> -// grant codeBase
> "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
> -// permission java.net.SocketPermission "dbhost.mycompany.com:5432",
> "connect";
> -// };
> -// The permission granted to the scrape taglib
> -// grant codeBase
> "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
> -// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
> -// };
> -
> +// 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.
> +
> +//
> ============================================================================
> +// catalina.policy - Security Policy Permissions for Tomcat 7
> +//
> +// This file contains a default set of security policies to be enforced
> (by the
> +// JVM) when Catalina is executed with the "-security" option. In
> addition
> +// to the permissions granted here, the following additional permissions
> are
> +// granted specific to each web application:
> +//
> +// * Read access to its document root directory
> +// * Read, write and delete access to its working directory
> +//
> +// $Id: catalina.policy 1079755 2011-03-09 11:38:38Z markt $
> +//
> ============================================================================
> +
> +
> +// ========== SYSTEM CODE PERMISSIONS
> =========================================
> +
> +
> +// These permissions apply to javac
> +grant codeBase "file:${java.home}/lib/-" {
> + permission java.security.AllPermission;
> +};
> +
> +// These permissions apply to all shared system extensions
> +grant codeBase "file:${java.home}/jre/lib/ext/-" {
> + permission java.security.AllPermission;
> +};
> +
> +// These permissions apply to javac when ${java.home] points at
> $JAVA_HOME/jre
> +grant codeBase "file:${java.home}/../lib/-" {
> + permission java.security.AllPermission;
> +};
> +
> +// These permissions apply to all shared system extensions when
> +// ${java.home} points at $JAVA_HOME/jre
> +grant codeBase "file:${java.home}/lib/ext/-" {
> + permission java.security.AllPermission;
> +};
> +
> +
> +// ========== CATALINA CODE PERMISSIONS
> =======================================
> +
> +
> +// These permissions apply to the daemon code
> +grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
> + permission java.security.AllPermission;
> +};
> +
> +// These permissions apply to the logging API
> +// Note: If tomcat-juli.jar is in ${catalina.base} and not in
> ${catalina.home},
> +// update this section accordingly.
> +// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..}
> +grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
> + permission java.io.FilePermission
> +
> "${java.home}${file.separator}lib${file.separator}logging.properties",
> "read";
> +
> + permission java.io.FilePermission
> +
> "${catalina.base}${file.separator}conf${file.separator}logging.properties",
> "read";
> + permission java.io.FilePermission
> + "${catalina.base}${file.separator}logs", "read, write";
> + permission java.io.FilePermission
> + "${catalina.base}${file.separator}logs${file.separator}*",
> "read, write";
> +
> + permission java.lang.RuntimePermission "shutdownHooks";
> + permission java.lang.RuntimePermission "getClassLoader";
> + permission java.lang.RuntimePermission "setContextClassLoader";
> +
> + permission java.util.logging.LoggingPermission "control";
> +
> + permission java.util.PropertyPermission
> "java.util.logging.config.class", "read";
> + permission java.util.PropertyPermission
> "java.util.logging.config.file", "read";
> + permission java.util.PropertyPermission "catalina.base", "read";
> +
> + // Note: To enable per context logging configuration, permit read
> access to
> + // the appropriate file. Be sure that the logging configuration is
> + // secure before enabling such access.
> + // E.g. for the examples web application:
> + // permission java.io.FilePermission
> "${catalina.base}${file.separator}
> + // webapps${file.separator}examples${file.separator}WEB-INF
> + // ${file.separator}classes${file.separator}logging.properties",
> "read";
> +};
> +
> +// These permissions apply to the server startup code
> +grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
> + permission java.security.AllPermission;
> +};
> +
> +// These permissions apply to the servlet API classes
> +// and those that are shared across all class loaders
> +// located in the "lib" directory
> +grant codeBase "file:${catalina.home}/lib/-" {
> + permission java.security.AllPermission;
> +};
> +
> +
> +// If using a per instance lib directory, i.e. ${catalina.base}/lib,
> +// then the following permission will need to be uncommented
> +// grant codeBase "file:${catalina.base}/lib/-" {
> +// permission java.security.AllPermission;
> +// };
> +
> +
> +// ========== WEB APPLICATION PERMISSIONS
> =====================================
> +
> +
> +// These permissions are granted by default to all web applications
> +// In addition, a web application will be given a read FilePermission
> +// and JndiPermission for all files and directories in its document root.
> +grant {
> + // Required for JNDI lookup of named JDBC DataSource's and
> + // javamail named MimePart DataSource used to send mail
> + permission java.util.PropertyPermission "java.home", "read";
> + permission java.util.PropertyPermission "java.naming.*", "read";
> + permission java.util.PropertyPermission "javax.sql.*", "read";
> +
> + // OS Specific properties to allow read access
> + permission java.util.PropertyPermission "os.name", "read";
> + permission java.util.PropertyPermission "os.version", "read";
> + permission java.util.PropertyPermission "os.arch", "read";
> + permission java.util.PropertyPermission "file.separator", "read";
> + permission java.util.PropertyPermission "path.separator", "read";
> + permission java.util.PropertyPermission "line.separator", "read";
> +
> + // JVM properties to allow read access
> + permission java.util.PropertyPermission "java.version", "read";
> + permission java.util.PropertyPermission "java.vendor", "read";
> + permission java.util.PropertyPermission "java.vendor.url", "read";
> + permission java.util.PropertyPermission "java.class.version", "read";
> + permission java.util.PropertyPermission "java.specification.version",
> "read";
> + permission java.util.PropertyPermission "java.specification.vendor",
> "read";
> + permission java.util.PropertyPermission "java.specification.name",
> "read";
> +
> + permission java.util.PropertyPermission
> "java.vm.specification.version", "read";
> + permission java.util.PropertyPermission
> "java.vm.specification.vendor", "read";
> + permission java.util.PropertyPermission "java.vm.specification.name",
> "read";
> + permission java.util.PropertyPermission "java.vm.version", "read";
> + permission java.util.PropertyPermission "java.vm.vendor", "read";
> + permission java.util.PropertyPermission "java.vm.name", "read";
> +
> + // Required for OpenJMX
> + permission java.lang.RuntimePermission "getAttribute";
> +
> + // Allow read of JAXP compliant XML parser debug
> + permission java.util.PropertyPermission "jaxp.debug", "read";
> +
> + // All JSPs need to be able to read this package
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.tomcat";
> +
> + // Precompiled JSPs need access to these packages.
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.jasper.el";
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.jasper.runtime";
> + permission java.lang.RuntimePermission
> + "accessClassInPackage.org.apache.jasper.runtime.*";
> +
> + // Precompiled JSPs need access to these system properties.
> + permission java.util.PropertyPermission
> + "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read";
> + permission java.util.PropertyPermission
> + "org.apache.el.parser.COERCE_TO_ZERO", "read";
> +
> + // The cookie code needs these.
> + permission java.util.PropertyPermission
> + "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
> + permission java.util.PropertyPermission
> + "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
> + permission java.util.PropertyPermission
> + "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR",
> "read";
> +
> + // Applications using Comet need to be able to access this package
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.comet";
> +};
> +
> +
> +// The Manager application needs access to the following packages to
> support the
> +// session display functionality. These settings support the following
> +// configurations:
> +// - default CATALINA_HOME == CATALINA_BASE
> +// - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE
> +// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME
> +grant codeBase "file:${catalina.base}/webapps/manager/-" {
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina";
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.ha.session";
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.manager";
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.manager.util";
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.util";
> +};
> +grant codeBase "file:${catalina.home}/webapps/manager/-" {
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina";
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.ha.session";
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.manager";
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.manager.util";
> + permission java.lang.RuntimePermission
> "accessClassInPackage.org.apache.catalina.util";
> +};
> +
> +// You can assign additional permissions to particular web applications by
> +// adding additional "grant" entries here, based on the code base for that
> +// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
> +//
> +// Different permissions can be granted to JSP pages, classes loaded from
> +// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
> +// directory, or even to individual jar files in the /WEB-INF/lib/
> directory.
> +//
> +// For instance, assume that the standard "examples" application
> +// included a JDBC driver that needed to establish a network connection
> to the
> +// corresponding database and used the scrape taglib to get the weather
> from
> +// the NOAA web server. You might create a "grant" entries like this:
> +//
> +// The permissions granted to the context root directory apply to JSP
> pages.
> +// grant codeBase "file:${catalina.base}/webapps/examples/-" {
> +// permission java.net.SocketPermission "dbhost.mycompany.com:5432",
> "connect";
> +// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
> +// };
> +//
> +// The permissions granted to the context WEB-INF/classes directory
> +// grant codeBase
> "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
> +// };
> +//
> +// The permission granted to your JDBC driver
> +// grant codeBase
> "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
> +// permission java.net.SocketPermission "dbhost.mycompany.com:5432",
> "connect";
> +// };
> +// The permission granted to the scrape taglib
> +// grant codeBase
> "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
> +// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
> +// };
> +
>
>
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
> ----------------------------------------------------------------------
> diff --git
> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
> index 5089043..ff86449 100644
> ---
> a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
> +++
> b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
> @@ -1,122 +1,122 @@
> -# 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.
> -
> -#
> -# List of comma-separated packages that start with or equal this string
> -# will cause a security exception to be thrown when
> -# passed to checkPackageAccess unless the
> -# corresponding RuntimePermission ("accessClassInPackage."+package) has
> -# been granted.
>
> -package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
> -#
> -# List of comma-separated packages that start with or equal this string
> -# will cause a security exception to be thrown when
> -# passed to checkPackageDefinition unless the
> -# corresponding RuntimePermission ("defineClassInPackage."+package) has
> -# been granted.
> -#
> -# by default, no packages are restricted for definition, and none of
> -# the class loaders supplied with the JDK call checkPackageDefinition.
> -#
>
> -package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
> -
> -#
> -#
> -# List of comma-separated paths defining the contents of the "common"
> -# classloader. Prefixes should be used to define what is the repository
> type.
> -# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
> absolute.
> -# If left as blank,the JVM system loader will be used as Catalina's
> "common"
> -# loader.
> -# Examples:
> -# "foo": Add this folder as a class repository
> -# "foo/*.jar": Add all the JARs of the specified folder as class
> -# repositories
> -# "foo/bar.jar": Add bar.jar as a class repository
>
> -common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
> -
> -#
> -# List of comma-separated paths defining the contents of the "server"
> -# classloader. Prefixes should be used to define what is the repository
> type.
> -# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
> absolute.
> -# If left as blank, the "common" loader will be used as Catalina's
> "server"
> -# loader.
> -# Examples:
> -# "foo": Add this folder as a class repository
> -# "foo/*.jar": Add all the JARs of the specified folder as class
> -# repositories
> -# "foo/bar.jar": Add bar.jar as a class repository
> -server.loader=
> -
> -#
> -# List of comma-separated paths defining the contents of the "shared"
> -# classloader. Prefixes should be used to define what is the repository
> type.
> -# Path may be relative to the CATALINA_BASE path or absolute. If left as
> blank,
> -# the "common" loader will be used as Catalina's "shared" loader.
> -# Examples:
> -# "foo": Add this folder as a class repository
> -# "foo/*.jar": Add all the JARs of the specified folder as class
> -# repositories
> -# "foo/bar.jar": Add bar.jar as a class repository
> -# Please note that for single jars, e.g. bar.jar, you need the URL form
> -# starting with file:.
> -shared.loader=
> -
> -# List of JAR files that should not be scanned for configuration
> information
> -# such as web fragments, TLD files etc. It must be a comma separated list
> of
> -# JAR file names.
> -# The JARs listed below include:
> -# - Tomcat Bootstrap JARs
> -# - Tomcat API JARs
> -# - Catalina JARs
> -# - Jasper JARs
> -# - Tomcat JARs
> -# - Common non-Tomcat JARs
> -# - Sun JDK JARs
> -# - Apple JDK JARs
> -tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
> -bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
> -annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\
> -catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\
> -jasper.jar,jasper-el.jar,ecj-*.jar,\
> -tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\
>
> -tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\
> -commons-beanutils*.jar,commons-collections*.jar,commons-dbcp*.jar,\
> -commons-digester*.jar,commons-fileupload*.jar,commons-logging*.jar,\
> -commons-pool*.jar,\
> -bcprov-*.jar,\
> -ant.jar,jmx.jar,jmx-tools.jar,\
> -xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
>
> -dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunpkcs11.jar,tools.jar,\
> -apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\
> -j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\
> -mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\
> -hsqldb-*,openejb-core-*,xbean-*,derby*,mbean-annotation-*,\
>
> -javassit*,commons-*,swizzle-stream-*,serp-*,geronimo-javamail-*,geronimo-mail-*,\
>
> -openejb-jee-*,openejb-core-*,openejb-loader-*,openejb-api-*,openejb-derby*,\
> -openwebbeans-ejb-*,openwebbeans-impl-*,\
> -bval-*,\
>
> -tomee-loader-*,openejb-javaagent-*,openejb-ejbd-*,scannotation-*,openejb-server-*,\
> -openjpa-*,quartz-*,openejb-http-*,kahadb-*
> -
> -#
> -# String cache configuration.
> -tomcat.util.buf.StringCache.byte.enabled=true
> -#tomcat.util.buf.StringCache.char.enabled=true
> -#tomcat.util.buf.StringCache.trainThreshold=500000
> -#tomcat.util.buf.StringCache.cacheSize=5000
> -
> -http.port=${tomcatHttpPort}
> -shutdown.port=${tomcatShutdownPort}
> +# 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.
> +
> +#
> +# List of comma-separated packages that start with or equal this string
> +# will cause a security exception to be thrown when
> +# passed to checkPackageAccess unless the
> +# corresponding RuntimePermission ("accessClassInPackage."+package) has
> +# been granted.
>
> +package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
> +#
> +# List of comma-separated packages that start with or equal this string
> +# will cause a security exception to be thrown when
> +# passed to checkPackageDefinition unless the
> +# corresponding RuntimePermission ("defineClassInPackage."+package) has
> +# been granted.
> +#
> +# by default, no packages are restricted for definition, and none of
> +# the class loaders supplied with the JDK call checkPackageDefinition.
> +#
>
> +package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
> +
> +#
> +#
> +# List of comma-separated paths defining the contents of the "common"
> +# classloader. Prefixes should be used to define what is the repository
> type.
> +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
> absolute.
> +# If left as blank,the JVM system loader will be used as Catalina's
> "common"
> +# loader.
> +# Examples:
> +# "foo": Add this folder as a class repository
> +# "foo/*.jar": Add all the JARs of the specified folder as class
> +# repositories
> +# "foo/bar.jar": Add bar.jar as a class repository
>
> +common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
> +
> +#
> +# List of comma-separated paths defining the contents of the "server"
> +# classloader. Prefixes should be used to define what is the repository
> type.
> +# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or
> absolute.
> +# If left as blank, the "common" loader will be used as Catalina's
> "server"
> +# loader.
> +# Examples:
> +# "foo": Add this folder as a class repository
> +# "foo/*.jar": Add all the JARs of the specified folder as class
> +# repositories
> +# "foo/bar.jar": Add bar.jar as a class repository
> +server.loader=
> +
> +#
> +# List of comma-separated paths defining the contents of the "shared"
> +# classloader. Prefixes should be used to define what is the repository
> type.
> +# Path may be relative to the CATALINA_BASE path or absolute. If left as
> blank,
> +# the "common" loader will be used as Catalina's "shared" loader.
> +# Examples:
> +# "foo": Add this folder as a class repository
> +# "foo/*.jar": Add all the JARs of the specified folder as class
> +# repositories
> +# "foo/bar.jar": Add bar.jar as a class repository
> +# Please note that for single jars, e.g. bar.jar, you need the URL form
> +# starting with file:.
> +shared.loader=
> +
> +# List of JAR files that should not be scanned for configuration
> information
> +# such as web fragments, TLD files etc. It must be a comma separated list
> of
> +# JAR file names.
> +# The JARs listed below include:
> +# - Tomcat Bootstrap JARs
> +# - Tomcat API JARs
> +# - Catalina JARs
> +# - Jasper JARs
> +# - Tomcat JARs
> +# - Common non-Tomcat JARs
> +# - Sun JDK JARs
> +# - Apple JDK JARs
> +tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
> +bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
> +annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\
> +catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\
> +jasper.jar,jasper-el.jar,ecj-*.jar,\
> +tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\
>
> +tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\
> +commons-beanutils*.jar,commons-collections*.jar,commons-dbcp*.jar,\
> +commons-digester*.jar,commons-fileupload*.jar,commons-logging*.jar,\
> +commons-pool*.jar,\
> +bcprov-*.jar,\
> +ant.jar,jmx.jar,jmx-tools.jar,\
> +xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
>
> +dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunpkcs11.jar,tools.jar,\
> +apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\
> +j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\
> +mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\
> +hsqldb-*,openejb-core-*,xbean-*,derby*,mbean-annotation-*,\
>
> +javassit*,commons-*,swizzle-stream-*,serp-*,geronimo-javamail-*,geronimo-mail-*,\
>
> +openejb-jee-*,openejb-core-*,openejb-loader-*,openejb-api-*,openejb-derby*,\
> +openwebbeans-ejb-*,openwebbeans-impl-*,\
> +bval-*,\
>
> +tomee-loader-*,openejb-javaagent-*,openejb-ejbd-*,scannotation-*,openejb-server-*,\
> +openjpa-*,quartz-*,openejb-http-*,kahadb-*
> +
> +#
> +# String cache configuration.
> +tomcat.util.buf.StringCache.byte.enabled=true
> +#tomcat.util.buf.StringCache.char.enabled=true
> +#tomcat.util.buf.StringCache.trainThreshold=500000
> +#tomcat.util.buf.StringCache.cacheSize=5000
> +
> +http.port=${tomcatHttpPort}
> +shutdown.port=${tomcatShutdownPort}
> shutdown.command=${tomcatShutdownCommand}
> \ No newline at end of file
>
>
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
> ----------------------------------------------------------------------
> diff --git
> a/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
> b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
> index abbc097..8f828b9 100644
> ---
> a/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
> +++
> b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
> @@ -1,26 +1,26 @@
> -/**
> - * 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.tomee.embedded;
> -
> -import javax.ejb.Singleton;
> -
> -@Singleton
> -public class ABean {
> - public String embedded() {
> - return "ok";
> - }
> -}
> +/**
> + * 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.tomee.embedded;
> +
> +import javax.ejb.Singleton;
> +
> +@Singleton
> +public class ABean {
> + public String embedded() {
> + return "ok";
> + }
> +}
>
>
> http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
> ----------------------------------------------------------------------
> diff --git a/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
> b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
> index e0d7a63..b1514dd 100644
> --- a/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
> +++ b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
> @@ -1,19 +1,19 @@
> -<?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.
> --->
> -<beans />
> +<?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.
> +-->
> +<beans />
>
>
[2/3] tomee git commit: EOL commit
Posted by rm...@apache.org.
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/build.xml
----------------------------------------------------------------------
diff --git a/tomee/build.xml b/tomee/build.xml
index eff1327..c660e7c 100644
--- a/tomee/build.xml
+++ b/tomee/build.xml
@@ -1,46 +1,46 @@
-<?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="dev-helper" default="web">
-
- <target name="web">
- <copy verbose="true" todir="apache-tomee/target/apache-tomee-webprofile-7.0.0-SNAPSHOT/webapps/tomee">
- <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.js"/>
- <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.css"/>
- <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.html"/>
- </copy>
- </target>
-
- <target name="rs">
- <copy verbose="true" todir="apache-tomee/target/apache-tomee-jaxrs-7.0.0-SNAPSHOT/webapps/tomee">
- <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.js"/>
- <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.css"/>
- <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.html"/>
- </copy>
- </target>
-
- <target name="plus">
- <copy verbose="true" todir="apache-tomee/target/apache-tomee-plus-7.0.0-SNAPSHOT/webapps/tomee">
- <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.js"/>
- <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.css"/>
- <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.html"/>
- </copy>
- </target>
-
-</project>
-
+<?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="dev-helper" default="web">
+
+ <target name="web">
+ <copy verbose="true" todir="apache-tomee/target/apache-tomee-webprofile-7.0.0-SNAPSHOT/webapps/tomee">
+ <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.js"/>
+ <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.css"/>
+ <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.html"/>
+ </copy>
+ </target>
+
+ <target name="rs">
+ <copy verbose="true" todir="apache-tomee/target/apache-tomee-jaxrs-7.0.0-SNAPSHOT/webapps/tomee">
+ <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.js"/>
+ <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.css"/>
+ <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.html"/>
+ </copy>
+ </target>
+
+ <target name="plus">
+ <copy verbose="true" todir="apache-tomee/target/apache-tomee-plus-7.0.0-SNAPSHOT/webapps/tomee">
+ <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.js"/>
+ <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.css"/>
+ <fileset dir="tomee-webapp/src/main/webapp" includes="**/*.html"/>
+ </copy>
+ </target>
+
+</project>
+
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
index 2ca6ac6..2208d91 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/Contexts.java
@@ -1,165 +1,165 @@
-/*
- * 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.tomee.catalina;
-
-import org.apache.catalina.Container;
-import org.apache.catalina.Context;
-import org.apache.catalina.Globals;
-import org.apache.catalina.Host;
-import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.core.StandardEngine;
-import org.apache.catalina.core.StandardHost;
-import org.apache.catalina.util.ContextName;
-
-import java.io.File;
-import java.io.IOException;
-
-public class Contexts {
- public static String getHostname(final StandardContext ctx) {
- String hostName = null;
- final Container parentHost = ctx.getParent();
- if (parentHost != null) {
- hostName = parentHost.getName();
- }
- if ((hostName == null) || (hostName.length() < 1)) {
- hostName = "_";
- }
- return hostName;
- }
-
- public static File warPath(final Context standardContext) {
- final File file = realWarPath(standardContext);
- if (file == null) {
- return null;
- }
-
- final String name = file.getName();
- if (!file.isDirectory() && name.endsWith(".war")) {
- final File extracted = new File(file.getParentFile(), name.substring(0, name.length() - ".war".length()));
- if (extracted.exists()) {
- try {
- return extracted.getCanonicalFile();
- } catch (final IOException e) {
- return extracted;
- }
- }
- }
- try {
- return file.getCanonicalFile();
- } catch (final IOException e) {
- return file;
- }
- }
-
- public static File realWarPath(final Context standardContext) {
- if (standardContext == null) {
- return null;
- }
-
- final File docBase;
- Container container = standardContext;
- while (container != null) {
- if (container instanceof Host) {
- break;
- }
- container = container.getParent();
- }
-
- String baseName = null;
- if (standardContext.getDocBase() != null) {
- File file = new File(standardContext.getDocBase());
- if (!file.isAbsolute()) {
- if (container == null) {
- docBase = new File(engineBase(standardContext), standardContext.getDocBase());
- } else {
- final String appBase = ((Host) container).getAppBase();
- file = new File(appBase);
- if (!file.isAbsolute()) {
- file = new File(engineBase(standardContext), appBase);
- }
- docBase = new File(file, standardContext.getDocBase());
- }
- } else {
- docBase = file;
- }
- } else {
- final String path = standardContext.getPath();
- if (path == null) {
- throw new IllegalStateException("Can't find docBase");
- } else {
- baseName = new ContextName(path, standardContext.getWebappVersion()).getBaseName();
- docBase = new File(baseName);
- }
- }
-
- if (!docBase.exists() && baseName != null) { // for old compatibility, will be removed soon
- if (Host.class.isInstance(container)) {
- final File file = new File(Host.class.cast(container).getAppBaseFile(), baseName);
- if (file.exists()) {
- return file;
- }
- }
- return oldRealWarPath(standardContext);
- }
-
- final String name = docBase.getName();
- if (name.endsWith(".war")) {
- final File extracted = new File(docBase.getParentFile(), name.substring(0, name.length() - ".war".length()));
- if (extracted.exists()) {
- return extracted;
- }
- }
-
- return docBase;
- }
-
- private static File engineBase(final Context standardContext) {
- final String base = System.getProperty(Globals.CATALINA_BASE_PROP);
- if( base == null ) {
- final StandardEngine eng = (StandardEngine) standardContext.getParent().getParent();
- return eng.getCatalinaBase();
- }
- return new File(base);
- }
-
- @Deprecated
- private static File oldRealWarPath(final Context standardContext) {
- String doc = standardContext.getDocBase();
- // handle ROOT case
- if (doc == null || doc.length() == 0) {
- doc = "ROOT";
- }
-
- File war = new File(doc);
- if (war.exists()) {
- return war;
- }
-
- final StandardHost host = (StandardHost) standardContext.getParent();
- final String base = host.getAppBase();
- war = new File(base, doc);
- if (war.exists()) {
- return war;
- }
-
- war = new File(new File(System.getProperty("catalina.home"), base), doc);
- if (war.exists()) {
- return war;
- }
- return new File(new File(System.getProperty("catalina.base"), base), doc); // shouldn't occur
- }
-}
+/*
+ * 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.tomee.catalina;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.Context;
+import org.apache.catalina.Globals;
+import org.apache.catalina.Host;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.core.StandardEngine;
+import org.apache.catalina.core.StandardHost;
+import org.apache.catalina.util.ContextName;
+
+import java.io.File;
+import java.io.IOException;
+
+public class Contexts {
+ public static String getHostname(final StandardContext ctx) {
+ String hostName = null;
+ final Container parentHost = ctx.getParent();
+ if (parentHost != null) {
+ hostName = parentHost.getName();
+ }
+ if ((hostName == null) || (hostName.length() < 1)) {
+ hostName = "_";
+ }
+ return hostName;
+ }
+
+ public static File warPath(final Context standardContext) {
+ final File file = realWarPath(standardContext);
+ if (file == null) {
+ return null;
+ }
+
+ final String name = file.getName();
+ if (!file.isDirectory() && name.endsWith(".war")) {
+ final File extracted = new File(file.getParentFile(), name.substring(0, name.length() - ".war".length()));
+ if (extracted.exists()) {
+ try {
+ return extracted.getCanonicalFile();
+ } catch (final IOException e) {
+ return extracted;
+ }
+ }
+ }
+ try {
+ return file.getCanonicalFile();
+ } catch (final IOException e) {
+ return file;
+ }
+ }
+
+ public static File realWarPath(final Context standardContext) {
+ if (standardContext == null) {
+ return null;
+ }
+
+ final File docBase;
+ Container container = standardContext;
+ while (container != null) {
+ if (container instanceof Host) {
+ break;
+ }
+ container = container.getParent();
+ }
+
+ String baseName = null;
+ if (standardContext.getDocBase() != null) {
+ File file = new File(standardContext.getDocBase());
+ if (!file.isAbsolute()) {
+ if (container == null) {
+ docBase = new File(engineBase(standardContext), standardContext.getDocBase());
+ } else {
+ final String appBase = ((Host) container).getAppBase();
+ file = new File(appBase);
+ if (!file.isAbsolute()) {
+ file = new File(engineBase(standardContext), appBase);
+ }
+ docBase = new File(file, standardContext.getDocBase());
+ }
+ } else {
+ docBase = file;
+ }
+ } else {
+ final String path = standardContext.getPath();
+ if (path == null) {
+ throw new IllegalStateException("Can't find docBase");
+ } else {
+ baseName = new ContextName(path, standardContext.getWebappVersion()).getBaseName();
+ docBase = new File(baseName);
+ }
+ }
+
+ if (!docBase.exists() && baseName != null) { // for old compatibility, will be removed soon
+ if (Host.class.isInstance(container)) {
+ final File file = new File(Host.class.cast(container).getAppBaseFile(), baseName);
+ if (file.exists()) {
+ return file;
+ }
+ }
+ return oldRealWarPath(standardContext);
+ }
+
+ final String name = docBase.getName();
+ if (name.endsWith(".war")) {
+ final File extracted = new File(docBase.getParentFile(), name.substring(0, name.length() - ".war".length()));
+ if (extracted.exists()) {
+ return extracted;
+ }
+ }
+
+ return docBase;
+ }
+
+ private static File engineBase(final Context standardContext) {
+ final String base = System.getProperty(Globals.CATALINA_BASE_PROP);
+ if( base == null ) {
+ final StandardEngine eng = (StandardEngine) standardContext.getParent().getParent();
+ return eng.getCatalinaBase();
+ }
+ return new File(base);
+ }
+
+ @Deprecated
+ private static File oldRealWarPath(final Context standardContext) {
+ String doc = standardContext.getDocBase();
+ // handle ROOT case
+ if (doc == null || doc.length() == 0) {
+ doc = "ROOT";
+ }
+
+ File war = new File(doc);
+ if (war.exists()) {
+ return war;
+ }
+
+ final StandardHost host = (StandardHost) standardContext.getParent();
+ final String base = host.getAppBase();
+ war = new File(base, doc);
+ if (war.exists()) {
+ return war;
+ }
+
+ war = new File(new File(System.getProperty("catalina.home"), base), doc);
+ if (war.exists()) {
+ return war;
+ }
+ return new File(new File(System.getProperty("catalina.base"), base), doc); // shouldn't occur
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
index eee2d2a..2308db0 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomEEWebappLoader.java
@@ -1,121 +1,121 @@
-/*
- * 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.tomee.catalina;
-
-import org.apache.catalina.Context;
-import org.apache.catalina.LifecycleException;
-import org.apache.catalina.loader.WebappLoader;
-import org.apache.openejb.ClassLoaderUtil;
-import org.apache.openejb.classloader.ClassLoaderConfigurer;
-import org.apache.openejb.classloader.CompositeClassLoaderConfigurer;
-import org.apache.openejb.config.QuickJarsTxtParser;
-import org.apache.openejb.loader.SystemInstance;
-
-import java.io.File;
-
-/**
- * Usage example in META-INF/context.xml
- * <p/>
- * <p/>
- * <Context antiJARLocking="true" >
- * <Loader
- * className="org.apache.tomee.catalina.ProvisioningWebappLoader"
- * searchExternalFirst="true"
- * virtualClasspath="mvn:commons-el:commons-el:1.0;mvn:commons-el:commons-el:1.0"
- * searchVirtualFirst="true"
- * />
- * </Context>
- */
-public class TomEEWebappLoader extends WebappLoader {
- public static final boolean SKIP_BACKGROUND_PROCESS = "true".equals(SystemInstance.get().getProperty("tomee.classloader.skip-background-process", "false"));
-
- private volatile ClassLoader loader;
-
- @Override
- public void backgroundProcess() {
- if (SKIP_BACKGROUND_PROCESS) {
- return;
- }
-
- final ClassLoader classloader = super.getClassLoader();
- if (classloader instanceof TomEEWebappClassLoader) {
- final TomEEWebappClassLoader tomEEWebappClassLoader = (TomEEWebappClassLoader) classloader;
- tomEEWebappClassLoader.restarting();
- try {
- super.backgroundProcess();
- } finally {
- tomEEWebappClassLoader.restarted();
- }
- } else {
- super.backgroundProcess();
- }
- }
-
- @Override
- public boolean modified() {
- return !SKIP_BACKGROUND_PROCESS && super.modified();
- }
-
- @Override
- protected void stopInternal() throws LifecycleException {
- loader = getClassLoader();
- super.stopInternal();
- }
-
- public void clearLoader() {
- loader = null;
- }
-
- public ClassLoader internalLoader() {
- return loader;
- }
-
- @Override
- protected void startInternal() throws LifecycleException {
- if (getClassLoader() != null) {
- final TomEEWebappClassLoader webappClassLoader = TomEEWebappClassLoader.class.cast(getClassLoader());
- if (webappClassLoader.isStopped()) {
- webappClassLoader.internalStop();
- }
- }
-
- final Context context = getContext();
-
- ClassLoaderConfigurer configurer = ClassLoaderUtil.configurer(context.getName());
-
- // WEB-INF/jars.xml
- final File war = Contexts.warPath(Context.class.cast(context));
- final File jarsXml = new File(war, "WEB-INF/" + QuickJarsTxtParser.FILE_NAME);
- final ClassLoaderConfigurer configurerTxt = QuickJarsTxtParser.parse(jarsXml);
- if (configurerTxt != null) {
- configurer = new CompositeClassLoaderConfigurer(configurer, configurerTxt);
- }
-
- TomEEWebappClassLoader.initContext(configurer);
- TomEEWebappClassLoader.initContext(context);
- try {
- super.startInternal();
- } finally {
- TomEEWebappClassLoader.cleanContext();
- }
- }
-
- @Override
- public String toString() {
- return "TomEE" + super.toString();
- }
-}
+/*
+ * 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.tomee.catalina;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.loader.WebappLoader;
+import org.apache.openejb.ClassLoaderUtil;
+import org.apache.openejb.classloader.ClassLoaderConfigurer;
+import org.apache.openejb.classloader.CompositeClassLoaderConfigurer;
+import org.apache.openejb.config.QuickJarsTxtParser;
+import org.apache.openejb.loader.SystemInstance;
+
+import java.io.File;
+
+/**
+ * Usage example in META-INF/context.xml
+ * <p/>
+ * <p/>
+ * <Context antiJARLocking="true" >
+ * <Loader
+ * className="org.apache.tomee.catalina.ProvisioningWebappLoader"
+ * searchExternalFirst="true"
+ * virtualClasspath="mvn:commons-el:commons-el:1.0;mvn:commons-el:commons-el:1.0"
+ * searchVirtualFirst="true"
+ * />
+ * </Context>
+ */
+public class TomEEWebappLoader extends WebappLoader {
+ public static final boolean SKIP_BACKGROUND_PROCESS = "true".equals(SystemInstance.get().getProperty("tomee.classloader.skip-background-process", "false"));
+
+ private volatile ClassLoader loader;
+
+ @Override
+ public void backgroundProcess() {
+ if (SKIP_BACKGROUND_PROCESS) {
+ return;
+ }
+
+ final ClassLoader classloader = super.getClassLoader();
+ if (classloader instanceof TomEEWebappClassLoader) {
+ final TomEEWebappClassLoader tomEEWebappClassLoader = (TomEEWebappClassLoader) classloader;
+ tomEEWebappClassLoader.restarting();
+ try {
+ super.backgroundProcess();
+ } finally {
+ tomEEWebappClassLoader.restarted();
+ }
+ } else {
+ super.backgroundProcess();
+ }
+ }
+
+ @Override
+ public boolean modified() {
+ return !SKIP_BACKGROUND_PROCESS && super.modified();
+ }
+
+ @Override
+ protected void stopInternal() throws LifecycleException {
+ loader = getClassLoader();
+ super.stopInternal();
+ }
+
+ public void clearLoader() {
+ loader = null;
+ }
+
+ public ClassLoader internalLoader() {
+ return loader;
+ }
+
+ @Override
+ protected void startInternal() throws LifecycleException {
+ if (getClassLoader() != null) {
+ final TomEEWebappClassLoader webappClassLoader = TomEEWebappClassLoader.class.cast(getClassLoader());
+ if (webappClassLoader.isStopped()) {
+ webappClassLoader.internalStop();
+ }
+ }
+
+ final Context context = getContext();
+
+ ClassLoaderConfigurer configurer = ClassLoaderUtil.configurer(context.getName());
+
+ // WEB-INF/jars.xml
+ final File war = Contexts.warPath(Context.class.cast(context));
+ final File jarsXml = new File(war, "WEB-INF/" + QuickJarsTxtParser.FILE_NAME);
+ final ClassLoaderConfigurer configurerTxt = QuickJarsTxtParser.parse(jarsXml);
+ if (configurerTxt != null) {
+ configurer = new CompositeClassLoaderConfigurer(configurer, configurerTxt);
+ }
+
+ TomEEWebappClassLoader.initContext(configurer);
+ TomEEWebappClassLoader.initContext(context);
+ try {
+ super.startInternal();
+ } finally {
+ TomEEWebappClassLoader.cleanContext();
+ }
+ }
+
+ @Override
+ public String toString() {
+ return "TomEE" + super.toString();
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
index 03fea68..4496e54 100644
--- a/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
+++ b/tomee/tomee-catalina/src/main/java/org/apache/tomee/catalina/TomcatDeploymentLoader.java
@@ -1,43 +1,43 @@
-/*
- * 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.tomee.catalina;
-
-import org.apache.catalina.core.StandardContext;
-import org.apache.openejb.config.DeploymentLoader;
-
-/**
- * @version $Id$
- */
-public class TomcatDeploymentLoader extends DeploymentLoader {
- private StandardContext standardContext;
- private String moduleId;
-
- public TomcatDeploymentLoader(final StandardContext standardContext, final String moduleId) {
- this.standardContext = standardContext;
- this.moduleId = moduleId;
- }
-
- @Override
- protected String getContextRoot() {
- return standardContext.getPath();
- }
-
- @Override
- protected String getModuleName() {
- return moduleId;
- }
-}
+/*
+ * 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.tomee.catalina;
+
+import org.apache.catalina.core.StandardContext;
+import org.apache.openejb.config.DeploymentLoader;
+
+/**
+ * @version $Id$
+ */
+public class TomcatDeploymentLoader extends DeploymentLoader {
+ private StandardContext standardContext;
+ private String moduleId;
+
+ public TomcatDeploymentLoader(final StandardContext standardContext, final String moduleId) {
+ this.standardContext = standardContext;
+ this.moduleId = moduleId;
+ }
+
+ @Override
+ protected String getContextRoot() {
+ return standardContext.getPath();
+ }
+
+ @Override
+ protected String getModuleName() {
+ return moduleId;
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
index 1720f9f..a2c8d06 100644
--- a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
+++ b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Main.java
@@ -1,134 +1,134 @@
-/**
- * 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.tomee.embedded;
-
-import java.io.File;
-import java.util.Set;
-
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.HelpFormatter;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.apache.commons.cli.PosixParser;
-import org.apache.openejb.loader.ProvisioningUtil;
-
-import static org.apache.openejb.loader.JarLocation.jarLocation;
-
-public class Main {
- public static final String PORT = "port";
- public static final String SHUTDOWN = "shutdown";
- public static final String PATH = "path";
- public static final String CONTEXT = "context";
- public static final String DIRECTORY = "directory";
- public static final String DOC_BASE = "doc-base";
- public static final String AS_WAR = "as-war";
-
- public static void main(final String[] args) {
- final CommandLineParser parser = new PosixParser();
- final Options options = createOptions();
-
- // parse command line
- final CommandLine line;
- try {
- line = parser.parse(options, args, true);
- } catch (final ParseException exp) {
- new HelpFormatter().printHelp("java -jar tomee-embedded-user.jar", options);
- return;
- }
-
- // run TomEE
- try {
- final Container container = new Container(createConfiguration(line));
- final String[] contexts;
- if (line.hasOption(CONTEXT)) {
- contexts = line.getOptionValues(CONTEXT);
- } else {
- contexts = null;
- }
-
- boolean autoWar = true;
- int i = 0;
- if (line.hasOption(PATH)) {
- for (final String path : line.getOptionValues(PATH)) {
- final Set<String> locations = ProvisioningUtil.realLocation(path);
- for (final String location : locations) {
- final File file = new File(location);
- if (!file.exists()) {
- System.err.println(file.getAbsolutePath() + " does not exist, skipping");
- continue;
- }
-
- String name = file.getName().replaceAll("\\.[A-Za-z]+$", "");
- if (contexts != null) {
- name = contexts[i++];
- }
- container.deploy(name, file, true);
- }
- }
- autoWar = false;
- }
- if (line.hasOption(AS_WAR)) {
- container.deployClasspathAsWebApp(contexts == null || i == contexts.length ? "" : contexts[i],
- line.hasOption(DOC_BASE) ? new File(line.getOptionValue(DOC_BASE)) : null);
- autoWar = false;
- }
- if (autoWar) { // nothing deployed check if we are a war and deploy ourself then
- final File me = jarLocation(Main.class);
- if (me.getName().endsWith(".war")) {
- container.deploy(contexts == null || i == contexts.length ? "" : contexts[i], me);
- }
- }
-
- Runtime.getRuntime().addShutdownHook(new Thread() {
- @Override
- public void run() {
- try {
- container.stop();
- } catch (final Exception e) {
- e.printStackTrace(); // just log the exception
- }
- }
- });
- container.await();
- } catch (final Exception e) {
- e.printStackTrace();
- }
- }
-
- private static Options createOptions() {
- final Options options = new Options();
- options.addOption(null, PATH, true, "");
- options.addOption(null, CONTEXT, true, "Context name for applications (same order than paths)");
- options.addOption("p", PORT, true, "TomEE http port");
- options.addOption("s", SHUTDOWN, true, "TomEE shutdown port");
- options.addOption("d", DIRECTORY, true, "TomEE directory");
- options.addOption("c", AS_WAR, false, "deploy classpath as war");
- options.addOption("b", DOC_BASE, true, "when deploy classpath as war, the doc base");
- return options;
- }
-
- private static Configuration createConfiguration(final CommandLine args) {
- final Configuration config = new Configuration();
- config.setDir(System.getProperty("java.io.tmpdir"));
- config.setHttpPort(Integer.parseInt(args.getOptionValue(PORT, "8080")));
- config.setStopPort(Integer.parseInt(args.getOptionValue(SHUTDOWN, "8005")));
- config.setDir(args.getOptionValue(DIRECTORY, new File(new File("."), "apache-tomee").getAbsolutePath()));
- return config;
- }
-
-}
+/**
+ * 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.tomee.embedded;
+
+import java.io.File;
+import java.util.Set;
+
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.HelpFormatter;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.apache.commons.cli.PosixParser;
+import org.apache.openejb.loader.ProvisioningUtil;
+
+import static org.apache.openejb.loader.JarLocation.jarLocation;
+
+public class Main {
+ public static final String PORT = "port";
+ public static final String SHUTDOWN = "shutdown";
+ public static final String PATH = "path";
+ public static final String CONTEXT = "context";
+ public static final String DIRECTORY = "directory";
+ public static final String DOC_BASE = "doc-base";
+ public static final String AS_WAR = "as-war";
+
+ public static void main(final String[] args) {
+ final CommandLineParser parser = new PosixParser();
+ final Options options = createOptions();
+
+ // parse command line
+ final CommandLine line;
+ try {
+ line = parser.parse(options, args, true);
+ } catch (final ParseException exp) {
+ new HelpFormatter().printHelp("java -jar tomee-embedded-user.jar", options);
+ return;
+ }
+
+ // run TomEE
+ try {
+ final Container container = new Container(createConfiguration(line));
+ final String[] contexts;
+ if (line.hasOption(CONTEXT)) {
+ contexts = line.getOptionValues(CONTEXT);
+ } else {
+ contexts = null;
+ }
+
+ boolean autoWar = true;
+ int i = 0;
+ if (line.hasOption(PATH)) {
+ for (final String path : line.getOptionValues(PATH)) {
+ final Set<String> locations = ProvisioningUtil.realLocation(path);
+ for (final String location : locations) {
+ final File file = new File(location);
+ if (!file.exists()) {
+ System.err.println(file.getAbsolutePath() + " does not exist, skipping");
+ continue;
+ }
+
+ String name = file.getName().replaceAll("\\.[A-Za-z]+$", "");
+ if (contexts != null) {
+ name = contexts[i++];
+ }
+ container.deploy(name, file, true);
+ }
+ }
+ autoWar = false;
+ }
+ if (line.hasOption(AS_WAR)) {
+ container.deployClasspathAsWebApp(contexts == null || i == contexts.length ? "" : contexts[i],
+ line.hasOption(DOC_BASE) ? new File(line.getOptionValue(DOC_BASE)) : null);
+ autoWar = false;
+ }
+ if (autoWar) { // nothing deployed check if we are a war and deploy ourself then
+ final File me = jarLocation(Main.class);
+ if (me.getName().endsWith(".war")) {
+ container.deploy(contexts == null || i == contexts.length ? "" : contexts[i], me);
+ }
+ }
+
+ Runtime.getRuntime().addShutdownHook(new Thread() {
+ @Override
+ public void run() {
+ try {
+ container.stop();
+ } catch (final Exception e) {
+ e.printStackTrace(); // just log the exception
+ }
+ }
+ });
+ container.await();
+ } catch (final Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private static Options createOptions() {
+ final Options options = new Options();
+ options.addOption(null, PATH, true, "");
+ options.addOption(null, CONTEXT, true, "Context name for applications (same order than paths)");
+ options.addOption("p", PORT, true, "TomEE http port");
+ options.addOption("s", SHUTDOWN, true, "TomEE shutdown port");
+ options.addOption("d", DIRECTORY, true, "TomEE directory");
+ options.addOption("c", AS_WAR, false, "deploy classpath as war");
+ options.addOption("b", DOC_BASE, true, "when deploy classpath as war, the doc base");
+ return options;
+ }
+
+ private static Configuration createConfiguration(final CommandLine args) {
+ final Configuration config = new Configuration();
+ config.setDir(System.getProperty("java.io.tmpdir"));
+ config.setHttpPort(Integer.parseInt(args.getOptionValue(PORT, "8080")));
+ config.setStopPort(Integer.parseInt(args.getOptionValue(SHUTDOWN, "8005")));
+ config.setDir(args.getOptionValue(DIRECTORY, new File(new File("."), "apache-tomee").getAbsolutePath()));
+ return config;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
index 1d8fcef..f5a4247 100644
--- a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
+++ b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.policy
@@ -1,241 +1,241 @@
-// 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.
-
-// ============================================================================
-// catalina.policy - Security Policy Permissions for Tomcat 7
-//
-// This file contains a default set of security policies to be enforced (by the
-// JVM) when Catalina is executed with the "-security" option. In addition
-// to the permissions granted here, the following additional permissions are
-// granted specific to each web application:
-//
-// * Read access to its document root directory
-// * Read, write and delete access to its working directory
-//
-// $Id: catalina.policy 1079755 2011-03-09 11:38:38Z markt $
-// ============================================================================
-
-
-// ========== SYSTEM CODE PERMISSIONS =========================================
-
-
-// These permissions apply to javac
-grant codeBase "file:${java.home}/lib/-" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to all shared system extensions
-grant codeBase "file:${java.home}/jre/lib/ext/-" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre
-grant codeBase "file:${java.home}/../lib/-" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to all shared system extensions when
-// ${java.home} points at $JAVA_HOME/jre
-grant codeBase "file:${java.home}/lib/ext/-" {
- permission java.security.AllPermission;
-};
-
-
-// ========== CATALINA CODE PERMISSIONS =======================================
-
-
-// These permissions apply to the daemon code
-grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to the logging API
-// Note: If tomcat-juli.jar is in ${catalina.base} and not in ${catalina.home},
-// update this section accordingly.
-// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..}
-grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
- permission java.io.FilePermission
- "${java.home}${file.separator}lib${file.separator}logging.properties", "read";
-
- permission java.io.FilePermission
- "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read";
- permission java.io.FilePermission
- "${catalina.base}${file.separator}logs", "read, write";
- permission java.io.FilePermission
- "${catalina.base}${file.separator}logs${file.separator}*", "read, write";
-
- permission java.lang.RuntimePermission "shutdownHooks";
- permission java.lang.RuntimePermission "getClassLoader";
- permission java.lang.RuntimePermission "setContextClassLoader";
-
- permission java.util.logging.LoggingPermission "control";
-
- permission java.util.PropertyPermission "java.util.logging.config.class", "read";
- permission java.util.PropertyPermission "java.util.logging.config.file", "read";
- permission java.util.PropertyPermission "catalina.base", "read";
-
- // Note: To enable per context logging configuration, permit read access to
- // the appropriate file. Be sure that the logging configuration is
- // secure before enabling such access.
- // E.g. for the examples web application:
- // permission java.io.FilePermission "${catalina.base}${file.separator}
- // webapps${file.separator}examples${file.separator}WEB-INF
- // ${file.separator}classes${file.separator}logging.properties", "read";
-};
-
-// These permissions apply to the server startup code
-grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
- permission java.security.AllPermission;
-};
-
-// These permissions apply to the servlet API classes
-// and those that are shared across all class loaders
-// located in the "lib" directory
-grant codeBase "file:${catalina.home}/lib/-" {
- permission java.security.AllPermission;
-};
-
-
-// If using a per instance lib directory, i.e. ${catalina.base}/lib,
-// then the following permission will need to be uncommented
-// grant codeBase "file:${catalina.base}/lib/-" {
-// permission java.security.AllPermission;
-// };
-
-
-// ========== WEB APPLICATION PERMISSIONS =====================================
-
-
-// These permissions are granted by default to all web applications
-// In addition, a web application will be given a read FilePermission
-// and JndiPermission for all files and directories in its document root.
-grant {
- // Required for JNDI lookup of named JDBC DataSource's and
- // javamail named MimePart DataSource used to send mail
- permission java.util.PropertyPermission "java.home", "read";
- permission java.util.PropertyPermission "java.naming.*", "read";
- permission java.util.PropertyPermission "javax.sql.*", "read";
-
- // OS Specific properties to allow read access
- permission java.util.PropertyPermission "os.name", "read";
- permission java.util.PropertyPermission "os.version", "read";
- permission java.util.PropertyPermission "os.arch", "read";
- permission java.util.PropertyPermission "file.separator", "read";
- permission java.util.PropertyPermission "path.separator", "read";
- permission java.util.PropertyPermission "line.separator", "read";
-
- // JVM properties to allow read access
- permission java.util.PropertyPermission "java.version", "read";
- permission java.util.PropertyPermission "java.vendor", "read";
- permission java.util.PropertyPermission "java.vendor.url", "read";
- permission java.util.PropertyPermission "java.class.version", "read";
- permission java.util.PropertyPermission "java.specification.version", "read";
- permission java.util.PropertyPermission "java.specification.vendor", "read";
- permission java.util.PropertyPermission "java.specification.name", "read";
-
- permission java.util.PropertyPermission "java.vm.specification.version", "read";
- permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
- permission java.util.PropertyPermission "java.vm.specification.name", "read";
- permission java.util.PropertyPermission "java.vm.version", "read";
- permission java.util.PropertyPermission "java.vm.vendor", "read";
- permission java.util.PropertyPermission "java.vm.name", "read";
-
- // Required for OpenJMX
- permission java.lang.RuntimePermission "getAttribute";
-
- // Allow read of JAXP compliant XML parser debug
- permission java.util.PropertyPermission "jaxp.debug", "read";
-
- // All JSPs need to be able to read this package
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat";
-
- // Precompiled JSPs need access to these packages.
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.el";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
- permission java.lang.RuntimePermission
- "accessClassInPackage.org.apache.jasper.runtime.*";
-
- // Precompiled JSPs need access to these system properties.
- permission java.util.PropertyPermission
- "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read";
- permission java.util.PropertyPermission
- "org.apache.el.parser.COERCE_TO_ZERO", "read";
-
- // The cookie code needs these.
- permission java.util.PropertyPermission
- "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
- permission java.util.PropertyPermission
- "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
- permission java.util.PropertyPermission
- "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR", "read";
-
- // Applications using Comet need to be able to access this package
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.comet";
-};
-
-
-// The Manager application needs access to the following packages to support the
-// session display functionality. These settings support the following
-// configurations:
-// - default CATALINA_HOME == CATALINA_BASE
-// - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE
-// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME
-grant codeBase "file:${catalina.base}/webapps/manager/-" {
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util";
-};
-grant codeBase "file:${catalina.home}/webapps/manager/-" {
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util";
- permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util";
-};
-
-// You can assign additional permissions to particular web applications by
-// adding additional "grant" entries here, based on the code base for that
-// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
-//
-// Different permissions can be granted to JSP pages, classes loaded from
-// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
-// directory, or even to individual jar files in the /WEB-INF/lib/ directory.
-//
-// For instance, assume that the standard "examples" application
-// included a JDBC driver that needed to establish a network connection to the
-// corresponding database and used the scrape taglib to get the weather from
-// the NOAA web server. You might create a "grant" entries like this:
-//
-// The permissions granted to the context root directory apply to JSP pages.
-// grant codeBase "file:${catalina.base}/webapps/examples/-" {
-// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
-// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
-// };
-//
-// The permissions granted to the context WEB-INF/classes directory
-// grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
-// };
-//
-// The permission granted to your JDBC driver
-// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
-// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
-// };
-// The permission granted to the scrape taglib
-// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
-// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
-// };
-
+// 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.
+
+// ============================================================================
+// catalina.policy - Security Policy Permissions for Tomcat 7
+//
+// This file contains a default set of security policies to be enforced (by the
+// JVM) when Catalina is executed with the "-security" option. In addition
+// to the permissions granted here, the following additional permissions are
+// granted specific to each web application:
+//
+// * Read access to its document root directory
+// * Read, write and delete access to its working directory
+//
+// $Id: catalina.policy 1079755 2011-03-09 11:38:38Z markt $
+// ============================================================================
+
+
+// ========== SYSTEM CODE PERMISSIONS =========================================
+
+
+// These permissions apply to javac
+grant codeBase "file:${java.home}/lib/-" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to all shared system extensions
+grant codeBase "file:${java.home}/jre/lib/ext/-" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to javac when ${java.home] points at $JAVA_HOME/jre
+grant codeBase "file:${java.home}/../lib/-" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to all shared system extensions when
+// ${java.home} points at $JAVA_HOME/jre
+grant codeBase "file:${java.home}/lib/ext/-" {
+ permission java.security.AllPermission;
+};
+
+
+// ========== CATALINA CODE PERMISSIONS =======================================
+
+
+// These permissions apply to the daemon code
+grant codeBase "file:${catalina.home}/bin/commons-daemon.jar" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to the logging API
+// Note: If tomcat-juli.jar is in ${catalina.base} and not in ${catalina.home},
+// update this section accordingly.
+// grant codeBase "file:${catalina.base}/bin/tomcat-juli.jar" {..}
+grant codeBase "file:${catalina.home}/bin/tomcat-juli.jar" {
+ permission java.io.FilePermission
+ "${java.home}${file.separator}lib${file.separator}logging.properties", "read";
+
+ permission java.io.FilePermission
+ "${catalina.base}${file.separator}conf${file.separator}logging.properties", "read";
+ permission java.io.FilePermission
+ "${catalina.base}${file.separator}logs", "read, write";
+ permission java.io.FilePermission
+ "${catalina.base}${file.separator}logs${file.separator}*", "read, write";
+
+ permission java.lang.RuntimePermission "shutdownHooks";
+ permission java.lang.RuntimePermission "getClassLoader";
+ permission java.lang.RuntimePermission "setContextClassLoader";
+
+ permission java.util.logging.LoggingPermission "control";
+
+ permission java.util.PropertyPermission "java.util.logging.config.class", "read";
+ permission java.util.PropertyPermission "java.util.logging.config.file", "read";
+ permission java.util.PropertyPermission "catalina.base", "read";
+
+ // Note: To enable per context logging configuration, permit read access to
+ // the appropriate file. Be sure that the logging configuration is
+ // secure before enabling such access.
+ // E.g. for the examples web application:
+ // permission java.io.FilePermission "${catalina.base}${file.separator}
+ // webapps${file.separator}examples${file.separator}WEB-INF
+ // ${file.separator}classes${file.separator}logging.properties", "read";
+};
+
+// These permissions apply to the server startup code
+grant codeBase "file:${catalina.home}/bin/bootstrap.jar" {
+ permission java.security.AllPermission;
+};
+
+// These permissions apply to the servlet API classes
+// and those that are shared across all class loaders
+// located in the "lib" directory
+grant codeBase "file:${catalina.home}/lib/-" {
+ permission java.security.AllPermission;
+};
+
+
+// If using a per instance lib directory, i.e. ${catalina.base}/lib,
+// then the following permission will need to be uncommented
+// grant codeBase "file:${catalina.base}/lib/-" {
+// permission java.security.AllPermission;
+// };
+
+
+// ========== WEB APPLICATION PERMISSIONS =====================================
+
+
+// These permissions are granted by default to all web applications
+// In addition, a web application will be given a read FilePermission
+// and JndiPermission for all files and directories in its document root.
+grant {
+ // Required for JNDI lookup of named JDBC DataSource's and
+ // javamail named MimePart DataSource used to send mail
+ permission java.util.PropertyPermission "java.home", "read";
+ permission java.util.PropertyPermission "java.naming.*", "read";
+ permission java.util.PropertyPermission "javax.sql.*", "read";
+
+ // OS Specific properties to allow read access
+ permission java.util.PropertyPermission "os.name", "read";
+ permission java.util.PropertyPermission "os.version", "read";
+ permission java.util.PropertyPermission "os.arch", "read";
+ permission java.util.PropertyPermission "file.separator", "read";
+ permission java.util.PropertyPermission "path.separator", "read";
+ permission java.util.PropertyPermission "line.separator", "read";
+
+ // JVM properties to allow read access
+ permission java.util.PropertyPermission "java.version", "read";
+ permission java.util.PropertyPermission "java.vendor", "read";
+ permission java.util.PropertyPermission "java.vendor.url", "read";
+ permission java.util.PropertyPermission "java.class.version", "read";
+ permission java.util.PropertyPermission "java.specification.version", "read";
+ permission java.util.PropertyPermission "java.specification.vendor", "read";
+ permission java.util.PropertyPermission "java.specification.name", "read";
+
+ permission java.util.PropertyPermission "java.vm.specification.version", "read";
+ permission java.util.PropertyPermission "java.vm.specification.vendor", "read";
+ permission java.util.PropertyPermission "java.vm.specification.name", "read";
+ permission java.util.PropertyPermission "java.vm.version", "read";
+ permission java.util.PropertyPermission "java.vm.vendor", "read";
+ permission java.util.PropertyPermission "java.vm.name", "read";
+
+ // Required for OpenJMX
+ permission java.lang.RuntimePermission "getAttribute";
+
+ // Allow read of JAXP compliant XML parser debug
+ permission java.util.PropertyPermission "jaxp.debug", "read";
+
+ // All JSPs need to be able to read this package
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.tomcat";
+
+ // Precompiled JSPs need access to these packages.
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.el";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.jasper.runtime";
+ permission java.lang.RuntimePermission
+ "accessClassInPackage.org.apache.jasper.runtime.*";
+
+ // Precompiled JSPs need access to these system properties.
+ permission java.util.PropertyPermission
+ "org.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER", "read";
+ permission java.util.PropertyPermission
+ "org.apache.el.parser.COERCE_TO_ZERO", "read";
+
+ // The cookie code needs these.
+ permission java.util.PropertyPermission
+ "org.apache.catalina.STRICT_SERVLET_COMPLIANCE", "read";
+ permission java.util.PropertyPermission
+ "org.apache.tomcat.util.http.ServerCookie.STRICT_NAMING", "read";
+ permission java.util.PropertyPermission
+ "org.apache.tomcat.util.http.ServerCookie.FWD_SLASH_IS_SEPARATOR", "read";
+
+ // Applications using Comet need to be able to access this package
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.comet";
+};
+
+
+// The Manager application needs access to the following packages to support the
+// session display functionality. These settings support the following
+// configurations:
+// - default CATALINA_HOME == CATALINA_BASE
+// - CATALINA_HOME != CATALINA_BASE, per instance Manager in CATALINA_BASE
+// - CATALINA_HOME != CATALINA_BASE, shared Manager in CATALINA_HOME
+grant codeBase "file:${catalina.base}/webapps/manager/-" {
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util";
+};
+grant codeBase "file:${catalina.home}/webapps/manager/-" {
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.ha.session";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.manager.util";
+ permission java.lang.RuntimePermission "accessClassInPackage.org.apache.catalina.util";
+};
+
+// You can assign additional permissions to particular web applications by
+// adding additional "grant" entries here, based on the code base for that
+// application, /WEB-INF/classes/, or /WEB-INF/lib/ jar files.
+//
+// Different permissions can be granted to JSP pages, classes loaded from
+// the /WEB-INF/classes/ directory, all jar files in the /WEB-INF/lib/
+// directory, or even to individual jar files in the /WEB-INF/lib/ directory.
+//
+// For instance, assume that the standard "examples" application
+// included a JDBC driver that needed to establish a network connection to the
+// corresponding database and used the scrape taglib to get the weather from
+// the NOAA web server. You might create a "grant" entries like this:
+//
+// The permissions granted to the context root directory apply to JSP pages.
+// grant codeBase "file:${catalina.base}/webapps/examples/-" {
+// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
+// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
+// };
+//
+// The permissions granted to the context WEB-INF/classes directory
+// grant codeBase "file:${catalina.base}/webapps/examples/WEB-INF/classes/-" {
+// };
+//
+// The permission granted to your JDBC driver
+// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/driver.jar!/-" {
+// permission java.net.SocketPermission "dbhost.mycompany.com:5432", "connect";
+// };
+// The permission granted to the scrape taglib
+// grant codeBase "jar:file:${catalina.base}/webapps/examples/WEB-INF/lib/scrape.jar!/-" {
+// permission java.net.SocketPermission "*.noaa.gov:80", "connect";
+// };
+
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
index 5089043..ff86449 100644
--- a/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
+++ b/tomee/tomee-embedded/src/main/resources/org/apache/tomee/configs/catalina.properties
@@ -1,122 +1,122 @@
-# 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.
-
-#
-# List of comma-separated packages that start with or equal this string
-# will cause a security exception to be thrown when
-# passed to checkPackageAccess unless the
-# corresponding RuntimePermission ("accessClassInPackage."+package) has
-# been granted.
-package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
-#
-# List of comma-separated packages that start with or equal this string
-# will cause a security exception to be thrown when
-# passed to checkPackageDefinition unless the
-# corresponding RuntimePermission ("defineClassInPackage."+package) has
-# been granted.
-#
-# by default, no packages are restricted for definition, and none of
-# the class loaders supplied with the JDK call checkPackageDefinition.
-#
-package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
-
-#
-#
-# List of comma-separated paths defining the contents of the "common"
-# classloader. Prefixes should be used to define what is the repository type.
-# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
-# If left as blank,the JVM system loader will be used as Catalina's "common"
-# loader.
-# Examples:
-# "foo": Add this folder as a class repository
-# "foo/*.jar": Add all the JARs of the specified folder as class
-# repositories
-# "foo/bar.jar": Add bar.jar as a class repository
-common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
-
-#
-# List of comma-separated paths defining the contents of the "server"
-# classloader. Prefixes should be used to define what is the repository type.
-# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
-# If left as blank, the "common" loader will be used as Catalina's "server"
-# loader.
-# Examples:
-# "foo": Add this folder as a class repository
-# "foo/*.jar": Add all the JARs of the specified folder as class
-# repositories
-# "foo/bar.jar": Add bar.jar as a class repository
-server.loader=
-
-#
-# List of comma-separated paths defining the contents of the "shared"
-# classloader. Prefixes should be used to define what is the repository type.
-# Path may be relative to the CATALINA_BASE path or absolute. If left as blank,
-# the "common" loader will be used as Catalina's "shared" loader.
-# Examples:
-# "foo": Add this folder as a class repository
-# "foo/*.jar": Add all the JARs of the specified folder as class
-# repositories
-# "foo/bar.jar": Add bar.jar as a class repository
-# Please note that for single jars, e.g. bar.jar, you need the URL form
-# starting with file:.
-shared.loader=
-
-# List of JAR files that should not be scanned for configuration information
-# such as web fragments, TLD files etc. It must be a comma separated list of
-# JAR file names.
-# The JARs listed below include:
-# - Tomcat Bootstrap JARs
-# - Tomcat API JARs
-# - Catalina JARs
-# - Jasper JARs
-# - Tomcat JARs
-# - Common non-Tomcat JARs
-# - Sun JDK JARs
-# - Apple JDK JARs
-tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
-bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
-annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\
-catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\
-jasper.jar,jasper-el.jar,ecj-*.jar,\
-tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\
-tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\
-commons-beanutils*.jar,commons-collections*.jar,commons-dbcp*.jar,\
-commons-digester*.jar,commons-fileupload*.jar,commons-logging*.jar,\
-commons-pool*.jar,\
-bcprov-*.jar,\
-ant.jar,jmx.jar,jmx-tools.jar,\
-xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
-dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunpkcs11.jar,tools.jar,\
-apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\
-j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\
-mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\
-hsqldb-*,openejb-core-*,xbean-*,derby*,mbean-annotation-*,\
-javassit*,commons-*,swizzle-stream-*,serp-*,geronimo-javamail-*,geronimo-mail-*,\
-openejb-jee-*,openejb-core-*,openejb-loader-*,openejb-api-*,openejb-derby*,\
-openwebbeans-ejb-*,openwebbeans-impl-*,\
-bval-*,\
-tomee-loader-*,openejb-javaagent-*,openejb-ejbd-*,scannotation-*,openejb-server-*,\
-openjpa-*,quartz-*,openejb-http-*,kahadb-*
-
-#
-# String cache configuration.
-tomcat.util.buf.StringCache.byte.enabled=true
-#tomcat.util.buf.StringCache.char.enabled=true
-#tomcat.util.buf.StringCache.trainThreshold=500000
-#tomcat.util.buf.StringCache.cacheSize=5000
-
-http.port=${tomcatHttpPort}
-shutdown.port=${tomcatShutdownPort}
+# 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.
+
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageAccess unless the
+# corresponding RuntimePermission ("accessClassInPackage."+package) has
+# been granted.
+package.access=sun.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
+#
+# List of comma-separated packages that start with or equal this string
+# will cause a security exception to be thrown when
+# passed to checkPackageDefinition unless the
+# corresponding RuntimePermission ("defineClassInPackage."+package) has
+# been granted.
+#
+# by default, no packages are restricted for definition, and none of
+# the class loaders supplied with the JDK call checkPackageDefinition.
+#
+package.definition=sun.,java.,org.apache.catalina.,org.apache.coyote.,org.apache.tomcat.,org.apache.jasper.
+
+#
+#
+# List of comma-separated paths defining the contents of the "common"
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
+# If left as blank,the JVM system loader will be used as Catalina's "common"
+# loader.
+# Examples:
+# "foo": Add this folder as a class repository
+# "foo/*.jar": Add all the JARs of the specified folder as class
+# repositories
+# "foo/bar.jar": Add bar.jar as a class repository
+common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar
+
+#
+# List of comma-separated paths defining the contents of the "server"
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_HOME or CATALINA_BASE path or absolute.
+# If left as blank, the "common" loader will be used as Catalina's "server"
+# loader.
+# Examples:
+# "foo": Add this folder as a class repository
+# "foo/*.jar": Add all the JARs of the specified folder as class
+# repositories
+# "foo/bar.jar": Add bar.jar as a class repository
+server.loader=
+
+#
+# List of comma-separated paths defining the contents of the "shared"
+# classloader. Prefixes should be used to define what is the repository type.
+# Path may be relative to the CATALINA_BASE path or absolute. If left as blank,
+# the "common" loader will be used as Catalina's "shared" loader.
+# Examples:
+# "foo": Add this folder as a class repository
+# "foo/*.jar": Add all the JARs of the specified folder as class
+# repositories
+# "foo/bar.jar": Add bar.jar as a class repository
+# Please note that for single jars, e.g. bar.jar, you need the URL form
+# starting with file:.
+shared.loader=
+
+# List of JAR files that should not be scanned for configuration information
+# such as web fragments, TLD files etc. It must be a comma separated list of
+# JAR file names.
+# The JARs listed below include:
+# - Tomcat Bootstrap JARs
+# - Tomcat API JARs
+# - Catalina JARs
+# - Jasper JARs
+# - Tomcat JARs
+# - Common non-Tomcat JARs
+# - Sun JDK JARs
+# - Apple JDK JARs
+tomcat.util.scan.DefaultJarScanner.jarsToSkip=\
+bootstrap.jar,commons-daemon.jar,tomcat-juli.jar,\
+annotations-api.jar,el-api.jar,jsp-api.jar,servlet-api.jar,\
+catalina.jar,catalina-ant.jar,catalina-ha.jar,catalina-tribes.jar,\
+jasper.jar,jasper-el.jar,ecj-*.jar,\
+tomcat-api.jar,tomcat-util.jar,tomcat-coyote.jar,tomcat-dbcp.jar,\
+tomcat-i18n-en.jar,tomcat-i18n-es.jar,tomcat-i18n-fr.jar,tomcat-i18n-ja.jar,\
+commons-beanutils*.jar,commons-collections*.jar,commons-dbcp*.jar,\
+commons-digester*.jar,commons-fileupload*.jar,commons-logging*.jar,\
+commons-pool*.jar,\
+bcprov-*.jar,\
+ant.jar,jmx.jar,jmx-tools.jar,\
+xercesImpl.jar,xmlParserAPIs.jar,xml-apis.jar,\
+dnsns.jar,ldapsec.jar,localedata.jar,sunjce_provider.jar,sunpkcs11.jar,tools.jar,\
+apple_provider.jar,AppleScriptEngine.jar,CoreAudio.jar,dns_sd.jar,\
+j3daudio.jar,j3dcore.jar,j3dutils.jar,jai_core.jar,jai_codec.jar,\
+mlibwrapper_jai.jar,MRJToolkit.jar,vecmath.jar,\
+hsqldb-*,openejb-core-*,xbean-*,derby*,mbean-annotation-*,\
+javassit*,commons-*,swizzle-stream-*,serp-*,geronimo-javamail-*,geronimo-mail-*,\
+openejb-jee-*,openejb-core-*,openejb-loader-*,openejb-api-*,openejb-derby*,\
+openwebbeans-ejb-*,openwebbeans-impl-*,\
+bval-*,\
+tomee-loader-*,openejb-javaagent-*,openejb-ejbd-*,scannotation-*,openejb-server-*,\
+openjpa-*,quartz-*,openejb-http-*,kahadb-*
+
+#
+# String cache configuration.
+tomcat.util.buf.StringCache.byte.enabled=true
+#tomcat.util.buf.StringCache.char.enabled=true
+#tomcat.util.buf.StringCache.trainThreshold=500000
+#tomcat.util.buf.StringCache.cacheSize=5000
+
+http.port=${tomcatHttpPort}
+shutdown.port=${tomcatShutdownPort}
shutdown.command=${tomcatShutdownCommand}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
index abbc097..8f828b9 100644
--- a/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
+++ b/tomee/tomee-embedded/src/test/java/org/apache/tomee/embedded/ABean.java
@@ -1,26 +1,26 @@
-/**
- * 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.tomee.embedded;
-
-import javax.ejb.Singleton;
-
-@Singleton
-public class ABean {
- public String embedded() {
- return "ok";
- }
-}
+/**
+ * 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.tomee.embedded;
+
+import javax.ejb.Singleton;
+
+@Singleton
+public class ABean {
+ public String embedded() {
+ return "ok";
+ }
+}
http://git-wip-us.apache.org/repos/asf/tomee/blob/3069db0b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
index e0d7a63..b1514dd 100644
--- a/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
+++ b/tomee/tomee-embedded/src/test/resources/META-INF/beans.xml
@@ -1,19 +1,19 @@
-<?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.
--->
-<beans />
+<?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.
+-->
+<beans />