Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EDE369D09 for ; Wed, 11 Jan 2012 10:56:26 +0000 (UTC) Received: (qmail 17837 invoked by uid 500); 11 Jan 2012 10:56:25 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 16966 invoked by uid 500); 11 Jan 2012 10:56:07 -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 16939 invoked by uid 99); 11 Jan 2012 10:55:58 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jan 2012 10:55:58 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of pierre.derop@gmail.com designates 209.85.216.49 as permitted sender) Received: from [209.85.216.49] (HELO mail-qw0-f49.google.com) (209.85.216.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jan 2012 10:55:49 +0000 Received: by qadc14 with SMTP id c14so557350qad.1 for ; Wed, 11 Jan 2012 02:55:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=/j0cB918PR1nlll2tKRMjQiYVe410Rz0/MXTOrE1AFc=; b=dN7iDSMd3xHNHYWw6qR2x5vhl5TN908nMQpBHuNFD6o36vHJasJxP2eCjVXijjHEi3 0Qc1RoLxxAU237YRmgyrohZdtoEMN/6re/5oUNsteb/slSX52WNOpOUYn7NHw3pf1I+I VR3FZK2AK4JsphyPo3DoNRhGLO2uv3M33wa/s= MIME-Version: 1.0 Received: by 10.224.31.148 with SMTP id y20mr29152375qac.80.1326279328907; Wed, 11 Jan 2012 02:55:28 -0800 (PST) Received: by 10.229.135.195 with HTTP; Wed, 11 Jan 2012 02:55:28 -0800 (PST) In-Reply-To: References: Date: Wed, 11 Jan 2012 11:55:28 +0100 Message-ID: Subject: Re: Felix DependencyManager with annotation/eclipse From: Pierre De Rop To: users@felix.apache.org Content-Type: multipart/alternative; boundary=20cf3074b36445c14a04b63e7893 X-Virus-Checked: Checked by ClamAV on apache.org --20cf3074b36445c14a04b63e7893 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello Mohica; Regarding your second question, if I understand correctly, you are trying to use an osgi bnd directive file from maven, right ? Since the DM annotation API also contains a native bnd plugin, then it is indeed possible to do this, and I think that the root cause of the NoClassDefFoundError is that you don't have added a dependency over the DM annotation plugin inside the maven-bundle-plugin, and when bnd tries to load the DM plugin (thanks to the -plugin option), then it does not find it because the dependency over org.apache.felix.dependencymanager.annotation bundle is missing within the maven-bundle-plugin. I have tried the following which works fine for me (I don't use a separate osgi.bnd file but I rather declare the "_plugin" option in the maven-bundle-plugin pom xml element, but I think it's similar to that you are doing). Notice that: - I use "_plugin" option from the maven-bundle-plugin instead of "-plugin" bnd directive. - And since the DM annotation bnd plugin is invoked directly using the _plugin option, then it is not needed anymore to declare the DM maven bundle plugin, which is useless in this case. Here it is: org.apache.maven.plugins maven-compiler-plugin 1.5 1.5 org.apache.felix maven-bundle-plugin 2.3.4 true Apache Felix Dependency Manager Annotation Sample org.apache.felix.dependencymanager.samples.annotation<= /Bundle-SymbolicName> org.apache.felix.service.command;status=3Dprovisional,* org.apache.felix.dm.samples.annotation <_plugin>org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin;log=3Dd= ebug ${pom.groupId} org.apache.felix.dependencymanager.annotation 3.0.0 Regarding your first question, I will get back to you later (tomorrow if possible). Hope this helps; BR /Pierre On Tue, Jan 10, 2012 at 9:47 PM, Mohica Jasha wrote= : > Hi, > > 1. I am trying to control the dependencies of a bundle using felix > annotations as explained here: > > http://felix.apache.org/site/apache-felix-dependency-manager-using-annota= tions-quick-start.html > If I build the jar file out of the example and through it into felix > launcher, it works perfectly, However I would like to debug the bundle > within eclipse, and I cannot launch the bundle. > > I tried so many ways but no luck. Any idea how I can debug the bundle > within eclipse? > > 2. I slightly changed the pom file to include the osgi.bnd file and the > "-plugin > org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin;log=3Dwarn" li= ne > in the bnd file causes the following compilation error when I build the > project/package using maven: > > [WARNING] Warning building bundle > mypackage:mypackage.dm.testan2:bundle:1.0-SNAPSHOT : Instructions in > Private-Package, or -testpackages that are never used: > mypackage\.dm\.testan\.testan > Classpath: > > Jar:.,Jar:osgi_R4_core,Jar:osgi_R4_compendium,Jar:org.apache.felix.depend= encymanager.annotation,Jar:org.osgi.core,Jar:bndlib,Jar:maven-project,Jar:m= aven-settings,Jar:maven-model,Jar:plexus-utils,Jar:plexus-container-default= ,Jar:junit,Jar:classworlds,Jar:maven-profile,Jar:maven-artifact-manager,Jar= :maven-repository-metadata,Jar:maven-artifact,Jar:wagon-provider-api,Jar:ma= ven-plugin-registry,Jar:maven-plugin-api,Jar:json,Jar:.,Jar:org.apache.feli= x.dependencymanager.annotation-3.0.0 > > [WARNING] Warning building bundle > mypackage:mypackage.dm.testan2:bundle:1.0-SNAPSHOT : No sub JAR or > directory org.apache.felix.dependencymanager.annotation-3.0.0.jar > [ERROR] Error building bundle > mypackage:mypackage.dm.testan2:bundle:1.0-SNAPSHOT : Problem loading the > plugin: org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin > exception: (java.lang.NoClassDefFoundError: > org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin not found, > parent: org.codehaus.classworlds.RealmClassLoader@585976c2 urls:[] > exception:java.lang.ClassNotFoundException: > org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin) > [ERROR] Error(s) found in bundle configuration > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] Error(s) found in bundle configuration > > Thanks, > Mohica > --20cf3074b36445c14a04b63e7893--