I answered a similar question a few days ago:
http://markmail.org/message/e6zor7dgzyf4ykka

<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 <[email protected]> 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 <[email protected]> wrote:
> > If I do:
> >
> >  <Import-Package>!com.google.inject.internal.asm.util,*</Import-Package>
> >
> > 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
> >
> >               <Embed-Transitive>true</Embed-Transitive>
> >              <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
> >
> > would take care of transitive dependencies?
> >
> >
> >
> > On Tue, Jul 20, 2010 at 2:44 PM, Justin Edelson <[email protected]>
> wrote:
> >> You can suppress this import by adding
> <Import-Package>!com.google.inject.internal.asm.util,*</Import-Package>
> >>
> >> 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 <[email protected]> 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:
> >>>
> >>>   <build>
> >>>    <plugins>
> >>>        <plugin>
> >>>            <groupId>org.apache.felix</groupId>
> >>>            <artifactId>maven-bundle-plugin</artifactId>
> >>>            <version>2.1.0</version>
> >>>           <extensions>true</extensions>
> >>>           <configuration>
> >>>              <instructions>
> >>>
> >>>
> <Bundle-SymbolicName>${pom.groupId}.${pom.artifactId}</Bundle-SymbolicName>
> >>>                  <Bundle-Name>${pom.name}</Bundle-Name>
> >>>                  <Bundle-Version>${pom.version}</Bundle-Version>
> >>>
>  <Bundle-Activator>com.generator.Activator</Bundle-Activator>
> >>>                  <Private-Package>com.generator</Private-Package>
> >>>                  <Embed-Transitive>true</Embed-Transitive>
> >>>
>  <Embed-Dependency>*;scope=compile|runtime</Embed-Dependency>
> >>>              </instructions>
> >>>           </configuration>
> >>>        </plugin>
> >>>    </plugins>
> >>>   </build>
> >>>
> >>> 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: [email protected]
> >>> For additional commands, e-mail: [email protected]
> >>>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [email protected]
> >> For additional commands, e-mail: [email protected]
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to