following on osgi bundle dependencies
i have reverted maven-bundle-plugin using defaults. here current pom:
<?xml version="1.0" encoding="utf-8"?> <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.felix.test</groupid> <artifactid>com.felix.test</artifactid> <version>1.0-snapshot</version> <packaging>bundle</packaging> <dependencies> <dependency> <groupid>org.apache.felix</groupid> <artifactid>org.osgi.core</artifactid> <version>1.0.0</version> <scope>provided</scope> </dependency> <dependency> <groupid>javax.servlet</groupid> <artifactid>servlet-api</artifactid> <version>2.5</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.apache.felix</groupid> <artifactid>org.apache.felix.scr.annotations</artifactid> <version>1.9.6</version> <scope>provided</scope> </dependency> <dependency> <groupid>org.apache.httpcomponents</groupid> <artifactid>httpclient-osgi</artifactid> <version>4.5</version> <scope>provided</scope> </dependency> <dependency> <groupid>net.sf.ehcache</groupid> <artifactid>ehcache</artifactid> <version>2.10.0</version> </dependency> <dependency> <groupid>org.apache.commons</groupid> <artifactid>commons-lang3</artifactid> <version>3.4</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-dependency-plugin</artifactid> <version>2.8</version> <dependencies> <dependency> <groupid>org.apache.felix</groupid> <artifactid>maven-bundle-plugin</artifactid> <version>2.5.4</version> <type>maven-plugin</type> </dependency> </dependencies> </plugin> <plugin> <groupid>org.apache.felix</groupid> <artifactid>maven-bundle-plugin</artifactid> <version>2.5.4</version> <extensions>true</extensions> <configuration> <instructions> </instructions> </configuration> </plugin> </plugins> </build> </project> everything bundles , installs ok. when try start bundle i'm told i'm missing net.sf.ehcache install. i'm missing slf4j.api install. i'm missing slf4j.impl , have tried installing pretty every slf4j.impl possibility https://jpm4j.org/#!/ (slf4j-simple-1.7.12.jar, slf4j-log4j12-1.7.12.jar) report back:
org.osgi.framework.bundleexception: fragment bundles can not started.
this current error gogo:
org.osgi.framework.bundleexception: unable resolve com.felix.test [16](r 16.0): missing requirement [com.felix.test [16](r 16.0)] osgi.wiring.package; (&(osgi.wiring.package=net.sf.ehcache)(version>=2.10.0)(!(version>=3.0.0))) [caused by: unable resolve net.sf.ehcache [17](r 17.0): missing requirement [net.sf.ehcache [17](r 17.0)] osgi.wiring.package; (&(osgi.wiring.package=org.slf4j)(version>=1.7.0)(!(version>=2.0.0))) [caused by: unable resolve slf4j.api [23](r 23.0): missing requirement [slf4j.api [23](r 23.0)] osgi.wiring.package; (&(osgi.wiring.package=org.slf4j.impl)(version>=1.6.0))]] unresolved requirements: [[com.felix.test [16](r 16.0)] osgi.wiring.package; (&(osgi.wiring.package=net.sf.ehcache)(version>=2.10.0)(!(version>=3.0.0)))]
hopefully i'm getting closer...
thank you!
you have 2 errors address. first "fragment bundles cannot started". error message tells need know. slf4j implementation bundles fragments, , cannot start fragments. don't start them!
you haven't specified how running osgi framework, somewhere must have code iterates on installed bundles , calls start() method on each. need modify code not call start() on bundles fragments. can tell if bundle fragment follows:
(bundle.adapt(bundlerevision.class).gettypes() | bundlerevision.type_fragment) > 0; or:
bundle.getheaders().get(constants.fragment_host) != null; the second error says bundle named com.felix.test has dependency on package net.sf.ehcache. have never heard of com.felix.test... bundle building? use ehcache in code? if so, need install ehcache bundle. if have ehcache installed, might wrong version; bundle requires version 2.10.0 excluding 3.0.0.
Comments
Post a Comment