apache-felix

Creating a complete OSGi application with Felix & Maven

こ雲淡風輕ζ 提交于 2019-12-03 07:16:36
I have a set of OSGi bundles being built using Maven and I was wondering if there is a Maven plugin available that allows me to do the following: Specify the set of bundles to include in a distribution and/or specify a single bundle and have the dependencies resolved. Build a complete distribution of the framework. What I mean is a single zip file containing all the bundles needed, plus the correct directory structure for felix so that the user can simply unzip the file and type "java -jar bin/felix.jar". I did some Googling and I didn't find anything very promising aside from appassembler.

Problems with maven built OSGi including dependencies

大兔子大兔子 提交于 2019-12-03 06:30:41
I'm currently starting with OSGi, iPOJO and iPOJO Annotations and trying to build a simple component to be deployed in Felix. Unfortunately, I'm stumbling over various problems which take me hours to solve or which I cannot even solve after wasting hours, like the following: I want to use an existing library in my OSGi bundle which we build using Maven. The library is currently not "OSGI-ified" and we are not planning to do so in the medium term. Because of that, I want to include this library and all of its dependencies in the bundle, using …: <Embed-Dependency>*</Embed-Dependency> <Embed

Sharing a configuration file between OSGi bundles in Apache Servicemix 4?

自作多情 提交于 2019-12-03 04:04:36
Has anyone been able to successfully share configuration between two or more bundles in SMX4? What I'm looking for is this: Have a single file in $SMX_HOME/etc/myconfiguration.cfg Have this configuration be "available" to be injected into my bundles via the OSGi Configuration Admin using Spring dm, i.e. <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xmlns:osgix="http://www.springframework.org/schema/osgi-compendium" xmlns:ctx="http://www.springframework.org/schema/context"

Why are uses constraints violated when both chains end in the same bundle?

我们两清 提交于 2019-12-03 03:23:34
问题 I have four bundles, each containing only a manifest. The bundles are app which imports com.example.foo.fragment and com.example.bar foo which exports com.example.foo;uses:=com.example.foo.cfg foo.fragment which is a fragment attached to foo that exports com.example.foo.fragment and com.example.foo.fragment.cfg;uses:=com.example.foo.fragment bar which exports com.example.bar and imports com.example.foo Bundle-level dependency graph : app -> bar | | | v | foo | | v v foo.fragment When I

Dependency Injection in OSGI environments

别来无恙 提交于 2019-12-03 02:37:20
问题 First some background: I'm working on some webapp prototype code based on Apache Sling which is OSGI based and runs on Apache Felix. I'm still relatively new to OSGI even though I think I've grasped most concepts by now. However, what puzzles me is that I haven't been able to find a "full" dependency injection (DI) framework. I've successfully employed rudimentary DI using Declarative Services (DS). But my understanding is that DS are used to reference -- how do I put this? -- OSGI registered

Why are uses constraints violated when both chains end in the same bundle?

馋奶兔 提交于 2019-12-02 16:53:46
I have four bundles, each containing only a manifest. The bundles are app which imports com.example.foo.fragment and com.example.bar foo which exports com.example.foo;uses:=com.example.foo.cfg foo.fragment which is a fragment attached to foo that exports com.example.foo.fragment and com.example.foo.fragment.cfg;uses:=com.example.foo.fragment bar which exports com.example.bar and imports com.example.foo Bundle-level dependency graph : app -> bar | | | v | foo | | v v foo.fragment When I install these bundles all at once in JBoss AS 7.2, they work just fine. But if I install the app bundle after

Dependency Injection in OSGI environments

不羁岁月 提交于 2019-12-02 16:12:47
First some background: I'm working on some webapp prototype code based on Apache Sling which is OSGI based and runs on Apache Felix. I'm still relatively new to OSGI even though I think I've grasped most concepts by now. However, what puzzles me is that I haven't been able to find a "full" dependency injection (DI) framework. I've successfully employed rudimentary DI using Declarative Services (DS). But my understanding is that DS are used to reference -- how do I put this? -- OSGI registered services and components together. And for that it works fine, but I personally use DI frameworks like

How to make Pax logging to use the loggback config instead of the standard log4j properties like syntax

风格不统一 提交于 2019-12-02 08:24:36
I have some services in tomcat and trying to move to apache karaf. I have a existing service which uses logback for logging configuration. I tried to make same configuration in osgi, but could not achieve. Any please let me know what could be the problem? org.ops4j.pax.logging.cfg org.ops4j.pax.logging.logback.config.file=${karaf.home}/etc/logback.xml logback.xml is available at ${karaf.home}/etc/ --. Apache Karaf version : 3.0 , pax logging 1.7.1 which is packaged with karaf from build. After above configuration change, my karaf.log contents are : Jul 02, 2014 4:21:32 PM org.apache.karaf.main

OSGi bundles won't start - Unable to resolve sun.reflect.generics.reflectiveObjects

此生再无相见时 提交于 2019-12-01 22:47:42
After seemingly irrelevant changes in the code of my AEM project, my bundle fails to resolve. Upon inspecting the logs, I can see the following errors appearing. 22.04.2015 11:00:18.650 *ERROR* [qtp1266495948-35] org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Unresolved constraint in bundle my-bundle ... [caused by: Unable to resolve 401.121: missing requirement [401.121] osgi.wiring.package; (osgi.wiring.package=sun.reflect.generics.reflectiveObjects)]] The project compiles just fine locally and the problem only occurs after the bundle's

How do you deserialize an object from bytes in osgi

拜拜、爱过 提交于 2019-12-01 03:29:37
In my osgi application I have three bundles, travel.api , table.api and utils . travel.api depends on table.api which depends on utils . Note that travel.api doesn't directly depend on utils . I use aQute Bnd to generate the manifests and I believe it is working fine. The manifests are displayed below. There is a class called PageData that has a field of type TableData , which in turn has a field of type TestObject . PageData is located in travel.api , TableData is located in table.api and TestObject is located in utils . This all works fine when the bundles are loaded. The problem comes when