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 2016/09/29 18:43:30 UTC

[1/2] tomee git commit: TOMEE-1949 remove descriptors from openejb-core

Repository: tomee
Updated Branches:
  refs/heads/master 43342dbc6 -> 12f29b907


TOMEE-1949 remove descriptors from openejb-core


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/f367d4ae
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/f367d4ae
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/f367d4ae

Branch: refs/heads/master
Commit: f367d4ae9d29d8c2e9ef57235e541c7ce046cb99
Parents: 43342db
Author: rmannibucau <rm...@apache.org>
Authored: Thu Sep 29 20:42:19 2016 +0200
Committer: rmannibucau <rm...@apache.org>
Committed: Thu Sep 29 20:42:19 2016 +0200

----------------------------------------------------------------------
 .../src/main/resources/META-INF/ejb-jar.xml     | 21 ----------------
 .../src/main/resources/META-INF/openejb-jar.xml | 26 --------------------
 2 files changed, 47 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/f367d4ae/container/openejb-core/src/main/resources/META-INF/ejb-jar.xml
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/resources/META-INF/ejb-jar.xml b/container/openejb-core/src/main/resources/META-INF/ejb-jar.xml
deleted file mode 100644
index 7e42c45..0000000
--- a/container/openejb-core/src/main/resources/META-INF/ejb-jar.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
--->
-
-<!-- $Rev$ $Date$ -->
-
-<ejb-jar/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tomee/blob/f367d4ae/container/openejb-core/src/main/resources/META-INF/openejb-jar.xml
----------------------------------------------------------------------
diff --git a/container/openejb-core/src/main/resources/META-INF/openejb-jar.xml b/container/openejb-core/src/main/resources/META-INF/openejb-jar.xml
deleted file mode 100644
index 4d1746a..0000000
--- a/container/openejb-core/src/main/resources/META-INF/openejb-jar.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one or more
-  ~ contributor license agreements.  See the NOTICE file distributed with
-  ~ this work for additional information regarding copyright ownership.
-  ~ The ASF licenses this file to You under the Apache License, Version 2.0
-  ~ (the "License"); you may not use this file except in compliance with
-  ~ the License.  You may obtain a copy of the License at
-  ~
-  ~     http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing, software
-  ~ distributed under the License is distributed on an "AS IS" BASIS,
-  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  ~ See the License for the specific language governing permissions and
-  ~ limitations under the License.
-  -->
-
-<!-- $Rev$ $Date$ -->
-
-<openejb-jar>
-  <properties>
-     openejb.deploymentId.format = {ejbName}
-     openejb.jndiname.format = {deploymentId}{interfaceType.openejbLegacyName}
-  </properties>
-</openejb-jar>


[2/2] tomee git commit: TOMEE-1950 support of most of descriptors in classpath for tomee embedded case

Posted by rm...@apache.org.
TOMEE-1950 support of most of descriptors in classpath for tomee embedded case


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/12f29b90
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/12f29b90
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/12f29b90

Branch: refs/heads/master
Commit: 12f29b9076a8b47d165f866635c16a82bf9c3eff
Parents: f367d4a
Author: rmannibucau <rm...@apache.org>
Authored: Thu Sep 29 20:43:20 2016 +0200
Committer: rmannibucau <rm...@apache.org>
Committed: Thu Sep 29 20:43:20 2016 +0200

----------------------------------------------------------------------
 .../org/apache/tomee/embedded/Container.java    | 23 +++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/12f29b90/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
----------------------------------------------------------------------
diff --git a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
index 600a4d8..0cd4cfa 100644
--- a/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
+++ b/tomee/tomee-embedded/src/main/java/org/apache/tomee/embedded/Container.java
@@ -102,6 +102,7 @@ import java.io.Writer;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -279,7 +280,7 @@ public class Container implements AutoCloseable {
             } catch (final MalformedURLException e) {
                 // no-op
             }
-        }
+        } // else no classpath finding since we'll likely find it
         DeploymentLoader.addBeansXmls(webModule);
 
         final AppModule app = new AppModule(loader, null);
@@ -288,6 +289,26 @@ public class Container implements AutoCloseable {
         app.setModuleId(webModule.getModuleId());
         try {
             final Map<String, URL> webDescriptors = DeploymentLoader.getWebDescriptors(jarLocation);
+            if (webDescriptors.isEmpty()) { // likely so let's try to find them in the classpath
+                final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
+                final Collection<String> metaDir = asList("META-INF/tomee/", "META-INF/");
+                for (final String dd : asList(
+                        "app-ctx.xml", "module.properties", "application.properties",
+                        "env-entries.properties", NewLoaderLogic.EXCLUSION_FILE,
+                        "web.xml", "ejb-jar.xml", "openejb-jar.xml", "validation.xml")) {
+                    if (Boolean.parseBoolean(SystemInstance.get().getProperty("tomee.embedded.descriptors.classpath." + dd + ".skip"))
+                            || webDescriptors.containsKey(dd)) {
+                        continue;
+                    }
+                    for (final String meta : metaDir) {
+                        final URL url = classLoader.getResource(meta + dd);
+                        if (url != null) {
+                            webDescriptors.put(dd, url);
+                            break;
+                        }
+                    }
+                }
+            }
             webDescriptors.remove("beans.xml");
             webModule.getAltDDs().putAll(webDescriptors);
             DeploymentLoader.addWebModule(webModule, app);