Return-Path: X-Original-To: apmail-camel-dev-archive@www.apache.org Delivered-To: apmail-camel-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D9BB110A71 for ; Sun, 19 Apr 2015 21:25:04 +0000 (UTC) Received: (qmail 53457 invoked by uid 500); 19 Apr 2015 21:25:04 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 53420 invoked by uid 500); 19 Apr 2015 21:25:04 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 53379 invoked by uid 99); 19 Apr 2015 21:25:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Apr 2015 21:25:04 +0000 X-ASF-Spam-Status: No, hits=1.2 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,SPF_SOFTFAIL X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of cschneider111@gmail.com does not designate 54.191.145.13 as permitted sender) Received: from [54.191.145.13] (HELO mx1-us-west.apache.org) (54.191.145.13) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 19 Apr 2015 21:24:59 +0000 Received: from mail-qg0-f51.google.com (mail-qg0-f51.google.com [209.85.192.51]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id BBCA92143D for ; Sun, 19 Apr 2015 21:24:38 +0000 (UTC) Received: by qgdy78 with SMTP id y78so44520276qgd.0 for ; Sun, 19 Apr 2015 14:24:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=AD171VskFk+nbTvGbsAwQD4kMMThLoPQ72yLC8Pds2k=; b=tZ73jjaasW9JciOX59F4V5+b4FSZsU7lAqIYNhc9Jc9LZiQR9EtBkoWschLH6wOJn3 JOOWUcRYApU3CISGaBNfh0BpQnGwow65jKZaShgpJs+7qvuJEyh/CSn87QhwZJtnDc/H 3cztnCLyzW6I1eFnZQg6+doGDaFWnkS5BSVSww8l2i/ggGyhwpT1ZWYBzN8RbLZEeOji gAhr6tYjxdOe3WE7cGqvBjZPD0c5SCsN+ynU+oS/WTSVo6O4vRW2FoUwmU/bfx2ijlCm BCCdbaSR7zXQlXzu/eSyHEvFkUWYT6kSP5vXcXcncYW2Jn9hGOrtHqVY/Z91dG38FErC vIkg== X-Received: by 10.55.21.12 with SMTP id f12mr23296790qkh.87.1429478672118; Sun, 19 Apr 2015 14:24:32 -0700 (PDT) Received: from [192.168.0.112] (HSI-KBW-149-172-61-90.hsi13.kabel-badenwuerttemberg.de. [149.172.61.90]) by mx.google.com with ESMTPSA id 28sm12964481qkw.13.2015.04.19.14.24.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Apr 2015 14:24:31 -0700 (PDT) Sender: Christian Schneider Message-ID: <55341D0E.9050700@die-schneider.net> Date: Sun, 19 Apr 2015 23:24:30 +0200 From: Christian Schneider User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: dev@camel.apache.org Subject: Re: camel git commit: CAMEL-8647: Make Camel OSGI Extender Subsystem-Aware - With thanks to Manuel Holzleitner References: <93ec74ad84fa46c0b7a6e24c8d203417@git.apache.org> In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi Claus, you are right. The problem was caused by my commit. I am currently testing a fix and will shortly do the commit. I also found why I did not see the problem in my own test by hand. It was simply because I used camel-blueprint not camel-spring. So gladly karaf 4 and 2.4 do not work differently here. Christian On 19.04.2015 07:50, Claus Ibsen wrote: > Hi > > I wonder if this may cause master branch to fail in the > camel-test-blueprint module? > > https://builds.apache.org/job/Camel.trunk.fulltest/org.apache.camel$camel-test-blueprint/2274/testReport/junit/org.apache.camel.test.blueprint/CustomIdIssuesTest/testCustomId/ > > I get same errors running it locally on my laptop > > > > On Fri, Apr 17, 2015 at 4:52 PM, wrote: >> Repository: camel >> Updated Branches: >> refs/heads/master 96cfe14c9 -> a5a0cd7e7 >> >> >> CAMEL-8647: Make Camel OSGI Extender Subsystem-Aware - With thanks to Manuel Holzleitner >> >> >> Project: http://git-wip-us.apache.org/repos/asf/camel/repo >> Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a5a0cd7e >> Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a5a0cd7e >> Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a5a0cd7e >> >> Branch: refs/heads/master >> Commit: a5a0cd7e7dcc9b3c41ee96f5da0975f48c98ca7b >> Parents: 96cfe14 >> Author: Christian Schneider >> Authored: Fri Apr 17 15:42:33 2015 +0200 >> Committer: Christian Schneider >> Committed: Fri Apr 17 16:52:16 2015 +0200 >> >> ---------------------------------------------------------------------- >> .../org/apache/camel/impl/osgi/Activator.java | 48 ++++++++++++++++---- >> parent/pom.xml | 3 +- >> 2 files changed, 40 insertions(+), 11 deletions(-) >> ---------------------------------------------------------------------- >> >> >> http://git-wip-us.apache.org/repos/asf/camel/blob/a5a0cd7e/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java >> ---------------------------------------------------------------------- >> diff --git a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java >> index d73f6c6..2eddc25 100644 >> --- a/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java >> +++ b/camel-core/src/main/java/org/apache/camel/impl/osgi/Activator.java >> @@ -64,6 +64,8 @@ import org.osgi.framework.BundleContext; >> import org.osgi.framework.BundleEvent; >> import org.osgi.framework.Constants; >> import org.osgi.framework.ServiceRegistration; >> +import org.osgi.framework.wiring.BundleWire; >> +import org.osgi.framework.wiring.BundleWiring; >> import org.slf4j.Logger; >> import org.slf4j.LoggerFactory; >> >> @@ -75,15 +77,20 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer { >> public static final String META_INF_DATAFORMAT = "META-INF/services/org/apache/camel/dataformat/"; >> public static final String META_INF_TYPE_CONVERTER = "META-INF/services/org/apache/camel/TypeConverter"; >> public static final String META_INF_FALLBACK_TYPE_CONVERTER = "META-INF/services/org/apache/camel/FallbackTypeConverter"; >> + public static final String EXTENDER_NAMESPACE = "osgi.extender"; >> + public static final String CAMEL_EXTENDER = "org.apache.camel"; >> >> private static final Logger LOG = LoggerFactory.getLogger(Activator.class); >> >> private BundleTracker tracker; >> private Map> resolvers = new ConcurrentHashMap>(); >> + private long bundleId; >> >> public void start(BundleContext context) throws Exception { >> LOG.info("Camel activator starting"); >> - tracker = new BundleTracker(context, Bundle.ACTIVE, this); >> + bundleId = context.getBundle().getBundleId(); >> + BundleContext systemBundleContext = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).getBundleContext(); >> + tracker = new BundleTracker(systemBundleContext, Bundle.ACTIVE, this); >> tracker.open(); >> LOG.info("Camel activator started"); >> } >> @@ -96,18 +103,38 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer { >> >> public Object addingBundle(Bundle bundle, BundleEvent event) { >> LOG.debug("Bundle started: {}", bundle.getSymbolicName()); >> - List r = new ArrayList(); >> - registerComponents(bundle, r); >> - registerLanguages(bundle, r); >> - registerDataFormats(bundle, r); >> - registerTypeConverterLoader(bundle, r); >> - for (BaseService service : r) { >> - service.register(); >> - } >> - resolvers.put(bundle.getBundleId(), r); >> + if (extenderCapabilityWired(bundle)) { >> + List r = new ArrayList(); >> + registerComponents(bundle, r); >> + registerLanguages(bundle, r); >> + registerDataFormats(bundle, r); >> + registerTypeConverterLoader(bundle, r); >> + for (BaseService service : r) { >> + service.register(); >> + } >> + resolvers.put(bundle.getBundleId(), r); >> + } >> + >> return bundle; >> } >> >> + private boolean extenderCapabilityWired(Bundle bundle) { >> + BundleWiring wiring = bundle.adapt(BundleWiring.class); >> + List requiredWires = wiring.getRequiredWires(EXTENDER_NAMESPACE); >> + for (BundleWire requiredWire : requiredWires) { >> + if (CAMEL_EXTENDER.equals(requiredWire.getCapability().getAttributes().get(EXTENDER_NAMESPACE))) { >> + if (this.bundleId == requiredWire.getProviderWiring().getBundle().getBundleId()) { >> + LOG.debug("Camel extender requirement of bundle {} correctly wired to this implementation", bundle.getBundleId()); >> + return true; >> + } else { >> + LOG.info("Not processing bundle {} as it requires a camel extender but is not wired to the this implementation", bundle.getBundleId()); >> + return false; >> + } >> + } >> + } >> + return true; >> + } >> + >> public void modifiedBundle(Bundle bundle, BundleEvent event, Object object) { >> } >> >> @@ -537,3 +564,4 @@ public class Activator implements BundleActivator, BundleTrackerCustomizer { >> >> } >> >> + >> >> http://git-wip-us.apache.org/repos/asf/camel/blob/a5a0cd7e/parent/pom.xml >> ---------------------------------------------------------------------- >> diff --git a/parent/pom.xml b/parent/pom.xml >> index 530371f..877c6ba 100644 >> --- a/parent/pom.xml >> +++ b/parent/pom.xml >> @@ -521,7 +521,8 @@ >> version="[$(version;===;${camel.osgi.version.clean}),$(version;==+;${camel.osgi.version.clean}))" >> [$(version;==;$(@)),$(version;+;$(@))) >> >> - org.osgi.framework*;version="[1.5,2)", >> + org.osgi.framework;version="[1.5,2)", >> + org.osgi.framework.wiring;version="[1.0,2)", >> org.springframework.ws.*;version="[2,3)", >> org.springframework.xml.*;version="[2,3)", >> org.springframework.*;version="${spring-version-range}", >> > > -- Christian Schneider http://www.liquid-reality.de Open Source Architect http://www.talend.com