Skip to content
Snippets Groups Projects
Commit b9f7643e authored by Simon Urli's avatar Simon Urli
Browse files

XWIKI-21609: DefaultLiveDataSourceManager is silently ignoring component initialization errors

  * Provide proper log errors in case of initialization problem instead
    of ignoring it

(cherry picked from commit e87052f4)
parent 10c6ff38
No related branches found
No related tags found
No related merge requests found
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
import javax.inject.Provider; import javax.inject.Provider;
import javax.inject.Singleton; import javax.inject.Singleton;
import org.slf4j.Logger;
import org.xwiki.component.annotation.Component; import org.xwiki.component.annotation.Component;
import org.xwiki.component.internal.multi.ComponentManagerManager; import org.xwiki.component.internal.multi.ComponentManagerManager;
import org.xwiki.component.manager.ComponentLookupException; import org.xwiki.component.manager.ComponentLookupException;
...@@ -61,6 +62,9 @@ public class DefaultLiveDataSourceManager implements LiveDataSourceManager ...@@ -61,6 +62,9 @@ public class DefaultLiveDataSourceManager implements LiveDataSourceManager
@Inject @Inject
private ComponentManagerManager componentManagerManager; private ComponentManagerManager componentManagerManager;
@Inject
private Logger logger;
@Override @Override
public Optional<LiveDataSource> get(Source sourceConfig, String namespace) public Optional<LiveDataSource> get(Source sourceConfig, String namespace)
{ {
...@@ -73,7 +77,7 @@ public Optional<LiveDataSource> get(Source sourceConfig, String namespace) ...@@ -73,7 +77,7 @@ public Optional<LiveDataSource> get(Source sourceConfig, String namespace)
} }
return Optional.of(liveDataSource); return Optional.of(liveDataSource);
} catch (ComponentLookupException e) { } catch (ComponentLookupException e) {
// Shouldn't happen normally, unless the component was just unregistered by another thread. this.logger.error("Error when initializing LiveDataSource with hint [{}]", sourceConfig.getId(), e);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment