osgi

Issue with adding jar in OSGI bundle using <Embed-Dependency>

隐身守侯 提交于 2019-12-11 02:07:27
问题 I'm trying to embed third party libs and application jar in a OSGI bundle.I read the felix maven plugin document and tried using Embed-Dependency . But it doesn't seem to have any effect. Here's my pom <dependencies> &ltdependency> &ltgroupId>com.test</groupId> <artifactId>taxonomymessagebundle</artifactId> <version>1.0</version> <scope>compile</scope> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> <version>2.4</version> <scope>compile</scope>

Using both Blueprint and Spring (Not spring-dm) with OSGi

纵然是瞬间 提交于 2019-12-11 01:58:12
问题 I have a Spring3 application which takes about 3 minutes to load a big domain model on startup... this is fine when the application is deployed to a production environment every once in a while but its a massive pain when making development changes due to the stopping/starting of the application. I've done a bit of investigation and I like the idea of separating my application in modules using OSGi so that I can deploy only the parts of my application which are changing (e.g. No need to

Karaf exception is thrown while installing org.fusesource.leveldbjni

大兔子大兔子 提交于 2019-12-11 01:56:39
问题 Hi i am trying to install the below dependency in karaf <dependency> <groupId>org.fusesource.leveldbjni</groupId> <artifactId>leveldbjni-all</artifactId> <version>1.8</version> </dependency> I am getting the below Exception Exception caught while executing command org.apache.karaf.shell.console.MultiException: Error executing command on bundles: Unable to execute command on bundle 564: The bundle "org.fusesource.leveldbjni.leveldbjni-all_1.8.0 [564]" could not be resolved. Reason: No match

How to use OSGi getServiceReference() right

泄露秘密 提交于 2019-12-11 01:56:07
问题 I am new to OSGi and came across several examples about OSGi services. For example: import org.osgi.framework.*; import org.osgi.service.log.*; public class MyActivator implements BundleActivator { public void start(BundleContext context) throws Exception { ServiceReference logRef = context.getServiceReference(LogService.class.getName()); } } My question is, why do you use getServiceReference(LogService.class.getName()) instead of getServiceReference("LogService") If you use LogService.class

Cannot use PAX-URL's assembly protocol with auto started bundles in Felix config.properties

余生颓废 提交于 2019-12-11 00:50:01
问题 I'm trying to use PAX-URL so I can have non-packed bundles assembled on the fly. If I put pax-url-assembly-1.2.1.jar in the autostart bundles, and then type install assembly:path/to/my/folder everything works. The trouble is, I want to give felix those folders in the config file using > felix.auto.start.1=assembly:path/to/my/folder If I do so, I get an "Unknown protocol: assembly" exception. I've tried loading PAX-URL at level 1 and set the default start level of all other bundles to 10. Won

Unresolved requirement: osgi.component

核能气质少年 提交于 2019-12-11 00:49:59
问题 I'm trying to develop onto Karaf an OSGi WAB containing a REST API and a call from a custom-made service. However, for some weird reason, the OSGi framework complains about an unsatisfied capability, osgi.component . I would like to know : How can I solve this issue? What is osgi.component bundle? Why is needed? Why maven-bundle-plugin (thereby also bnd), declares it inside the entry "Require-Capability"? If I need to install it on the OSGi framework, where may I find it? Some additional

Classloader issues: Exception not caught even if explicitly caught in test

半腔热情 提交于 2019-12-11 00:09:51
问题 This is the test scenario: Plugin A has a utility Class A.xyz() that provides a method that throws a java.util.NoSuchtElementException Plugin B provides "functionality". Fragment F which uses B as host and provides tests for B . Now, my JUnit test looks like this: try { A.xyz(paramTriggeringNoSuchMethodException); fail('A.xyz did not throw NoSuchElementException'); } catch (NoSuchElementException e) { // expected } So, I expect A.xyz() to throw NoSuchElementException and catch this exception

PAX-URL: “Protocol not supported” at Felix's startup

馋奶兔 提交于 2019-12-10 19:55:02
问题 I'm using PAX-URL to launch a Felix based project from Eclipse. I use the assembly protocol to avoid having to pre-pack my bundles. In the project, felix is started using the felix.jar and a config.properties which includes felix.auto.start.1=assembly:foo/bar/classes to start one of my unpacked bundles. The trouble is, felix doesn't know about the pax-url protocols until after it's finished reading that config file, so I get an "Unknown Protocol: assembly" error. What am I doing wrong? Is it

Override Require-Capability in Maven-Bundle-Plugin

被刻印的时光 ゝ 提交于 2019-12-10 19:27:07
问题 My question is similar to this one but I am using the Maven bundle plugin to achieve the same end result. I am building a bundle that contains a persistence.xml file and I have found that the maven-bundle-plugin automatically generates the following headers in the manifest: Require-Capability:osgi.service;effective:=active;objectClass=javax.persistence.spi.PersistenceProvider;javax.persistence.provider=org.apache.openjpa.persistence.PersistenceProviderImpl, Require-Capability: osgi.extender

Extension bundle meaning in OSGi framework

被刻印的时光 ゝ 提交于 2019-12-10 18:54:52
问题 I'm developing an OSGi based application. While documenting myself on the features of the OSGi framework I stumbled on the extension bundle concept. Citing the R4 specification (OSGi R4): Extension bundles can deliver optional parts of the Framework implementation or provide functionality that must reside on the boot class path. These packages cannot be provided by the normal import/export mechanisms. Boot class path extensions are necessary because certain package implementations assume that