osgi

Restlet in OSGI can not find com/sun/net/httpserver/HttpHandler

心不动则不痛 提交于 2020-01-05 02:12:07
问题 I am trying to use Restlet in embedded OSGi environment. I have added the org.restlet.jar version 2.3.0 in the class path of my restlet test bundled. But it kept giving me the following error. java.lang.NoClassDefFoundError: com/sun/net/httpserver/HttpHandler The documentation says that this jar should be enough but it is currently not working. The bundle is started by an Equinox Framework which is started by a standalone launcher, later to be used outside of Eclipse environment. Is there

How to Compose OSGi Based project with C++ based project?

▼魔方 西西 提交于 2020-01-04 06:18:13
问题 I am extending a project that it has been initiated with C++ language. Now I am developing a new part of the project. and it will be based on OSGi (Java). Now I want to know is there any stable method to compose the old project with new part? Is there any steps that can convert C++ objects to OSGi bundles (or with similar structure and metadata)? Or is there any way to have communication between them? 回答1: Although it isn't C++, but plain C, you might check out Apache Celix. Apache Celix is

OSGI bundle dependencies

谁说我不能喝 提交于 2020-01-03 19:43:52
问题 I have created an bundle which relies on SLF4J and as such am using Logback for the OSGI implementation. This all bundles up and installs OK but when I come to start the bundle I get the following exception: org.osgi.framework.BundleException: Unable to resolve com.felix.test [20](R 20.0): missing requirement [com.felix.test [20](R 20.0)] osgi.wiring.package; (osgi.wiring.package=groovy.lang) Unresolved requirements: [[com.felix.test [20](R 20.0)] osgi.wiring.package; (osgi.wiring.package

OSGI bundle dependencies

被刻印的时光 ゝ 提交于 2020-01-03 19:42:10
问题 I have created an bundle which relies on SLF4J and as such am using Logback for the OSGI implementation. This all bundles up and installs OK but when I come to start the bundle I get the following exception: org.osgi.framework.BundleException: Unable to resolve com.felix.test [20](R 20.0): missing requirement [com.felix.test [20](R 20.0)] osgi.wiring.package; (osgi.wiring.package=groovy.lang) Unresolved requirements: [[com.felix.test [20](R 20.0)] osgi.wiring.package; (osgi.wiring.package

OSGi/Felix Declarative Services: How to filter the services to be bound?

依然范特西╮ 提交于 2020-01-03 15:32:17
问题 I am using Apache Felix and its Declarative Services (SCR) to wire the service dependencies between bundles. For example, if I need access to a java.util.Dictionary I can say the following to have SCR provide one: /** * @scr.reference name=properties interface=java.util.Dictionary */ protected void bindProperties(Dictionary d) { } protected void unbindProperties(Dictionary d) { } Now, I have more than one Dictionary service available, and I want to filter them using the "name" service

Loading a ResourceBundle within an OSGi bundle

守給你的承諾、 提交于 2020-01-03 13:40:14
问题 I have an application that uses java.util.ResourceBundle to handle display strings. I use the ListResourceBundle as a base type because I want to be able to return an array of strings for some property keys (most of them are the standard name/value pairing). When I'm trying to load the ResourceBundle in the OSGi environment I get a MissingResourceException. I can't figure out why this would occur. I can resolve the class name and make a new instance of the class in the two statements before I

How do I use an osgi service in a dockable?

杀马特。学长 韩版系。学妹 提交于 2020-01-03 02:51:06
问题 If I have for example a class that is used as a dockable window by annotating it, how am I supposed to use an osgi service in that class? The best would be to have it as a private member field. 回答1: You can eg. use a ServiceTracker: import org.osgi.framework.BundleContext; import org.osgi.framework.FrameworkUtil; import org.osgi.framework.ServiceReference; import org.osgi.util.tracker.ServiceTracker; import org.osgi.util.tracker.ServiceTrackerCustomizer; ... @ViewDocking(...) public class

OSGi: Missing requirement osgi.wiring.package

此生再无相见时 提交于 2020-01-02 20:30:35
问题 I write a project which contains 5 modules. I create them in intellij IDEA with maven, then add "OSGi" framework support to all the modules. I use maven-bundle-plugin to configure the export-package and import-package. But when I run it, there's always a error: org.osgi.framework.BundleException: Unable to resolve org.gxkl.launcher [12] (R 12.0): missing requirement [org.gxkl.launcher [12](R 12.0)] osgi.wiring.package; (osgi.wiring.package=org.gxkl.server). The launcher module contains Bundle

Classloading issue with OSGi

旧时模样 提交于 2020-01-02 15:13:40
问题 I have use log4j-1.2.17 bundle from Maven repo. I try to do this code in the bundle (my bundle calls to the log4j-1.2.17 bundle) PropertyConfigurator.configure(props()); private static Properties props() { Properties props = new Properties(); props.put("log4j.rootLogger", "INFO, R"); props.put("log4j.appender.R", "org.apache.log4j.DailyRollingFileAppender"); props.put("log4j.appender.R.File", "logs/IhtikaClient.log"); props.put("log4j.appender.R.Append", "true"); props.put("log4j.appender.R

List bundle ID's only on servicemix

杀马特。学长 韩版系。学妹 提交于 2020-01-02 12:00:13
问题 I'm using ServiceMix and I was trying to list some bundles and retrieve only there bundle ID. I'm trying to do the following: osgi:list | grep -i | awk xxx I tried to use awk but that's not provided in ServiceMix. I also tried to use shell:exec like this: osgi:list | grep -i | shell:exec awk 'xxx' But that doesn't work either, maybe my approach is completely wrong. Does anybody else have some experience how I could achieve my goal of only retrieving the id's of a bundle? 回答1: You can always