karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf git commit: KARAF-4031 - Avoid to block boot features when a repository can't be loaded
Date Tue, 05 Jan 2016 17:00:28 GMT
Repository: karaf
Updated Branches:
  refs/heads/master c806a6ad4 -> 843909a89


KARAF-4031 - Avoid to block boot features when a repository can't be loaded

KARAF-4083 - Avoid to break features service when a repository can't be loaded


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

Branch: refs/heads/master
Commit: 843909a8915e2c4ba541c8725445b19926ee7ab6
Parents: c806a6a
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Tue Jan 5 17:59:00 2016 +0100
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Tue Jan 5 17:59:00 2016 +0100

----------------------------------------------------------------------
 .../internal/service/FeaturesServiceImpl.java     | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/843909a8/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
index 5558970..3efd8a0 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/service/FeaturesServiceImpl.java
@@ -633,15 +633,19 @@ public class FeaturesServiceImpl implements FeaturesService, Deployer.DeployCall
             }
             if (repo == null) {
                 RepositoryImpl rep = new RepositoryImpl(URI.create(uri), blacklisted);
-                rep.load();
-                repo = rep;
-                synchronized (lock) {
-                    repositoryCache.put(uri, repo);
+                try {
+                    rep.load();
+                    repo = rep;
+                    synchronized (lock) {
+                        repositoryCache.put(uri, repo);
+                    }
+                    for (URI u : repo.getRepositories()) {
+                        toLoad.add(u.toString());
+                    }
+                } catch (Exception e) {
+                    LOGGER.warn("Can't load features repository {}", uri, e);
                 }
             }
-            for (URI u : repo.getRepositories()) {
-                toLoad.add(u.toString());
-            }
         }
         List<Repository> repos;
         synchronized (lock) {


Mime
View raw message