Return-Path: Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: (qmail 84726 invoked from network); 20 Jul 2010 16:11:10 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 20 Jul 2010 16:11:10 -0000 Received: (qmail 69924 invoked by uid 500); 20 Jul 2010 16:11:10 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 69783 invoked by uid 500); 20 Jul 2010 16:11:09 -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 69775 invoked by uid 99); 20 Jul 2010 16:11:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jul 2010 16:11:09 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of justinedelson@gmail.com designates 209.85.212.49 as permitted sender) Received: from [209.85.212.49] (HELO mail-vw0-f49.google.com) (209.85.212.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Jul 2010 16:11:03 +0000 Received: by vws8 with SMTP id 8so5665127vws.22 for ; Tue, 20 Jul 2010 09:09:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:received :in-reply-to:references:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=ANswHyxMJeuHsgRWcYBFBII6wKebCqD7otI87vexrqM=; b=frI6lVZXlZ2VhtvonG0A4b5izHtxZySY1On95mebFtlLR78qwfTGUyLCOKEd3bOjtK cr2xDN6kGuG9vK6sKho87TXU3IAS55483ceqX+eFk+/gLixvuTQUQbyR7JYzbi2EDqaz CGkfVgYtLGPLRlRjTiQsmRjUmpc+Dr4SESnBM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=foK7JcRPekd8BEK8iEuqY18Dz2sdzCAry2+qX9XY8x56/za3UszZ9cGhpcE5QCdIMs 6b0w/ynKbV7yn5xxks6zACxxm2TvNZDPK9R+1FHDhBSQ4yWtsAZHqIWW6mgmeto7e2XD EKrNQL3/7pEd19KH+AGmNtwA5P5qJcas9RXPI= MIME-Version: 1.0 Received: by 10.220.125.106 with SMTP id x42mr3634359vcr.166.1279642181582; Tue, 20 Jul 2010 09:09:41 -0700 (PDT) Sender: justinedelson@gmail.com Received: by 10.220.203.194 with HTTP; Tue, 20 Jul 2010 09:09:41 -0700 (PDT) In-Reply-To: References: Date: Tue, 20 Jul 2010 12:09:41 -0400 X-Google-Sender-Auth: Hrier4p2scMztvaYPAkkM1gzfhE Message-ID: Subject: Re: Missing Constraint: Import-Package From: Justin Edelson To: users@felix.apache.org Content-Type: multipart/alternative; boundary=001636d340b1ac3e71048bd3e94c X-Virus-Checked: Checked by ClamAV on apache.org --001636d340b1ac3e71048bd3e94c Content-Type: text/plain; charset=ISO-8859-1 In this context, the OSGi container is Eclipse/Equinox, so you just need to install the peaberry bundles. The peaberry docs should explain how to do this. The entire concept of a fat or uber jar is anathema to OSGi IMHO. You might also want to look at Tycho which seems closer to your use case. But I don't do Eclipse development, so I can't say more than that. Justin On Tue, Jul 20, 2010 at 11:20 AM, motes motes wrote: > Thanks for clarifying! > > Maybe its appropriate to write a few words on what I am trying to do. > I have made a fairly large offline application which use the eclipse > birt runtime library. I want this application to work as an eclipse > plugin (PDE) which can be installed into eclipse using eg the P2 > updater. Its not meant to run outside eclipse. > > My first approach was to use maven to build a fat jar with the > assembly plugin and then convert this fatjar into a plugin using the > "Plugin from existing jar archieve" from eclipse. Finally this plugin > was added as a dependency in a "pure" eclipse plugin project which > could then be exported using the wizard and installed in eclipse. > > But I would like to skip the step of building the fatjar and manually > converting it into a bundle. Instead I would like to use the > maven-bundle-plugin to do this automatically from maven. > > But as I understand your mail this requires setting up an OSGI > container, loading the necessary bundles and then starting the "main" > bundle. > > I have looked into: > > > http://www.sonatype.com/books/mcookbook/reference/osgi-sect-starting-osgi-container.html > > http://www.sonatype.com/books/mcookbook/reference/sect-osgi-generate-project.html > http://www.ops4j.org/projects/pax/construct/maven-pax-plugin/ > > which shows how to create a maven bundle project and start the Felix > osgi container. But I am a bit confused if this is the right way to go > based on the above described objective (the final application should > be an eclipse only plugin). Any suggestions? > > > > > > > > > On Tue, Jul 20, 2010 at 4:18 PM, Justin Edelson > wrote: > > I answered a similar question a few days ago: > > http://markmail.org/message/e6zor7dgzyf4ykka > > > > In short, you appear to be > > conflating Maven dependencies (expressed in the pom, used at compile/test > > time) with OSGi dependencies (expressed in the manifest, used at > runtime). > > > > In order to use peaberry, you need to deploy the peaberry bundles into > your > > OSGi container. In the peaberry-1.1.1 download, these are: > > aopalliance-1.0.jar > > guice-customloader-20090412.jar > > peaberry-1.1.1.jar > > > > That you are seeing a missing import for an internal class suggests to me > > you're still using Embed-Dependencies, which isn't necessary (or a good > > idea) in this case. > > > > Justin > > > > On Tue, Jul 20, 2010 at 9:32 AM, motes motes > wrote: > > > >> I have now changed my project to depend on: > >> > >> org.ops4j : peaberry : 1.1.1 : jar > >> > >> instead of guice-2.0 which should be the OSGI version of guice. But I > >> still get the error: > >> > >> Missing Constraint: Import-Package: > >> com.google.inject.internal.asm.util; version="0.0.0" > >> > >> when I try to start the bundle from the OSGI commandline. Has anyone > >> had any success using the maven-bundle-plugin with a project that use > >> guice or peaberry? > >> > >> > >> > >> > >> On Tue, Jul 20, 2010 at 2:58 PM, motes motes > wrote: > >> > If I do: > >> > > >> > > !com.google.inject.internal.asm.util,* > >> > > >> > I just get a similar error for another package: > >> > > >> > Missing Constraint: Import-Package: javax.jms; > >> > > >> > so yes its best to track it down I guess. But I thought that > >> > > >> > true > >> > > *;scope=compile|runtime > >> > > >> > would take care of transitive dependencies? > >> > > >> > > >> > > >> > On Tue, Jul 20, 2010 at 2:44 PM, Justin Edelson < > justinedelson@gmail.com> > >> wrote: > >> >> You can suppress this import by adding > >> !com.google.inject.internal.asm.util,* > >> >> > >> >> But this import looks important, so you are probably better off > tracking > >> it down. > >> >> > >> >> Also, isn't there an OSGi-ified version of Guice you can use instead > of > >> embedding it? > >> >> > >> >> On Jul 20, 2010, at 8:34 AM, motes motes > wrote: > >> >> > >> >>> I am trying to build my maven project into a bundle using the > >> >>> maven-bundle-plugin with all its dependencies (it depends on > >> >>> guice-2.0.jar). In my pom file I have: > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> org.apache.felix > >> >>> maven-bundle-plugin > >> >>> 2.1.0 > >> >>> true > >> >>> > >> >>> > >> >>> > >> >>> > >> > ${pom.groupId}.${pom.artifactId} > >> >>> ${pom.name} > >> >>> ${pom.version} > >> >>> > >> com.generator.Activator > >> >>> com.generator > >> >>> true > >> >>> > >> *;scope=compile|runtime > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> After building the project using mvn install I get a jar file with > all > >> >>> the dependencies. I then try to run it through the OSGI console > after > >> >>> installing it but I get the error: > >> >>> > >> >>> osgi> start 15 > >> >>> org.osgi.framework.BundleException: The bundle > >> >>> "com.generator_1.1.1.SNAPSHOT [15]" could not be resolved. Reason: > >> >>> Missing Constraint: Import-Package: > >> >>> com.google.inject.internal.asm.util; version="0.0.0" > >> >>> at > >> > org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolverError(AbstractBundle.java:1317) > >> >>> at > >> > org.eclipse.osgi.framework.internal.core.AbstractBundle.getResolutionFailureException(AbstractBundle.java:1301) > >> >>> at > >> > org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:319) > >> >>> at > >> > org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284) > >> >>> at > >> > org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:276) > >> >>> at > >> > org.eclipse.osgi.framework.internal.core.FrameworkCommandProvider._start(FrameworkCommandProvider.java:252) > >> >>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > >> >>> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown > Source) > >> >>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown > >> Source) > >> >>> at java.lang.reflect.Method.invoke(Unknown Source) > >> >>> at > >> > org.eclipse.osgi.framework.internal.core.FrameworkCommandInterpreter.execute(FrameworkCommandInterpreter.java:155) > >> >>> at > >> > org.eclipse.osgi.framework.internal.core.FrameworkConsole.docommand(FrameworkConsole.java:156) > >> >>> at > >> > org.eclipse.osgi.framework.internal.core.FrameworkConsole.runConsole(FrameworkConsole.java:141) > >> >>> at > >> > org.eclipse.osgi.framework.internal.core.FrameworkConsole.run(FrameworkConsole.java:105) > >> >>> at java.lang.Thread.run(Unknown Source) > >> >>> > >> >>> osgi> > >> >>> > >> >>> The problem seems to be related to the > >> >>> com.google.inject.internal.asm.util package but I have not been able > >> >>> to find that package anywhere (not even in guice-2.0.jar). Any > ideas > >> >>> on how to solve this problem? > >> >>> > >> >>> > --------------------------------------------------------------------- > >> >>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > >> >>> For additional commands, e-mail: users-help@felix.apache.org > >> >>> > >> >> > >> >> --------------------------------------------------------------------- > >> >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > >> >> For additional commands, e-mail: users-help@felix.apache.org > >> >> > >> >> > >> > > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > >> For additional commands, e-mail: users-help@felix.apache.org > >> > >> > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org > For additional commands, e-mail: users-help@felix.apache.org > > --001636d340b1ac3e71048bd3e94c--