felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Angelo van der Sijpt <angelo.vandersi...@luminis.eu>
Subject Re: BundleException: Unresolved constraint in bundle (package=org.apache.commons.lang)
Date Sat, 07 May 2011 15:32:31 GMT
Your bundle correctly imports org.apache.commons.lang, hoping that someone else exports it.
You can basically do two things now,
- make sure someone exports it, by packaging commons-lang in a bundle, and exporting the packages
from it (there might be one out there), or
- embed the classes you need in your bundle by adding <Embed-Dependency>*;scope=compile</Embed-Dependency>
to your bundle plugin instructions.

In your case, the latter is probably the easiest thing to do, even if this means you have
multiple bundles using classes from commons-lang.

Angelo


On May 7, 2011, at 5:02 PM, Bahadir Konu wrote:

> Hi everybody,
> 
> I am new to Felix. I tried to read mail archive messages and documentation
> but still I couldnt solve the problem and I m losing time.
> 
> I have a bundle created by maven bundle plugin. I put that jar to
> FELIX_HOME/bundle
> When I run felix, I get his error:
> 
> ERROR: Bundle DynamicCalculator [5] Error starting
> file:/C:/tools/felix-framework-3.2.1/bundle/service-1.0.jar
> (org.osgi.framework.BundleException: Unresolved constraint in bundle
> DynamicCalculator [5]: Unable to resolve 5.0: missing requirement [5.0]
> package;
> (&(package=org.apache.commons.lang)(version>=2.5.0)(!(version>=3.0.0))))
> 
> My POM is:
> 
>    <modelVersion>4.0.0</modelVersion>
>    <groupId>com.bkonu.calculator</groupId>
>    <artifactId>service</artifactId>
>    <version>1.0</version>
>    <packaging>bundle</packaging>
> 
>    <dependencies>
>        <dependency>
>            <groupId>commons-lang</groupId>
>            <artifactId>commons-lang</artifactId>
>            <version>2.5</version>
>        </dependency>
>        <dependency>
>            <groupId>org.apache.felix</groupId>
>            <artifactId>org.apache.felix.framework</artifactId>
>            <version>2.0.0</version>
>        </dependency>
> 
>    </dependencies>
> 
>    <build>
>        <plugins>
>            <plugin>
>                <groupId>org.apache.maven.plugins</groupId>
>                <artifactId>maven-compiler-plugin</artifactId>
>                <version>2.0.2</version>
>                <configuration>
>                    <source>1.6</source>
>                    <target>1.6</target>
>                </configuration>
>            </plugin>
> 
>            <plugin>
>                <groupId>org.apache.felix</groupId>
>                <artifactId>maven-bundle-plugin</artifactId>
>                <extensions>true</extensions>
>                <configuration>
>                    <instructions>
> 
> <Bundle-SymbolicName>DynamicCalculatorService</Bundle-SymbolicName>
>                        <Import-Package>*</Import-Package>
> 
> <Export-Package>com.bkonu.calculator.service</Export-Package>
> 
> <Bundle-Activator>com.bkonu.calculator.ExpressionEvaluatorActivator</Bundle-Activator>
> 
>                    </instructions>
>                </configuration>
>            </plugin>
>        </plugins>
>    </build>
> 
> In the error message we see: (version>=2.5.0)(!(version>=3.0.0)   What s the
> meaning of this?
> 
> The manifest file in the jar is:
> 
> Manifest-Version: 1.0
> Export-Package: com.bkonu.calculator.service;uses:="org.apache.commons
> .lang"
> Tool: Bnd-1.15.0
> Bundle-Name: Unnamed - com.bkonu.calculator:service:bundle:1.0
> Created-By: Apache Maven Bundle Plugin
> Build-Jdk: 1.6.0_22
> Bundle-Version: 1.0.0
> Bnd-LastModified: 1304778448213
> Bundle-ManifestVersion: 2
> Bundle-Activator: com.bkonu.calculator.ExpressionEvaluatorActivator
> Bundle-License: http://www.apache.org/licenses/LICENSE-2.0
> Bundle-SymbolicName: DynamicCalculatorService
> Import-Package: com.bkonu.calculator.service,org.apache.commons.lang;v
> ersion="[2.5,3)",org.osgi.framework;version="[1.5,2)"
> 
> Should I change felix's config.properties? (Doesn't sound very logical for a
> maven dependency like apache.commons.lang)
> 
> Can anybody help please?
> 
> Thanks,
> Bahadır Konu


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Mime
View raw message