Return-Path: Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: (qmail 18282 invoked from network); 2 Apr 2010 13:44:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Apr 2010 13:44:18 -0000 Received: (qmail 46570 invoked by uid 500); 2 Apr 2010 12:44:17 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 46518 invoked by uid 500); 2 Apr 2010 12:44:16 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 46510 invoked by uid 99); 2 Apr 2010 12:44:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Apr 2010 12:44:16 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of heavy@ungoverned.org designates 67.222.54.6 as permitted sender) Received: from [67.222.54.6] (HELO outbound-mail-313.bluehost.com) (67.222.54.6) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 02 Apr 2010 12:44:09 +0000 Received: (qmail 28793 invoked by uid 0); 2 Apr 2010 12:43:47 -0000 Received: from unknown (HELO host118.hostmonster.com) (74.220.207.118) by cpoproxy3.bluehost.com with SMTP; 2 Apr 2010 12:43:47 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=ungoverned.org; h=Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-Identified-User; b=OIv5KzPm+TeeNiV6LblDfnQO/lJl5/H/ufMArFSDogR1cTfO7IXyBUvW4Cjw4V1ugDoROs9rn49cmGkVSu5RKM8z6r14gs2m2I/aSwIEB7cK1BCUcozRt2pCgOAkRTVI; Received: from [99.62.222.230] (helo=heavyweight.glastender.com) by host118.hostmonster.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1NxgDy-00088V-VI for users@felix.apache.org; Fri, 02 Apr 2010 06:43:47 -0600 Message-ID: <4BB5E682.3090206@ungoverned.org> Date: Fri, 02 Apr 2010 08:43:46 -0400 From: "Richard S. Hall" User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b1 Thunderbird/3.0.4 MIME-Version: 1.0 To: users@felix.apache.org Subject: Re: Weird bugs with tutorial/maven References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Identified-User: {1027:host118.hostmonster.com:ungovern:ungoverned.org} {sentby:smtp auth 99.62.222.230 authed with heavy@ungoverned.org} X-Virus-Checked: Checked by ClamAV on apache.org On 4/2/10 5:35, Nicolas Delsaux wrote: > Hi all, i'm currently playing with Felix tutorial. > By use, I do it with maven projects; Tht's to say that, as an example, > I've made the translation service a maven module in my project, and > created the pom file accordingly. > As a consequence, my pom looks like this : > > > > jypsy > com.mycompany > 0.0.1-SNAPSHOT > > 4.0.0 > com.mycompany.pss > translation-english > bundle > translation-english > 0.0.1-SNAPSHOT > http://maven.apache.org > > > org.apache.felix > org.osgi.core > > > > > > org.apache.felix > maven-bundle-plugin > true > > > com.mycompany.translation.api.* > com.mycompany.translation.english.* > com.mycompany.translation.Activator > > > > > > > > As one may guess, i have a superpom which eases me the task of > declaring attributes of my manifest, using the following template : > > > org.apache.felix > maven-bundle-plugin > 1.4.0 > true > > > ${pom.groupId}.${pom.artifactId} > ${pom.name} > ${pom.version} > > > > > > But there is something I don't understand : the generated manifest has > a set of import package that *precisely* contains my package classes : > > Manifest-Version: 1.0 > Export-Package: com.mycompany.translation.api > Private-Package: com.mycompany.translation.english > Built-By: ndx > Tool: Bnd-0.0.238 > Bundle-Name: translation-english > Created-By: Apache Maven Bundle Plugin > Bundle-Vendor: mycompany > Build-Jdk: 1.6.0_16 > Bundle-Version: 0.0.1.SNAPSHOT > Bnd-LastModified: 1270200175640 > Bundle-ManifestVersion: 2 > Bundle-Activator: com.mycompany.translation.Activator > Bundle-Description: A project > Import-Package: com.mycompany.translation,com.mycompany.translatio > n.api > Bundle-SymbolicName: com.mycompany.translation-english > Bundle-DocURL: http://www.perdu.com > > And, as a consequence, when dropping that bundle in Felix, I get an exception : > > ERROR: Error starting > file:/C:/java-ext/felix-framework-2.0.4/bundle/translation-english-0.0.1-SNAPSHOT.jar > (org.osgi.fr > amework.BundleException: Unresolved constraint in bundle > com.mycompany.translation-english [7]: package; (package=com. > mycompany.translation)) > org.osgi.framework.BundleException: Unresolved constraint in bundle > com.mycompany.translation-english [7]: package; (p > ackage=com.mycompany.translation)-> > > Here I can see the generated Import-Package clause is wrong. > So, what can I do to avoid/correct that ? > Looking this info, it appears that your bundle makes reference to package com.mycompany.translation (via its activator) but does not contain this package, thus you get a resolve exception when you try to start it. Looking at your POM above, you do not include this package in Private-Package or Export-Package, so it cannot be inside your bundle. So, I think the import is correct since your bundle is not packaged properly. In short, you need to add this package to your bundle if you don't want to import it. -> richard > Thanks > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org For additional commands, e-mail: users-help@felix.apache.org