manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1791452 - in /manifoldcf/branches/CONNECTORS-1290-2: ./ connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/nuxeo/ connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/nuxeo/ ...
Date Sat, 15 Apr 2017 06:25:00 GMT
Author: kwright
Date: Sat Apr 15 06:25:00 2017
New Revision: 1791452

URL: http://svn.apache.org/viewvc?rev=1791452&view=rev
Log:
Convert to log4j 2.4

Modified:
    manifoldcf/branches/CONNECTORS-1290-2/build.xml
    manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/nuxeo/NuxeoAuthorityConnector.java
    manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/nuxeo/NuxeoRepositoryConnector.java
    manifoldcf/branches/CONNECTORS-1290-2/framework/core/pom.xml
    manifoldcf/branches/CONNECTORS-1290-2/framework/core/src/main/java/org/apache/manifoldcf/core/system/Logging.java
    manifoldcf/branches/CONNECTORS-1290-2/pom.xml

Modified: manifoldcf/branches/CONNECTORS-1290-2/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/build.xml?rev=1791452&r1=1791451&r2=1791452&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/build.xml (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/build.xml Sat Apr 15 06:25:00 2017
@@ -71,7 +71,7 @@
     <property name="junit.version" value="4.12"/>
     <property name="selenium.version" value="3.3.1"/>
     <property name="hamcrest.version" value="1.3"/>
-    <property name="log4j.version" value="1.2.16"/>
+    <property name="log4j.version" value="2.4.1"/>
     <property name="mail.version" value="1.4.5"/>
     <property name="mimepull.version" value="1.3"/>
     <property name="opensaml.version" value="1.1"/>
@@ -1673,9 +1673,21 @@ Use Apache Forrest version forrest-0.9-d
     <target name="download-log4j">
         <mkdir dir="lib"/>
         <antcall target="download-via-maven"><param name="target" value="lib"/>
-            <param name="project-path" value="log4j"/>
+            <param name="project-path" value="org/apache/logging/log4j"/>
             <param name="artifact-version" value="${log4j.version}"/>
-            <param name="artifact-name" value="log4j"/>
+            <param name="artifact-name" value="log4j-core"/>
+            <param name="artifact-type" value="jar"/>
+        </antcall>
+        <antcall target="download-via-maven"><param name="target" value="lib"/>
+            <param name="project-path" value="org/apache/logging/log4j"/>
+            <param name="artifact-version" value="${log4j.version}"/>
+            <param name="artifact-name" value="log4j-api"/>
+            <param name="artifact-type" value="jar"/>
+        </antcall>
+        <antcall target="download-via-maven"><param name="target" value="lib"/>
+            <param name="project-path" value="org/apache/logging/log4j"/>
+            <param name="artifact-version" value="${log4j.version}"/>
+            <param name="artifact-name" value="log4j-1.2-api"/>
             <param name="artifact-type" value="jar"/>
         </antcall>
     </target>

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/nuxeo/NuxeoAuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/nuxeo/NuxeoAuthorityConnector.java?rev=1791452&r1=1791451&r2=1791452&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/nuxeo/NuxeoAuthorityConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/authorities/authorities/nuxeo/NuxeoAuthorityConnector.java
Sat Apr 15 06:25:00 2017
@@ -140,7 +140,7 @@ public class NuxeoAuthorityConnector ext
     initNuxeoClient();
     try {
       nuxeoClient.repository().getDocumentRoot();
-    } catch (Exception ex) {
+    } catch (NuxeoClientException ex) {
       return "Connection failed: "+ex.getMessage();
     }
 
@@ -346,9 +346,9 @@ public class NuxeoAuthorityConnector ext
   }
 
   @Override
-  public AuthorizationResponse getAuthorizationResponse(String username) {
+  public AuthorizationResponse getAuthorizationResponse(String username) throws ManifoldCFException
{
+    initNuxeoClient();
     try {
-      initNuxeoClient();
       List<String> authorities = getGroupsByUser(username);
       if (authorities == null || authorities.isEmpty()) {
         return RESPONSE_USERNOTFOUND;
@@ -357,8 +357,6 @@ public class NuxeoAuthorityConnector ext
       }
 
     } catch (NuxeoClientException e) {
-      return RESPONSE_USERNOTFOUND;
-    } catch (Exception e) {
       return RESPONSE_UNREACHABLE;
     }
   }

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/nuxeo/NuxeoRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/nuxeo/NuxeoRepositoryConnector.java?rev=1791452&r1=1791451&r2=1791452&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/nuxeo/NuxeoRepositoryConnector.java
(original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/nuxeo/NuxeoRepositoryConnector.java
Sat Apr 15 06:25:00 2017
@@ -50,6 +50,8 @@ import org.apache.manifoldcf.crawler.int
 import org.nuxeo.client.api.NuxeoClient;
 import org.nuxeo.client.api.objects.Document;
 import org.nuxeo.client.api.objects.Documents;
+import org.nuxeo.client.internals.spi.NuxeoClientException;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -301,7 +303,7 @@ public class NuxeoRepositoryConnector ex
     initNuxeoClient();
     try {
       nuxeoClient.repository().getDocumentRoot();
-    } catch (Exception ex) {
+    } catch (NuxeoClientException ex) {
       return "Connection failed: "+ex.getMessage();
     }
 
@@ -424,11 +426,15 @@ public class NuxeoRepositoryConnector ex
       lastSeedVersion = sdf.format(new Date());
 
       return lastSeedVersion;
-    } catch (Exception exception) {
+    } catch (NuxeoClientException exception) {
+      throw new ManifoldCFException("Failure during seeding: "+exception.getMessage(), exception);
+      /*
+      exception.printStackTrace();
       long interruptionRetryTime = 5L * 60L * 1000L;
       String message = "Server appears down during seeding: " + exception.getMessage();
       throw new ServiceInterruption(message, exception, System.currentTimeMillis() + interruptionRetryTime,
-1L,
           3, true);
+      */
     }
   }
   
@@ -508,7 +514,9 @@ public class NuxeoRepositoryConnector ex
 
         pResult = processDocument(documentId, spec, version, activities, doLog,
             Maps.<String, String> newHashMap());
-      } catch (Exception exception) {
+      } catch (NuxeoClientException exception) {
+        throw new ManifoldCFException("Client exception: "+exception.getMessage(), exception);
+      } catch (IOException exception) {
         long interruptionRetryTime = 5L * 60L * 1000L;
         String message = "Server appears down during seeding: " + exception.getMessage();
         throw new ServiceInterruption(message, exception, System.currentTimeMillis() + interruptionRetryTime,
@@ -610,7 +618,7 @@ public class NuxeoRepositoryConnector ex
     try {
       documentUri = getUrl() + "/nxpath/" + doc.getDocument().getRepositoryName() + doc.getDocument().getPath()
           + "@view_documents";
-    } catch (Exception ex) {
+    } catch (NuxeoClientException ex) {
       documentUri = doc.getDocument().getUid();
     }
 

Modified: manifoldcf/branches/CONNECTORS-1290-2/framework/core/pom.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/framework/core/pom.xml?rev=1791452&r1=1791451&r2=1791452&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/framework/core/pom.xml (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/framework/core/pom.xml Sat Apr 15 06:25:00 2017
@@ -67,8 +67,18 @@
       <version>${httpcomponent.httpclient.version}</version>
     </dependency>
     <dependency>
-      <groupId>log4j</groupId>
-      <artifactId>log4j</artifactId>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-core</artifactId>
+      <version>${log4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-api</artifactId>
+      <version>${log4j.version}</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.logging.log4j</groupId>
+      <artifactId>log4j-1.2-api</artifactId>
       <version>${log4j.version}</version>
     </dependency>
     <dependency>

Modified: manifoldcf/branches/CONNECTORS-1290-2/framework/core/src/main/java/org/apache/manifoldcf/core/system/Logging.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/framework/core/src/main/java/org/apache/manifoldcf/core/system/Logging.java?rev=1791452&r1=1791451&r2=1791452&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/framework/core/src/main/java/org/apache/manifoldcf/core/system/Logging.java
(original)
+++ manifoldcf/branches/CONNECTORS-1290-2/framework/core/src/main/java/org/apache/manifoldcf/core/system/Logging.java
Sat Apr 15 06:25:00 2017
@@ -23,13 +23,6 @@ import java.util.*;
 import java.io.*;
 
 import org.apache.log4j.*;
-import org.apache.log4j.Logger;
-import org.apache.log4j.Level;
-import org.apache.log4j.Layout.*;
-import org.apache.log4j.helpers.DateLayout;
-import org.apache.log4j.helpers.DateTimeDateFormat;
-import org.apache.log4j.DailyRollingFileAppender;
-import org.apache.log4j.PropertyConfigurator;
 
 /** This class furnishes the logging environment for the JSKW application.
 */

Modified: manifoldcf/branches/CONNECTORS-1290-2/pom.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/pom.xml?rev=1791452&r1=1791451&r2=1791452&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/pom.xml (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/pom.xml Sat Apr 15 06:25:00 2017
@@ -77,7 +77,7 @@
     <servlet-api.version>3.1.0</servlet-api.version>
     <jstl.version>1.2</jstl.version>
     <glassfish.version>2.1.v20091210</glassfish.version>
-    <log4j.version>1.2.16</log4j.version>
+    <log4j.version>2.4.1</log4j.version>
     <velocity.version>1.7</velocity.version>
     <slf4j.version>1.7.7</slf4j.version>
     <jaxb.version>2.2.6</jaxb.version>



Mime
View raw message