Reduce drastically the size of the manipulator.
It does no more embed Xerces, but rely on any Sax parser implementation exporting org.xml.sax.
The main result is the reduction of the online manipulator size to 150Kb (instead of 1Mb).

Fix the junit4OSGi notice file : it does not includes OSGi code


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@772896 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/ipojo/ant/pom.xml b/ipojo/ant/pom.xml
index 3116196..168655c 100644
--- a/ipojo/ant/pom.xml
+++ b/ipojo/ant/pom.xml
@@ -6,9 +6,9 @@
 	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
@@ -72,11 +72,11 @@
 							org.objectweb.asm.commons;-split-package:=merge-first,
 							org.apache.xerces.parsers, org.apache.xerces.xni*,
 							org.apache.xerces.impl*, org.apache.xerces.util.*,
-							org.apache.xerces.dom.*, org.apache.xerces.dom3.* 
+							org.apache.xerces.dom.*, org.apache.xerces.dom3.*
 						</Private-Package>
 						<Export-Package> org.apache.felix.ipojo.task </Export-Package>
 						<Include-Resource> META-INF/LICENCE=LICENSE,
-							META-INF/NOTICE=NOTICE, META-INF/LICENSE.asm=LICENSE.asm 
+							META-INF/NOTICE=NOTICE, META-INF/LICENSE.asm=LICENSE.asm
 						</Include-Resource>
 					</instructions>
 					<obrRepository>NONE</obrRepository>
diff --git a/ipojo/ant/src/main/java/org/apache/felix/ipojo/task/IPojoTask.java b/ipojo/ant/src/main/java/org/apache/felix/ipojo/task/IPojoTask.java
index acdb568..be224d1 100644
--- a/ipojo/ant/src/main/java/org/apache/felix/ipojo/task/IPojoTask.java
+++ b/ipojo/ant/src/main/java/org/apache/felix/ipojo/task/IPojoTask.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * 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
@@ -30,32 +30,32 @@
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class IPojoTask extends Task {
-    
+
     /** Metadata file. */
     private File m_metadata;
-    
+
     /** Input bundle. */
     private File m_input;
-    
+
     /** Output bundle. */
     private File m_output;
-    
+
     /** Input directory. */
     private File m_directory;
-    
+
     /** Input manifest. */
     private File m_manifest;
 
     /** Flag describing if we need to ignore annotation of not. */
     private boolean m_ignoreAnnotations = false;
-    
+
     /**
      * Flag describing if we need or not use local XSD files
      * (i.e. use the {@link SchemaResolver} or not).
      * If <code>true</code> the local XSD are not used.
      */
     private boolean m_ignoreLocalXSD = false;
-    
+
     /**
      * Set the metadata file.
      * @param meta : the metadata file.
@@ -63,7 +63,7 @@
     public void setMetadata(File meta) {
         m_metadata = meta;
     }
-    
+
     /**
      * Set the manifest file.
      * @param manifest : the manifest file.
@@ -71,7 +71,7 @@
     public void setManifest(File manifest) {
         m_manifest = manifest;
     }
-    
+
     /**
      * Set the input bundle.
      * @param in : the input bundle
@@ -79,7 +79,7 @@
     public void setInput(File in) {
         m_input = in;
     }
-    
+
     /**
      * Set the input directory.
      * @param dir : the input directory
@@ -87,7 +87,7 @@
     public void setDir(File dir) {
         m_directory  = dir;
     }
-    
+
     /**
      * Set the output bundle.
      * @param out : the output bundle
@@ -95,7 +95,7 @@
     public void setOutput(File out) {
         m_output = out;
     }
-    
+
     /**
      * Set if we need to ignore annotations or not.
      * @param flag : true if we need to ignore annotations.
@@ -103,7 +103,7 @@
     public void setIgnoreAnnotations(boolean flag) {
         m_ignoreAnnotations = flag;
     }
-    
+
     /**
      * Set if we need to use embedded XSD files or not.
      * @param flag : true if we need to ignore embedded XSD files.
@@ -111,35 +111,35 @@
     public void setIgnoreEmbeddedSchemas(boolean flag) {
         m_ignoreLocalXSD = flag;
     }
-    
+
     /**
      * Execute the Ant Task.
      * @see org.apache.tools.ant.Task#execute()
      */
     public void execute() {
-        
+
         if (m_input == null  && m_directory == null) {
             throw new BuildException("Neither input bundle nor directory specified");
         }
-        
+
         if (m_input != null && !m_input.exists()) {
             throw new BuildException("The input bundle " + m_input.getAbsolutePath() + " does not exist");
         }
-        
+
         if (m_directory != null && !m_directory.exists()) {
             throw new BuildException("The input directory " + m_directory.getAbsolutePath() + " does not exist");
         }
         if (m_directory != null && !m_directory.isDirectory()) {
             throw new BuildException("The input directory " + m_directory.getAbsolutePath() + " is not a directory");
         }
-        
-        
+
+
         if (m_input != null) {
             log("Input bundle file : " + m_input.getAbsolutePath());
         } else {
             log("Input directory : " + m_directory.getAbsolutePath());
         }
-        
+
         if (m_manifest != null) {
             if (m_input != null) {
                 throw new BuildException("The manifest location cannot be used when manipulating an existing bundle");
@@ -148,7 +148,7 @@
                 throw new BuildException("The manifest file " + m_manifest.getAbsolutePath() + " does not exist");
             }
         }
-        
+
         // Get metadata file
         if (m_metadata == null) {
             m_metadata = new File("./metadata.xml");
@@ -172,10 +172,12 @@
                 log("Metadata file : " + m_metadata.getAbsolutePath());
             }
         }
-        
+
+        initializeSaxDriver();
+
 
         log("Start manipulation");
-        
+
         if (m_input != null) { // Prepare output file
             if (m_output == null) {
                 m_output = new File("./_out.jar");
@@ -185,7 +187,7 @@
                 if (!r) { throw new BuildException("The file " + m_output.getAbsolutePath() + " cannot be deleted"); }
             }
         }
-       
+
         Pojoization pojo = new Pojoization();
         if (! m_ignoreAnnotations) {
             pojo.setAnnotationProcessing();
@@ -202,14 +204,14 @@
             log((String) pojo.getWarnings().get(i), Project.MSG_WARN);
         }
         if (pojo.getErrors().size() > 0) { throw new BuildException((String) pojo.getErrors().get(0)); }
-        
+
         if (m_input != null) {
             String out;
             if (m_output.getName().equals("_out.jar")) {
                 if (m_input.delete()) {
                     if (! m_output.renameTo(m_input)) {
                         log("Cannot rename the output jar to " + m_input.getAbsolutePath(), Project.MSG_WARN);
-                    }   
+                    }
                 } else {
                     log("Cannot delete the input file : " + m_input.getAbsolutePath(), Project.MSG_WARN);
                 }
@@ -217,7 +219,7 @@
             } else {
                 out = m_output.getAbsolutePath();
             }
-        
+
             log("Bundle manipulation - SUCCESS");
             log("Output file : " + out);
         } else {
@@ -228,10 +230,23 @@
             }
 
         }
-        
+
     }
-    
-    
+
+    /**
+     * If Ant runs with Java 1.4, we should use the embedded Xerces.
+     * To achieve that, we set the org.xml.sax.driver property.
+     * Otherwise, the JVM sets the org.xml.sax.driver property.
+     */
+    private void initializeSaxDriver() {
+        String version = (String) System.getProperty("java.vm.version");
+        if (version.startsWith("1.4")) {
+            System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser");
+        }
+
+    }
+
+
 
 }
 
diff --git a/ipojo/junit4osgi/junit4osgi/NOTICE b/ipojo/junit4osgi/junit4osgi/NOTICE
index f6a2f5f..d696f41 100644
--- a/ipojo/junit4osgi/junit4osgi/NOTICE
+++ b/ipojo/junit4osgi/junit4osgi/NOTICE
@@ -11,11 +11,6 @@
 Junit project (http://junit.org)
 Licensed under Common Public License 1.0.
 
-This product includes software developed at
-The OSGi Alliance (http://www.osgi.org/).
-Copyright (c) OSGi Alliance (2000, 2007).
-Licensed under the Apache License 2.0.
-
 II. Used Software
 
 This product uses software developed at
diff --git a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
index 87b6d69..5e468ba 100644
--- a/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
+++ b/ipojo/manipulator/src/main/java/org/apache/felix/ipojo/manipulator/Pojoization.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * 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
@@ -55,13 +55,14 @@
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
 
 /**
- * Pojoization allows creating an iPOJO bundle from a "normal" bundle.  
+ * Pojoization allows creating an iPOJO bundle from a "normal" bundle.
  * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
  */
 public class Pojoization {
-    
+
     /**
      * iPOJO Imported Package Version.
      */
@@ -101,24 +102,24 @@
      * Flag describing if we need or not compute annotations.
      */
     private boolean m_ignoreAnnotations;
-    
+
     /**
      * Flag describing if we need or not use local XSD files
      * (i.e. use the {@link SchemaResolver} or not).
      * If <code>true</code> the local XSD are not used.
      */
     private boolean m_ignoreLocalXSD;
-    
+
     /**
      * Input jar file.
      */
     private JarFile m_inputJar;
-    
+
     /**
      * The manipulated directory.
      */
     private File m_dir;
-    
+
     /**
      * The manifest location.
      */
@@ -129,6 +130,7 @@
      * @param mes : error message.
      */
     private void error(String mes) {
+        System.err.println(mes);
         m_errors.add(mes);
     }
 
@@ -143,14 +145,14 @@
     public List getErrors() {
         return m_errors;
     }
-    
+
     /**
      * Activates annotation processing.
      */
     public void setAnnotationProcessing() {
         m_ignoreAnnotations = false;
     }
-    
+
     /**
      * Activates the entity resolver loading
      * XSD files from the classloader.
@@ -158,14 +160,14 @@
     public void setUseLocalXSD() {
         m_ignoreLocalXSD = false;
     }
-    
+
     /**
      * Manipulates an input bundle.
      * This method creates an iPOJO bundle based on the given metadata file.
      * The original and final bundles must be different.
      * @param in the original bundle.
      * @param out the final bundle.
-     * @param metadata the iPOJO metadata input stream. 
+     * @param metadata the iPOJO metadata input stream.
      */
     public void pojoization(File in, File out, InputStream metadata) {
         parseXMLMetadata(metadata);
@@ -175,7 +177,7 @@
         // m_metadata can be either an empty array or an Element
         // array with component type description. It also can be null
         // if no metadata file is given.
-        
+
         try {
             m_inputJar = new JarFile(in);
         } catch (IOException e) {
@@ -204,14 +206,14 @@
      * The original and final bundles must be different.
      * @param in the original bundle.
      * @param out the final bundle.
-     * @param metadataFile the iPOJO metadata file (XML). 
+     * @param metadataFile the iPOJO metadata file (XML).
      */
     public void pojoization(File in, File out, File metadataFile) {
         // Get the metadata.xml location if not null
         if (metadataFile != null) {
             parseXMLMetadata(metadataFile);
         }
-        
+
         try {
             m_inputJar = new JarFile(in);
         } catch (IOException e) {
@@ -233,7 +235,7 @@
             }
         }
     }
-    
+
     /**
      * Manipulates an expanded bundles.
      * Classes are in the specified directory.
@@ -247,23 +249,23 @@
         if (metadataFile != null) {
             parseXMLMetadata(metadataFile);
         }
-        
+
         if (directory.exists() && directory.isDirectory()) {
             m_dir = directory;
         } else {
             error("The directory " + directory.getAbsolutePath() + " does not exist or is not a directory.");
         }
-        
-        
+
+
         if (manifestFile != null) {
             if (manifestFile.exists()) {
                 m_manifest = manifestFile;
             } else {
                 error("The manifest file " + manifestFile.getAbsolutePath() + " does not exist");
             }
-        } 
+        }
         // If the manifest is not specified, the m_dir/META-INF/MANIFEST.MF is used.
-        
+
         // Get the list of declared component
         computeDeclaredComponents();
 
@@ -277,7 +279,7 @@
                 error("The component " + ci.m_classname + " is declared but not in the bundle");
             }
         }
-        
+
     }
 
     /**
@@ -396,7 +398,7 @@
             return;
         }
     }
-    
+
     /**
      * Manipulate the input directory.
      */
@@ -426,7 +428,7 @@
                 return;
             }
         }
-        
+
         // Write manifest
         if (m_manifest == null) {
             m_manifest = new File(m_dir, "META-INF/MANIFEST.MF");
@@ -445,7 +447,7 @@
         } catch (IOException e) {
             error("Cannot write the manifest file : " + e.getMessage());
         }
-            
+
     }
 
     /**
@@ -454,7 +456,7 @@
     private void manipulateComponents() {
         //Enumeration entries = inputJar.entries();
         Enumeration entries = getClassFiles();
-        
+
         while (entries.hasMoreElements()) {
             String curName = (String) entries.nextElement();
             try {
@@ -499,7 +501,7 @@
 
         }
     }
-    
+
     /**
      * Gets an input stream on the given class.
      * This methods manages Jar files and directories.
@@ -512,9 +514,9 @@
             if (! classname.endsWith(".class")) {
                 classname += ".class";
             }
-            JarEntry je = m_inputJar.getJarEntry(classname); 
+            JarEntry je = m_inputJar.getJarEntry(classname);
             if (je == null) {
-                throw new IOException("The class " + classname + " connot be found in the input Jar file"); 
+                throw new IOException("The class " + classname + " connot be found in the input Jar file");
             } else {
                 return m_inputJar.getInputStream(je);
             }
@@ -524,7 +526,7 @@
             return new FileInputStream(file);
         }
     }
-    
+
     /**
      * Gets the list of class files.
      * The content of the returned enumeration contains file names.
@@ -547,7 +549,7 @@
         }
         return files.elements();
     }
-    
+
     /**
      * Navigates across directories to find class files.
      * @param dir the directory to analyze
@@ -563,7 +565,7 @@
             }
         }
     }
-    
+
 //    /**
 //     * Manipulates an inner class.
 //     * @param inputJar input jar
@@ -585,18 +587,18 @@
 //        // Remove '.class' from class name.
 //        InnerClassManipulator man = new InnerClassManipulator(ci.m_classname.substring(0, ci.m_classname.length() - 6), ci.m_fields);
 //        byte[] out = man.manipulate(in);
-//        
+//
 //        m_classes.put(je.getName(), out);
-//        
+//
 //    }
-    
+
     /**
      * Computes a relative path for the given absolute path.
      * This methods computes the relative path according to the directory
      * containing classes for the given class path.
      * @param absolutePath the absolute path of the class
      * @return the relative path of the class based on the directory containing
-     * classes. 
+     * classes.
      */
     private String computeRelativePath(String absolutePath) {
         String root = m_dir.getAbsolutePath();
@@ -622,11 +624,11 @@
         // Remove '.class' from class name.
         InnerClassManipulator man = new InnerClassManipulator(ci.m_classname.substring(0, ci.m_classname.length() - 6), ci.m_fields);
         byte[] out = man.manipulate(in);
-        
+
         m_classes.put(cn, out);
-        
+
     }
-    
+
     /**
      * Gets the manifest.
      * This method handles Jar and directories.
@@ -708,7 +710,7 @@
         List componentClazzes = new ArrayList();
         for (int i = 0; i < m_metadata.length; i++) {
             String name = m_metadata[i].getAttribute("classname");
-            if (name != null) { // Only handler and component have a classname attribute 
+            if (name != null) { // Only handler and component have a classname attribute
                 name = name.replace('.', '/');
                 name += ".class";
                 componentClazzes.add(new ComponentInfo(name, m_metadata[i]));
@@ -734,15 +736,15 @@
         String m_classname;
 
         /**
-         * Is the class already manipulated. 
+         * Is the class already manipulated.
          */
         boolean m_isManipulated;
-        
+
         /**
          * List of inner classes of the implementation class.
          */
         List m_inners;
-        
+
         /**
          * Set of fields of the implementation class.
          */
@@ -758,7 +760,7 @@
             this.m_componentMetadata = met;
             m_isManipulated = false;
         }
-        
+
         /**
          * Detects missing fields.
          * If a referenced field does not exist in the class
@@ -777,7 +779,7 @@
                 }
             }
         }
-        
+
         /**
          * Looks for 'field' attribute in the given metadata.
          * @param list : discovered field (accumulator)
@@ -792,7 +794,7 @@
                 computeReferredFields(list, metadata.getElements()[i]);
             }
         }
-        
+
     }
 
     /**
@@ -854,7 +856,7 @@
         for (int i = 0; i < m_metadata.length; i++) {
             meta.append(buildManifestMetadata(m_metadata[i], new StringBuffer()));
         }
-        if (meta.length() != 0) { 
+        if (meta.length() != 0) {
             att.putValue("iPOJO-Components", meta.toString());
         }
     }
@@ -862,7 +864,7 @@
     /**
      * Standard OSGi header parser. This parser can handle the format clauses ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '=' value )
      * This is mapped to a Map { name => Map { attr|directive => value } }
-     * 
+     *
      * @param value : String to parse.
      * @return parsed map.
      */
@@ -903,7 +905,7 @@
 
     /**
      * Print a standard Map based OSGi header.
-     * 
+     *
      * @param exports : map { name => Map { attribute|directive => value } }
      * @param allowedDirectives : list of allowed directives.
      * @return the clauses
@@ -911,7 +913,7 @@
     public String printClauses(Map exports, String allowedDirectives) {
         StringBuffer sb = new StringBuffer();
         String del = "";
-        
+
         for (Iterator i = exports.entrySet().iterator(); i.hasNext();) {
             Map.Entry entry = (Map.Entry) i.next();
             String name = (String) entry.getKey();
@@ -945,7 +947,7 @@
         }
         return sb.toString();
     }
-    
+
     /**
      * Parse the XML metadata from the given file.
      * @param metadataFile the metadata file
@@ -968,33 +970,33 @@
             error("Cannot open the metadata input stream: " + metadataFile.getAbsolutePath() + ": " + e.getMessage());
             m_metadata = null;
         }
-        
+
         // m_metadata can be either an empty array or an Element
         // array with component type description. It also can be null
         // if no metadata file is given.
     }
 
     /**
-     * Parse XML Metadata.
+     * Parses XML Metadata.
      * @param stream metadata input stream.
      */
     private void parseXMLMetadata(InputStream stream) {
         Element[] meta = null;
         try {
-            XMLReader parser = (XMLReader) Class.forName("org.apache.xerces.parsers.SAXParser").newInstance();
+            XMLReader parser = XMLReaderFactory.createXMLReader();
             XMLMetadataParser handler = new XMLMetadataParser();
             parser.setContentHandler(handler);
             parser.setFeature("http://xml.org/sax/features/validation",
-                    true); 
-            parser.setFeature("http://apache.org/xml/features/validation/schema", 
                     true);
-   
+            parser.setFeature("http://apache.org/xml/features/validation/schema",
+                    true);
+
             parser.setErrorHandler(handler);
-            
+
             if (! m_ignoreLocalXSD) {
                 parser.setEntityResolver(new SchemaResolver());
             }
-            
+
             InputSource is = new InputSource(stream);
             parser.parse(is);
             meta = handler.getMetadata();
@@ -1008,12 +1010,6 @@
             error("Error during metadata parsing at line " + e.getLineNumber() + " : " + e.getMessage());
         } catch (SAXException e) {
             error("Parsing error when parsing (Sax Error) the XML file: " + e.getMessage());
-        } catch (InstantiationException e) {
-            error("Cannot instantiate the SAX parser for the XML file: " + e.getMessage());
-        } catch (IllegalAccessException e) {
-            error("Cannot instantiate  the SAX parser (IllegalAccess) to the XML file: " + e.getMessage());
-        } catch (ClassNotFoundException e) {
-            error("Cannot load the SAX Parser : " + e.getMessage());
         }
 
         if (meta == null || meta.length == 0) {
@@ -1022,7 +1018,7 @@
 
         m_metadata = meta;
     }
-    
+
     /**
      * Get packages referenced by component.
      * @return the list of referenced packages.
@@ -1046,7 +1042,7 @@
 
     /**
      * Generate manipulation metadata.
-     * @param element : actual element. 
+     * @param element : actual element.
      * @param actual : actual manipulation metadata.
      * @return : given manipulation metadata + manipulation metadata of the given element.
      */
diff --git a/ipojo/online-manipulator/pom.xml b/ipojo/online-manipulator/pom.xml
index a6d216f..9d60db9 100644
--- a/ipojo/online-manipulator/pom.xml
+++ b/ipojo/online-manipulator/pom.xml
@@ -47,7 +47,7 @@
 							org.objectweb.asm.commons, org.objectweb.asm </Export-Package>
 						<Import-Package> !org.objectweb.asm.tree, !sun.io, * 
 						</Import-Package>
-						<Embed-Dependency>xercesImpl|xml-resolver</Embed-Dependency>
+						<!-- <Embed-Dependency>xercesImpl|xml-resolver</Embed-Dependency> -->
 					</instructions>
 				</configuration>
 			</plugin>
diff --git a/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java b/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java
index 9b7ebb5..3b5e2a6 100644
--- a/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java
+++ b/ipojo/plugin/src/main/java/org/apache/felix/ipojo/plugin/ManipulatorMojo.java
@@ -1,4 +1,4 @@
-/* 
+/*
  * 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
@@ -115,11 +115,11 @@
      * @parameter alias="IgnoreEmbeddedSchemas" default-value="false"
      */
     private boolean m_ignoreEmbeddedXSD;
-    
+
     protected MavenProject getProject() {
         return this.m_project;
     }
-    
+
     private boolean isXML() {
         return m_metadata != null && (m_metadata.indexOf('<') > -1);
     }
@@ -135,16 +135,17 @@
             this.getLog().debug("Ignoring project " + this.getProject().getArtifact() + " : type " + this.getProject().getArtifact().getType() + " is not supported by iPOJO plugin, supported types are " + this.m_supportedProjectTypes);
             return;
         }
-        
+
+        initializeSaxDriver();
 
         getLog().info("Start bundle manipulation");
 
         // Get metadata
         // Check if metadata are contained in the configuration
         InputStream is = null;
-        
+
         if (isXML()) {
-            is = new ByteArrayInputStream(m_metadata.getBytes()); 
+            is = new ByteArrayInputStream(m_metadata.getBytes());
         } else {
             if (m_metadata == null) {
                 // Try with metadata.xml
@@ -152,11 +153,11 @@
             }
             // Look for the metadata file in the output directory
             File meta = new File(m_outputDirectory + File.separator + m_metadata);
-            // If not found look inside the pom directory 
+            // If not found look inside the pom directory
             if (! meta.exists()) {
                 meta = new File(m_project.getBasedir() + File.separator + m_metadata);
             }
-        
+
             getLog().info("Metadata file : " + meta.getAbsolutePath());
             if (!meta.exists()) {
                 // Verify if annotations are ignored
@@ -168,7 +169,7 @@
                     meta = null;
                 }
             }
-            
+
             if (meta != null) {
                 try {
                     is = new FileInputStream(meta);
@@ -190,14 +191,14 @@
         Pojoization pojo = new Pojoization();
         if (!m_ignoreAnnotations) { pojo.setAnnotationProcessing(); }
         if (!m_ignoreEmbeddedXSD) { pojo.setUseLocalXSD(); }
-        
+
         // Executes the pojoization.
         if (is == null) {
             pojo.pojoization(in, out, (File) null); // Only annotations
         } else  {
             pojo.pojoization(in, out, is);
         }
-        
+
         for (int i = 0; i < pojo.getWarnings().size(); i++) {
             getLog().warn((String) pojo.getWarnings().get(i));
         }
@@ -220,4 +221,18 @@
         getLog().info("Bundle manipulation - SUCCESS");
     }
 
+    /**
+     * If Maven runs with Java 1.4, we should use the Maven Xerces.
+     * To achieve that, we set the org.xml.sax.driver property.
+     * Otherwise, the JVM sets the org.xml.sax.driver property.
+     */
+    private void initializeSaxDriver() {
+        String version = (String) System.getProperty("java.vm.version");
+        if (version.startsWith("1.4")) {
+            getLog().info("Set the Sax driver to org.apache.xerces.parsers.SAXParser");
+            System.setProperty("org.xml.sax.driver", "org.apache.xerces.parsers.SAXParser");
+        }
+
+    }
+
 }
diff --git a/ipojo/tests/online-manipulator/pom.xml b/ipojo/tests/online-manipulator/pom.xml
index 847c58a..ca02a04 100644
--- a/ipojo/tests/online-manipulator/pom.xml
+++ b/ipojo/tests/online-manipulator/pom.xml
@@ -29,7 +29,8 @@
 				</executions>
 			</plugin>
 			
-			<!--  <plugin>
+		  <!--
+		  <plugin>
 				<groupId>org.ops4j.pax.exam</groupId>
 				<artifactId>maven-paxexam-plugin</artifactId>
 				<executions>