Return-Path: X-Original-To: apmail-karaf-issues-archive@minotaur.apache.org Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2016C4AC5 for ; Mon, 11 Jul 2011 10:56:28 +0000 (UTC) Received: (qmail 82288 invoked by uid 500); 11 Jul 2011 10:56:28 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 82260 invoked by uid 500); 11 Jul 2011 10:56:23 -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 82123 invoked by uid 99); 11 Jul 2011 10:56:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jul 2011 10:56:22 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Jul 2011 10:56:20 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id D9FA6456BE for ; Mon, 11 Jul 2011 10:55:59 +0000 (UTC) Date: Mon, 11 Jul 2011 10:55:59 +0000 (UTC) From: =?utf-8?Q?Jean-Baptiste_Onofr=C3=A9_=28JIRA=29?= To: issues@karaf.apache.org Message-ID: <3739400.2653.1310381759889.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <16064364.212391292842140914.JavaMail.jira@thor> Subject: [jira] [Updated] (KARAF-334) At startup, Karaf does not support urls like mvn:, obr:. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-334?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:all-tabpanel ] Jean-Baptiste Onofr=C3=A9 updated KARAF-334: --------------------------------------- Fix Version/s: 3.1.0 3.0.0 > At startup, Karaf does not support urls like mvn:, obr:. > -------------------------------------------------------- > > Key: KARAF-334 > URL: https://issues.apache.org/jira/browse/KARAF-334 > Project: Karaf > Issue Type: Improvement > Components: runtime > Affects Versions: 2.1.2 > Reporter: Stephane Chomat > Assignee: Guillaume Nodet > Fix For: 3.0.0, 3.1.0 > > Attachments: patch-KARAF-334, patch-KARAF-334-karaf-2.1.x, test-k= araf-home.zip > > Original Estimate: 24h > Remaining Estimate: 24h > > At startup, Karafi does not support urls like mvn:, obr:. > Imagine that at level 5 you install the bundle pax-url-mvn with karaf.aut= o.start.5 =3D "file: pax-url-mvn.jar | pax-url-mvn"=20 > and then at level 10 you install mvn:. ... With karaf.auto.start.10 =3D "= mvn :....| ...." > At the level 6 the url handler 'mvn' is available and you can use it. > This feature does not work with Karaf > I propose this path : > diff -r f0bb11c3d77c src/main/java/org/apache/karaf/main/Main.java > --- a/src/main/java/org/apache/karaf/main/Main.java=09Mon Dec 20 11:05:11= 2010 +0100 > +++ b/src/main/java/org/apache/karaf/main/Main.java=09Mon Dec 20 11:46:29= 2010 +0100 > @@ -485,28 +485,20 @@ > // the start level to which the bundles are assigned is specifie= d by > // appending a ".n" to the auto-install property name, where "n"= is > // the desired start level for the list of bundles. > - autoInstall(PROPERTY_AUTO_INSTALL, context, sl, convertToMavenUr= ls); > + autoInstall(PROPERTY_AUTO_INSTALL, context, sl, convertToMavenUr= ls, false); > =20 > // The auto-start property specifies a space-delimited list of > // bundle URLs to be automatically installed and started into ea= ch > // new profile; the start level to which the bundles are assigne= d > // is specified by appending a ".n" to the auto-start property n= ame, > // where "n" is the desired start level for the list of bundles. > - // The following code starts bundles in two passes, first it ins= talls > - // them, then it starts them. > - List bundlesToStart =3D autoInstall(PROPERTY_AUTO_ST= ART, context, sl, convertToMavenUrls); > - // Now loop through and start the installed bundles. > - for (Bundle b : bundlesToStart) { > - try { > - b.start(); > - } > - catch (Exception ex) { > - System.err.println("Auto-properties start: " + ex); > - } > - } > + // The following code starts bundles in one passes, it installs > + // and it starts them by level. > + autoInstall(PROPERTY_AUTO_START, context, sl, convertToMavenUrls= , true); > + =20 > } > =20 > - private List autoInstall(String propertyPrefix, BundleContex= t context, StartLevel sl, boolean convertToMavenUrls) { > + private List autoInstall(String propertyPrefix, BundleContex= t context, StartLevel sl, boolean convertToMavenUrls, boolean start) { > Map autoStart =3D new TreeMap(= ); > List bundles =3D new ArrayList(); > for (Iterator i =3D configProps.keySet().iterator(); i.hasNext()= ;) { > @@ -531,6 +523,7 @@ > } > for (Integer startLevel : autoStart.keySet()) { > StringTokenizer st =3D new StringTokenizer(autoStart.get(sta= rtLevel), "\" ", true); > + List bundlesLevel =3D new ArrayList(); > if (st.countTokens() > 0) { > String location =3D null; > do { > @@ -541,6 +534,7 @@ > Bundle b =3D context.installBundle(parts[0],= new URL(parts[1]).openStream()); > sl.setBundleStartLevel(b, startLevel); > bundles.add(b); > + bundlesLevel.add(b); > } > catch (Exception ex) { > System.err.println("Auto-properties install:= " + ex); > @@ -549,6 +543,15 @@ > } > while (location !=3D null); > } > + // Now loop through and start the installed bundles. > + for (Bundle b : bundlesLevel) { > + try { > + b.start(); > + } > + catch (Exception ex) { > + System.err.println("Auto-properties start: " + ex); > + } > + } > } > return bundles; > } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira