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 2012/02/29 12:33:15 UTC

svn commit: r1295066 - /openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java

Author: rmannibucau
Date: Wed Feb 29 11:33:14 2012
New Revision: 1295066

URL: http://svn.apache.org/viewvc?rev=1295066&view=rev
Log:
TOMEE-145 excluding ContextFinder from geronimo jaxb api in endorsed lib of TomEE to use the JVM one since it is enough to get a normal behavior without bringing back OSGi

Modified:
    openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java

Modified: openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java?rev=1295066&r1=1295065&r2=1295066&view=diff
==============================================================================
--- openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java (original)
+++ openejb/trunk/openejb/tomee/tomee-common/src/main/java/org/apache/tomee/installer/Installer.java Wed Feb 29 11:33:14 2012
@@ -103,7 +103,7 @@ public class Installer {
         removeTomcatLibJar("annotations-api.jar");
         removeTomcatLibJar("el-api.jar");
         addJavaeeInEndorsed();
-        
+
         if (!alerts.hasErrors()) {
             status = Status.REBOOT_REQUIRED;
         }
@@ -115,11 +115,13 @@ public class Installer {
         endorsed.mkdir();
 
 
-        copyClasses(paths.getJavaEEAPIJar(), new File(endorsed, "annotation-api.jar"), "javax/annotation/.*");
-        copyClasses(paths.getJavaEEAPIJar(), new File(endorsed, "jaxb-api.jar"), "javax/xml/bind/.*");
+        copyClasses(paths.getJavaEEAPIJar(), new File(endorsed, "annotation-api.jar"), "javax/annotation/.*", null);
+
+        // a bit odd but we don't want to depend on OSGi and geronimo jaxb api ContextFinder depends on it
+        copyClasses(paths.getJavaEEAPIJar(), new File(endorsed, "jaxb-api.jar"), "javax/xml/bind/.*", "javax/xml/bind/ContextFinder.class");
     }
 
-    private void copyClasses(File sourceJar, File destinationJar, String pattern) {
+    private void copyClasses(File sourceJar, File destinationJar, String pattern, String excludePattern) {
         if (sourceJar == null) throw new NullPointerException("sourceJar");
         if (destinationJar == null) throw new NullPointerException("destinationJar");
         if (pattern == null) throw new NullPointerException("pattern");
@@ -138,6 +140,8 @@ public class Installer {
 
                 if (!entryName.matches(pattern)) continue;
 
+                if (excludePattern != null && entryName.matches(excludePattern)) continue;
+
                 destination.putNextEntry(new ZipEntry(entryName));
 
                 copy(source, destination);
@@ -262,6 +266,10 @@ public class Installer {
         }
     }
 
+    // NOTE: we specify the jaxbcontext implementation because
+    //       we are using geronimo jaxb API and we don't want to go to
+    //       the geronimo locator to find the implementation
+    //       because it needs some OSGi API we don't want to add
     public void installJavaagent() {
         if (agentInstalled && !force) {
 //            addInfo("OpenEJB Agent already installed");