jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r885437 - in /jackrabbit/sandbox/JCR-1456: ./ jackrabbit-core/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/ jackrabbit-core/src/main/java/org/apache/jackrabbit...
Date Mon, 30 Nov 2009 14:43:41 GMT
Author: jukka
Date: Mon Nov 30 14:43:40 2009
New Revision: 885437

URL: http://svn.apache.org/viewvc?rev=885437&view=rev
Log:
JCR-1456: Database connection pooling

Merged changes from trunk.

Added:
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-2.0.dtd
      - copied unchanged from r885400, jackrabbit/trunk/jackrabbit-core/src/main/resources/org/apache/jackrabbit/core/config/repository-2.0.dtd
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java
      - copied unchanged from r885400, jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/ChainedTermEnumTest.java
Modified:
    jackrabbit/sandbox/JCR-1456/   (props changed)
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ConfigurationEntityResolver.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ObservationDispatcher.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/AdministratorTest.java
    jackrabbit/sandbox/JCR-1456/jackrabbit-jca/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-parent/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/pom.xml
    jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/pom.xml

Propchange: jackrabbit/sandbox/JCR-1456/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Nov 30 14:43:40 2009
@@ -2,4 +2,4 @@
 /jackrabbit/branches/1.5:794012,794100,794102
 /jackrabbit/sandbox/JCR-2170:812417-816332
 /jackrabbit/sandbox/tripod-JCR-2209:795441-795863
-/jackrabbit/trunk:387422-884089
+/jackrabbit/trunk:387422-885400

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/pom.xml Mon Nov 30 14:43:40 2009
@@ -100,7 +100,6 @@
                 org.apache.jackrabbit.core.data.GarbageCollectorTest#testGC
                 org.apache.jackrabbit.core.data.GarbageCollectorTest#testCloseSessionWhileRunningGc
                 org.apache.jackrabbit.core.integration.ConcurrentQueryTest#testConcurrentQueryWithDeletes
-                org.apache.jackrabbit.core.security.user.AdministratorTest#testAdminNodeCollidingWithRandomNode
               </value>
             </property>
           </systemProperties>
@@ -206,12 +205,22 @@
     <dependency>
       <groupId>org.apache.tika</groupId>
       <artifactId>tika-parsers</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
     </dependency>
     <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+    </dependency>
+    <dependency>
       <groupId>org.apache.lucene</groupId>
       <artifactId>lucene-core</artifactId>
     </dependency>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ConfigurationEntityResolver.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ConfigurationEntityResolver.java?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ConfigurationEntityResolver.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/ConfigurationEntityResolver.java
Mon Nov 30 14:43:40 2009
@@ -16,20 +16,21 @@
  */
 package org.apache.jackrabbit.core.config;
 
-import org.xml.sax.EntityResolver;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.HashMap;
 import java.util.Map;
 
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
 /**
  * Entity resolver for Jackrabbit configuration files.
  * This simple resolver contains mappings for the following
  * public identifiers used for the Jackrabbit configuration files:
  * <ul>
+ * <li><code>-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN</code></li>
  * <li><code>-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN</code></li>
  * <li><code>-//The Apache Software Foundation//DTD Jackrabbit 1.5//EN</code></li>
  * <li><code>-//The Apache Software Foundation//DTD Jackrabbit 1.4//EN</code></li>
@@ -39,6 +40,7 @@
  * <p>
  * Also the following system identifiers are mapped to local resources:
  * <ul>
+ * <li><code>http://jackrabbit.apache.org/dtd/repository-2.0.dtd</code></li>
  * <li><code>http://jackrabbit.apache.org/dtd/repository-1.6.dtd</code></li>
  * <li><code>http://jackrabbit.apache.org/dtd/repository-1.5.dtd</code></li>
  * <li><code>http://jackrabbit.apache.org/dtd/repository-1.4.dtd</code></li>
@@ -71,6 +73,14 @@
      * Creates the singleton instance of this class.
      */
     private ConfigurationEntityResolver() {
+        // Apache Jackrabbit 2.0 DTD
+        publicIds.put(
+                "-//The Apache Software Foundation//DTD Jackrabbit 2.0//EN",
+                "repository-2.0.dtd");
+        systemIds.put(
+                "http://jackrabbit.apache.org/dtd/repository-2.0.dtd",
+                "repository-2.0.dtd");
+
         // Apache Jackrabbit 1.6 DTD
         publicIds.put(
                 "-//The Apache Software Foundation//DTD Jackrabbit 1.6//EN",
@@ -78,7 +88,7 @@
         systemIds.put(
                 "http://jackrabbit.apache.org/dtd/repository-1.6.dtd",
                 "repository-1.6.dtd");
-        
+
         // Apache Jackrabbit 1.5 DTD
         publicIds.put(
                 "-//The Apache Software Foundation//DTD Jackrabbit 1.5//EN",

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/config/RepositoryConfigurationParser.java
Mon Nov 30 14:43:40 2009
@@ -198,7 +198,7 @@
      * Element specifying the class of principals used to retrieve the userID
      * in the 'class' attribute.
      */
-    private static final String USERID_CLASS = "UserIdClass";
+    private static final String USERID_CLASS_ELEMENT = "UserIdClass";
 
     /**
      * Name of the optional XmlImport config entry inside the workspace configuration.
@@ -407,7 +407,7 @@
             }
 
             BeanConfig uidcc = null;
-            element = getElement(smElement, USERID_CLASS, false);
+            element = getElement(smElement, USERID_CLASS_ELEMENT, false);
             if (element != null) {
                 uidcc = parseBeanConfig(element);
             }
@@ -630,8 +630,8 @@
 
 
     /**
-     * Read the WorkspaceSecurity Element of Workspace's configuration. It uses
-     * the following format:
+     * Read the optional WorkspaceSecurity Element of Workspace's configuration.
+     * It uses the following format:
      * <pre>
      *   &lt;WorkspaceSecurity&gt;
      *     &lt;AccessControlProvider class="..." (optional)&gt;
@@ -639,7 +639,8 @@
      * </pre>
      *
      * @param parent Workspace-Root-Element
-     * @return a new <code>WorkspaceSecurityConfig</code>
+     * @return a new <code>WorkspaceSecurityConfig</code> or <code>null</code>
+     *         if none is configured.
      * @throws ConfigurationException
      */
     public WorkspaceSecurityConfig parseWorkspaceSecurityConfig(Element parent)
@@ -653,29 +654,31 @@
                 acProviderConfig = parseBeanConfig(element, AC_PROVIDER_ELEMENT);
                 acProviderConfig.setValidate(false); // JCR-1920
             }
+            return new WorkspaceSecurityConfig(acProviderConfig);
         }
-        return new WorkspaceSecurityConfig(acProviderConfig);
+        return null;
     }
 
     /**
-     * Read the optional XmlImport Element of Workspace's configuration. It uses
+     * Read the optional Import Element of Workspace's configuration. It uses
      * the following format:
      * <pre>
-     *   &lt;XmlImport&gt;
+     *   &lt;Import&gt;
      *     &lt;ProtectedNodeImporter class="..." (optional)&gt;
      *     &lt;ProtectedNodeImporter class="..." (optional)&gt;
      *     ...
      *     &lt;ProtectedPropertyImporter class="..." (optional)&gt;
-     *   &lt;/XmlImport&gt;
+     *   &lt;/Import&gt;
      * </pre>
      *
      * @param parent Workspace-Root-Element
-     * @return a new <code>XmlImportConfig</code>
+     * @return a new <code>ImportConfig</code> or <code>null</code>
if none is
+     *         configured.
      * @throws ConfigurationException
      */
     public ImportConfig parseImportConfig(Element parent) throws ConfigurationException {
-        List<BeanConfig> protectedNodeImporters = new ArrayList();
-        List<BeanConfig> protectedPropertyImporters = new ArrayList();
+        List<BeanConfig> protectedNodeImporters = new ArrayList<BeanConfig>();
+        List<BeanConfig> protectedPropertyImporters = new ArrayList<BeanConfig>();
 
         Element element = getElement(parent, IMPORT_ELEMENT, false);
         if (element != null) {
@@ -696,8 +699,9 @@
                     } // else: some other entry -> ignore.
                 }
             }
+            return new ImportConfig(protectedNodeImporters, protectedPropertyImporters);
         }
-        return new ImportConfig(protectedNodeImporters, protectedPropertyImporters);
+        return null;
     }
 
     /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/id/NodeId.java
Mon Nov 30 14:43:40 2009
@@ -122,8 +122,41 @@
      * @param uuid UUID string
      * @throws IllegalArgumentException if the UUID string is invalid
      */
-    public NodeId(String uuid) throws IllegalArgumentException {
-        this(fromString(uuid));
+    public NodeId(String uuidString) throws IllegalArgumentException {
+        // e.g. f81d4fae-7dec-11d0-a765-00a0c91e6bf6
+        //      012345678901234567890123456789012345
+        if (uuidString.length() != UUID_FORMATTED_LENGTH) {
+            throw new IllegalArgumentException(uuidString);
+        }
+        long m = 0, x = 0;
+        for (int i = 0; i < UUID_FORMATTED_LENGTH; i++) {
+            int c = uuidString.charAt(i);
+            switch (i) {
+            case 18:
+                m = x;
+                x = 0;
+                // fall through
+            case 8:
+            case 13:
+            case 23:
+                if (c != '-') {
+                    throw new IllegalArgumentException(uuidString);
+                }
+                break;
+            default:
+                if (c >= '0' && c <= '9') {
+                    x = (x << 4) | (c - '0');
+                } else if (c >= 'a' && c <= 'f') {
+                    x = (x << 4) | (c - 'a' + 0xa);
+                } else if (c >= 'A' && c <= 'F') {
+                    x = (x << 4) | (c - 'A' + 0xa);
+                } else {
+                    throw new IllegalArgumentException(uuidString);
+                }
+            }
+        }
+        this.msb = m;
+        this.lsb = x;
     }
 
     /**
@@ -246,47 +279,4 @@
         return (int) ((msb >>> 32) ^ msb ^ (lsb >>> 32) ^ lsb);
     }
 
-    //------------------------------------------------------------< internal >
-
-    /**
-     * Constructs a UUID from a UUID formatted String.
-     *
-     * @param uuidString the String representing a UUID to construct this UUID
-     * @return the UUID created from the given string.
-     * @throws IllegalArgumentException String must be a properly formatted UUID
-     *                                  string
-     */
-    private static UUID fromString(String uuidString)
-            throws IllegalArgumentException {
-        // e.g. f81d4fae-7dec-11d0-a765-00a0c91e6bf6
-        //      012345678901234567890123456789012345
-        int len = uuidString.length();
-        if (len != UUID_FORMATTED_LENGTH) {
-            throw new IllegalArgumentException();
-        }
-        long[] words = new long[2];
-        int b = 0;
-        for (int i = 0; i < UUID_FORMATTED_LENGTH; i++) {
-            int c = uuidString.charAt(i) | 0x20; // to lowercase (will lose some error checking)
-            if (i == 8 || i == 13 || i == 23) {
-                if (c != '-') {
-                    throw new IllegalArgumentException(String.valueOf(i));
-                }
-            } else if (i == 18) {
-                if (c != '-') {
-                    throw new IllegalArgumentException(String.valueOf(i));
-                }
-                b = 1;
-            } else {
-                byte h = (byte) (c & 0x0f);
-                if (c >= 'a' && c <= 'f') {
-                    h += 9;
-                } else if (c < '0' || c > '9') {
-                    throw new IllegalArgumentException();
-                }
-                words[b] = words[b] << 4 | h;
-            }
-        }
-        return new UUID(words[0], words[1]);
-    }
 }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/EventStateCollection.java
Mon Nov 30 14:43:40 2009
@@ -500,6 +500,15 @@
     }
 
     /**
+     * Get the number of events.
+     *
+     * @return the size
+     */
+    public int size() {
+        return events.size();
+    }
+
+    /**
      * Return the session who is the origin of this events.
      * @return event source
      */

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ObservationDispatcher.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ObservationDispatcher.java?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ObservationDispatcher.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/observation/ObservationDispatcher.java
Mon Nov 30 14:43:40 2009
@@ -27,6 +27,7 @@
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
+import java.util.concurrent.atomic.AtomicInteger;
 
 /**
  * Dispatcher for dispatching events to listeners within a single workspace.
@@ -46,6 +47,16 @@
     private static final DispatchAction DISPOSE_MARKER = new DispatchAction(null, null);
 
     /**
+     * The maximum number of queued asynchronous events. To avoid of of memory
+     * problems, the default value is 200'000. To change the default, set the
+     * system property jackrabbit.maxQueuedEvents to the required value. If more
+     * events are in the queue, the current thread waits, unless the current thread is
+     * the observation dispatcher itself (in which case only a warning is logged
+     * - usually observation listeners shouldn't cause new events).
+     */
+    private static final int MAX_QUEUED_EVENTS = Integer.parseInt(System.getProperty("jackrabbit.maxQueuedEvents",
"200000"));
+
+    /**
      * Currently active <code>EventConsumer</code>s for notification.
      */
     private Set<EventConsumer> activeConsumers = new HashSet<EventConsumer>();
@@ -76,11 +87,15 @@
     private Buffer eventQueue
             = BufferUtils.blockingBuffer(new UnboundedFifoBuffer());
 
+    private AtomicInteger eventQueueSize = new AtomicInteger();
+
     /**
      * The background notification thread
      */
     private Thread notificationThread;
 
+    private long lastError;
+
     /**
      * Creates a new <code>ObservationDispatcher</code> instance
      * and starts the notification thread daemon.
@@ -137,6 +152,7 @@
         DispatchAction action;
         while ((action = (DispatchAction) eventQueue.remove()) != DISPOSE_MARKER) {
 
+            eventQueueSize.getAndAdd(-action.getEventStates().size());
             log.debug("got EventStateCollection");
             log.debug("event delivery to " + action.getEventConsumers().size() + " consumers
started...");
             for (Iterator<EventConsumer> it = action.getEventConsumers().iterator();
it.hasNext();) {
@@ -202,6 +218,33 @@
             }
         }
         eventQueue.add(new DispatchAction(events, getAsynchronousConsumers()));
+        int size = eventQueueSize.addAndGet(events.size());
+        if (size > MAX_QUEUED_EVENTS) {
+            boolean logWarning = false;
+            long now = System.currentTimeMillis();
+            // log a warning at most every 5 seconds (to avoid filling the log file)
+            if (lastError == 0 || now > lastError + 5000) {
+                logWarning = true;
+                log.warn("More than " + MAX_QUEUED_EVENTS + " events in the queue", new Exception("Stack
Trace"));
+                lastError = now;
+            }
+            if (Thread.currentThread() == notificationThread) {
+                if (logWarning) {
+                    log.warn("Recursive notification?");
+                }
+            } else {
+                if (logWarning) {
+                    log.warn("Waiting");
+                }
+                while (eventQueueSize.get() > MAX_QUEUED_EVENTS) {
+                    try {
+                        Thread.sleep(100);
+                    } catch (InterruptedException e) {
+                        // ignore
+                    }
+                }
+            }
+        }
     }
 
     /**

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/IndexMigration.java
Mon Nov 30 14:43:40 2009
@@ -269,7 +269,7 @@
         }
     }
 
-    private static final class ChainedTermEnum extends TermEnum {
+    static final class ChainedTermEnum extends TermEnum {
 
         private Queue<TermEnum> queue = new LinkedList<TermEnum>();
 
@@ -279,17 +279,24 @@
         }
 
         public boolean next() throws IOException {
+            boolean newEnum = false;
             for (;;) {
                 TermEnum terms = queue.peek();
                 if (terms == null) {
                     // no more enums
                     break;
                 }
+                if (newEnum && terms.term() != null) {
+                    // need to check if enum is already positioned
+                    // at first term
+                    return true;
+                }
                 if (terms.next()) {
                     return true;
                 } else {
                     queue.remove();
                     terms.close();
+                    newEnum = true;
                 }
             }
             return false;

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/security/authentication/CryptedSimpleCredentials.java
Mon Nov 30 14:43:40 2009
@@ -130,7 +130,7 @@
             String algr = getAlgorithm(toMatch);
 
             if (algr == null && algorithm != null) {
-                // uncrypted pw to match -> crypt with algorithm present here.
+                // pw to match not crypted -> crypt with algorithm present here.
                 return crypt(toMatch, algorithm).equals(cryptedPassword);
             } else if (algr != null && algorithm == null) {
                 // crypted pw to match but unknown algorithm here -> crypt this pw

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/xml/SessionImporter.java
Mon Nov 30 14:43:40 2009
@@ -94,7 +94,8 @@
      *
      * @param importTargetNode the target node
      * @param session session
-     * @param uuidBehavior the uuid behaviro
+     * @param uuidBehavior the desired uuid behavior as defined
+     * by {@link javax.jcr.ImportUUIDBehavior}.
      * @param config
      */
     public SessionImporter(NodeImpl importTargetNode, SessionImpl session,

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/query/lucene/TestAll.java
Mon Nov 30 14:43:40 2009
@@ -40,6 +40,7 @@
         suite.addTestSuite(DecimalConvertTest.class);
         suite.addTestSuite(IndexingAggregateTest.class);
         suite.addTestSuite(IndexMigrationTest.class);
+        suite.addTestSuite(ChainedTermEnumTest.class);
 
         return suite;
     }

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/AdministratorTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/AdministratorTest.java?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/AdministratorTest.java
(original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/security/user/AdministratorTest.java
Mon Nov 30 14:43:40 2009
@@ -22,12 +22,10 @@
 import org.apache.jackrabbit.api.security.user.User;
 import org.apache.jackrabbit.core.NodeImpl;
 import org.apache.jackrabbit.core.SessionImpl;
-import org.apache.jackrabbit.core.nodetype.NodeTypeImpl;
 import org.apache.jackrabbit.core.id.NodeId;
 import org.apache.jackrabbit.core.security.principal.AdminPrincipal;
 import org.apache.jackrabbit.test.NotExecutableException;
 import org.apache.jackrabbit.spi.commons.conversion.NameResolver;
-import org.apache.jackrabbit.spi.Name;
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
@@ -112,9 +110,7 @@
 
     /**
      * Test for collisions that would prevent from recreate the admin user.
-     *
-     * @throws RepositoryException
-     * @throws NotExecutableException
+     * - an intermediate rep:AuthorizableFolder node with the same name
      */
     public void testAdminNodeCollidingWithAuthorizableFolder() throws RepositoryException,
NotExecutableException {
         Authorizable admin = userMgr.getAuthorizable(adminId);
@@ -136,9 +132,11 @@
         s.save();
 
         Session s2 = null;
+        String collidingPath = null;
         try {
             // now create a colliding node:
-            parentNode.addNode(adminNodeName, "rep:AuthorizableFolder");
+            Node n = parentNode.addNode(adminNodeName, "rep:AuthorizableFolder");
+            collidingPath = n.getPath();
             s.save();
 
             // force recreation of admin user.
@@ -150,20 +148,21 @@
             assertFalse(adminPath.equals(((AuthorizableImpl) admin).getNode().getPath()));
 
         } finally {
-            if (s2 == null) {
-                // something went wrong -> remove the folder again.
-                parentNode.remove();
-                s.save();
-                // force recreation of admin user.
-                s2 = getHelper().getSuperuserSession();
-            }
             if (s2 != null) {
                 s2.logout();
             }
+            // remove the extra folder and the admin user (created underneath) again.
+            if (collidingPath != null) {
+                s.getNode(collidingPath).remove();
+                s.save();
+            }
         }
     }
 
     /**
+     * Test for collisions that would prevent from recreate the admin user.
+     * - a colliding node somewhere else with the same jcr:uuid.
+     *
      * Test if creation of the administrator user forces the removal of some
      * other node in the repository that by change happens to have the same
      * jcr:uuid and thus inhibits the creation of the admininstrator user.
@@ -178,7 +177,6 @@
         // access the node corresponding to the admin user and remove it
         NodeImpl adminNode = ((AuthorizableImpl) admin).getNode();
         NodeId nid = adminNode.getNodeId();
-        String adminPath = adminNode.getPath();
 
         Session s = adminNode.getSession();
         adminNode.remove();
@@ -191,8 +189,10 @@
         try {
             // create a colliding node outside of the user tree
             NameResolver nr = (SessionImpl) s;
+            // NOTE: testRootNode will not be present if users are stored in a distinct wsp.
+            //       therefore use root node as start...
             NodeImpl tr = (NodeImpl) s.getRootNode();
-            Node n = tr.addNode(nr.getQName(nodeName1), nr.getQName(testNodeType), nid);
+            Node n = tr.addNode(nr.getQName("tmpNode"), nr.getQName(testNodeType), nid);
             collidingPath = n.getPath();
             s.save();
 
@@ -229,9 +229,6 @@
 
         // access the node corresponding to the admin user and remove it
         NodeImpl adminNode = ((AuthorizableImpl) admin).getNode();
-        NodeId nid = adminNode.getNodeId();
-        Name nName = adminNode.getQName();
-        Name ntName = ((NodeTypeImpl) adminNode.getPrimaryNodeType()).getQName();
 
         Session s = adminNode.getSession();
         adminNode.remove();

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-jca/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-jca/pom.xml?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-jca/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-jca/pom.xml Mon Nov 30 14:43:40 2009
@@ -119,12 +119,6 @@
       <groupId>org.apache.jackrabbit</groupId>
       <artifactId>jackrabbit-core</artifactId>
       <version>2.0-SNAPSHOT</version>
-      <exclusions>
-        <exclusion>
-          <groupId>commons-logging</groupId>
-          <artifactId>commons-logging</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.slf4j</groupId>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-parent/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-parent/pom.xml?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-parent/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-parent/pom.xml Mon Nov 30 14:43:40 2009
@@ -40,8 +40,8 @@
   </issueManagement>
 
   <properties>
-    <slf4j.version>1.5.3</slf4j.version>
-    <jetty.version>6.1.14</jetty.version>
+   <slf4j.version>1.5.8</slf4j.version>
+    <jetty.version>6.1.22</jetty.version>
     <tika.version>0.5</tika.version>
   </properties>
 
@@ -100,6 +100,7 @@
           <inherited>true</inherited>
           <configuration>
             <instructions>
+              <Bundle-SymbolicName>${pom.groupId}.${pom.artifactId}</Bundle-SymbolicName>
               <Bundle-Category>jcr,jackrabbit</Bundle-Category>
               <Bundle-DocURL>
                 http://jackrabbit.apache.org
@@ -176,22 +177,7 @@
       <dependency>
         <groupId>commons-collections</groupId>
         <artifactId>commons-collections</artifactId>
-        <version>3.1</version>
-      </dependency>
-      <dependency>
-        <groupId>commons-digester</groupId>
-        <artifactId>commons-digester</artifactId>
-        <version>1.7</version>
-      </dependency>
-      <dependency>
-        <groupId>commons-lang</groupId>
-        <artifactId>commons-lang</artifactId>
-        <version>2.1</version>
-      </dependency>
-      <dependency>
-        <groupId>commons-beanutils</groupId>
-        <artifactId>commons-beanutils</artifactId>
-        <version>1.7.0</version>
+        <version>3.2.1</version>
       </dependency>
       <dependency>
         <groupId>commons-io</groupId>
@@ -248,17 +234,7 @@
       <dependency>
         <groupId>org.apache.derby</groupId>
         <artifactId>derby</artifactId>
-        <version>10.2.1.6</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.derby</groupId>
-        <artifactId>derbynet</artifactId>
-        <version>10.2.1.6</version>
-      </dependency>
-      <dependency>
-        <groupId>org.apache.derby</groupId>
-        <artifactId>derbyclient</artifactId>
-        <version>10.2.1.6</version>
+        <version>10.5.3.0_1</version>
       </dependency>
       <dependency>
         <groupId>org.apache.geronimo.specs</groupId>
@@ -283,7 +259,7 @@
       </dependency>
       <dependency>
         <groupId>org.mortbay.jetty</groupId>
-        <artifactId>jsp-2.1</artifactId>
+        <artifactId>jsp-2.1-jetty</artifactId>
         <version>${jetty.version}</version>
       </dependency>
       <dependency>
@@ -292,19 +268,9 @@
         <version>${jetty.version}</version>
       </dependency>
       <dependency>
-        <groupId>org.mortbay.jetty</groupId>
-        <artifactId>servlet-api-2.5</artifactId>
-        <version>${jetty.version}</version>
-      </dependency>
-      <dependency>
-        <groupId>org.mortbay.jetty</groupId>
-        <artifactId>jsp-api-2.1</artifactId>
-        <version>${jetty.version}</version>
-      </dependency>
-      <dependency>
         <groupId>xerces</groupId>
         <artifactId>xercesImpl</artifactId>
-        <version>2.8.1</version>
+        <version>2.9.0</version>
       </dependency>
       <dependency>
         <groupId>cglib</groupId>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-standalone/pom.xml Mon Nov 30 14:43:40 2009
@@ -86,7 +86,7 @@
     </dependency>
     <dependency>
       <groupId>org.mortbay.jetty</groupId>
-      <artifactId>jsp-2.1</artifactId>
+      <artifactId>jsp-2.1-jetty</artifactId>
     </dependency>
     <!--
       JCR-1882: Explicitly declare versions of transitive Jetty dependencies
@@ -97,14 +97,6 @@
       <artifactId>jetty-util</artifactId>
     </dependency>
     <dependency>
-      <groupId>org.mortbay.jetty</groupId>
-      <artifactId>servlet-api-2.5</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.mortbay.jetty</groupId>
-      <artifactId>jsp-api-2.1</artifactId>
-    </dependency>
-    <dependency>
       <groupId>commons-cli</groupId>
       <artifactId>commons-cli</artifactId>
       <version>1.1</version>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/pom.xml?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webapp/pom.xml Mon Nov 30 14:43:40 2009
@@ -53,28 +53,11 @@
       <groupId>org.apache.jackrabbit</groupId>
       <artifactId>jackrabbit-core</artifactId>
       <version>2.0-SNAPSHOT</version>
-      <exclusions>
-        <exclusion>
-          <groupId>commons-logging</groupId>
-          <artifactId>commons-logging</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>
       <artifactId>jackrabbit-jcr-server</artifactId>
       <version>2.0-SNAPSHOT</version>
-      <exclusions>
-        <!-- JCR-683: The commons-httpclient dependency from            -->
-        <!-- jackrabbit-webapp depends on commons-logging. Since this   -->
-        <!-- webapp uses log4j (see the slf4j-log4j12 dependency below) -->
-        <!-- for logging, we need to override this dependency with the  -->
-        <!-- jcl104-over-sflf4j dependency given below.                 -->
-        <exclusion>
-          <groupId>commons-logging</groupId>
-          <artifactId>commons-logging</artifactId>
-        </exclusion>
-      </exclusions>
     </dependency>
     <dependency>
       <groupId>org.apache.jackrabbit</groupId>
@@ -88,12 +71,6 @@
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
     </dependency>
-    <!-- JCR-683: Use jcl104-over-slf4j instead of the commons-logging -->
-    <!-- dependency excluded above                                     -->
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>jcl-over-slf4j</artifactId>
-    </dependency>
     <dependency>
       <groupId>javax.servlet</groupId>
       <artifactId>servlet-api</artifactId>
@@ -105,7 +82,7 @@
       <plugin>
          <groupId>org.mortbay.jetty</groupId>
          <artifactId>maven-jetty-plugin</artifactId>
-         <version>6.1.9</version>
+         <version>${jetty.version}</version>
          <configuration>
            <scanIntervalSeconds>10</scanIntervalSeconds>
            <connectors>

Modified: jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/pom.xml?rev=885437&r1=885436&r2=885437&view=diff
==============================================================================
--- jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/pom.xml (original)
+++ jackrabbit/sandbox/JCR-1456/jackrabbit-webdav/pom.xml Mon Nov 30 14:43:40 2009
@@ -76,7 +76,20 @@
     <dependency>
       <groupId>commons-httpclient</groupId>
       <artifactId>commons-httpclient</artifactId>
+      <exclusions>
+        <!-- JCR-2411: Replace commons-logging with jcl-over-slf4j -->
+        <exclusion>
+          <groupId>commons-logging</groupId>
+          <artifactId>commons-logging</artifactId>
+        </exclusion>
+      </exclusions>
     </dependency>
+    <!-- JCR-2411: Replace commons-logging with jcl-over-slf4j -->
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>jcl-over-slf4j</artifactId>
+    </dependency>
+
     <dependency>
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>



Mime
View raw message