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