Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9E1DF200BAC for ; Tue, 11 Oct 2016 10:38:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9CF26160AD2; Tue, 11 Oct 2016 08:38:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id DA66B160AE6 for ; Tue, 11 Oct 2016 10:38:22 +0200 (CEST) Received: (qmail 808 invoked by uid 500); 11 Oct 2016 08:38:21 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 470 invoked by uid 99); 11 Oct 2016 08:38:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Oct 2016 08:38:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 8D1602C4C7A for ; Tue, 11 Oct 2016 08:38:21 +0000 (UTC) Date: Tue, 11 Oct 2016 08:38:21 +0000 (UTC) From: "Grzegorz Grzybek (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KARAF-4100) [karaf-3.0.x] Error resolving artifact of feature due to org.ops4j.pax.url.mvn.cfg not loaded yet MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 11 Oct 2016 08:38:23 -0000 [ https://issues.apache.org/jira/browse/KARAF-4100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15564912#comment-15564912 ] Grzegorz Grzybek commented on KARAF-4100: ----------------------------------------- For me, the workaround was to put exactly the same set of {{org.ops4j.pax.url.mvn.*}} properties to {{etc/config.properties}} file. pax-url-aether, when starting checks if configuration for this PID is available (or if configadmin service is available at all). In case it doesn't find the config, it calls {{org.osgi.framework.BundleContext#getProperty()}} which uses {{etc/config.properties}} as a source. It's obvious duplication, but it works without problems. Other solution would be to reimplement {{org.ops4j.pax.url.mvn.internal.Activator#start()}}, but this issue should be created at https://ops4j1.jira.com/browse/PAXURL. > [karaf-3.0.x] Error resolving artifact of feature due to org.ops4j.pax.url.mvn.cfg not loaded yet > ------------------------------------------------------------------------------------------------- > > Key: KARAF-4100 > URL: https://issues.apache.org/jira/browse/KARAF-4100 > Project: Karaf > Issue Type: Bug > Components: karaf-feature > Affects Versions: 3.0.5 > Environment: Karaf 3.0.4, Windows 7 > Reporter: Jerry Meng > > I set the mvn repository to the karaf_home/system directory in org.ops4j.pax.url.mvn.cfg. > However, I found there is a chance that Karaf was trying to access the Internet and threw an exception since it's in a closed environment. > {code} > Error resolving artifact org.apache.karaf.features:enterprise:xml:features:3.0.4: Could not transfer artifact org.apache.karaf.features:enterprise:xml:features:3.0.4 from/to (http://mvn.mycompany.net/content/groups/public): Not authorized , ReasonPhrase:Unauthorized. > {code} > Root Cause > ========= > Through further tracking, the root cause may happen in org.ops4j.pax.url.mvn.internal.Activator (pax-url-aether). The pax url fails to load org.ops4j.pax.url.mvn.cfg before Karaf connects the feature url. Therefore Karaf ignores my settings in the configuration file but tries to access default remote repository. Here are some logs to describe the situation... > {code} > 1. activator.updated.dictionary: null > 2. updated directory from safeRegisterService: null > 3. activator.openConnection: mvn:org.apache.karaf.features/enterprise/3.0.4/xml/features > 4. Unable to add features repository mvn:org.apache.karaf.features/enterprise/3.0.4/xml/features at startup > 5. updated directory from safeRegisterService: {felix.fileinstall.filename={file:/D:/karaf/etc/org.ops4j.pax.url.mvn.cfg... } > 6. activator.updated.dictionary: {felix.fileinstall.filename={file:/D:/karaf/etc/org.ops4j.pax.url.mvn.cfg... } > {code} > Workaround > ========= > I'm not sure if I should call this a bug, but in my case I can assume org.ops4j.pax.url.mvn.cfg is existent definitely. > Therefore, I make Activator.openConnection to wait if the Dictionary is not set. > Then invoke notifyAll in Activator.updated after receiving an non-null Dictionary. -- This message was sent by Atlassian JIRA (v6.3.4#6332)