osgi

OSGi got FrameworkFactory could not be instantiated Error

孤街浪徒 提交于 2019-11-29 18:17:51
I am trying to use OSGi and maven to develop an standard alone application. I have the following osgi dependency in pom.xml <dependency> <groupId>org.osgi</groupId> <artifactId>org.osgi.core</artifactId> <version>6.0.0</version> </dependency> I tried the following code import org.osgi.framework.launch.FrameworkFactory; FrameworkFactory frameworkFactory = ServiceLoader.load(FrameworkFactory.class).iterator().next(); and got this error message Exception in thread "main" java.util.ServiceConfigurationError: org.osgi.framework.launch.FrameworkFactory: Provider org.osgi.framework.launch

How to bootstrap weld-osgi version 2 in SE application

你离开我真会死。 提交于 2019-11-29 16:10:26
It's really not funny. There is no information in internet how to run weld-osgi second version (2.1.2.final) in se app. Instructions for ver 1 don't work. Let the developers be ashamed that they didn't provide necessary samples. I wrote them here . So, I have and OSGi activator and I want to get beans from it. In GF4 I used this: private BeanManager getBeanManager() throws NamingException { try{ InitialContext initialContext = new InitialContext(); return (BeanManager) initialContext.lookup("java:comp/BeanManager"); } catch (NamingException e) { System.out.println("Couldn't get BeanManager

How can an Android Activity use a Knopflerfish OSGi Bundle installed on the device

。_饼干妹妹 提交于 2019-11-29 15:36:34
问题 I have installed Knopflerfish on an Android emulator using this tutorial: http://www.knopflerfish.org/releases/current/docs/android_dalvik_tutorial.html The installation on the emulator is ok, and now I would like to call an OSGi bundle running on the emulator from my Android Activity. But I just can't find any way to do this. Is there somebody who has already done such a thing? 回答1: Have you seen this? http://nilvec.com/embedding-osgi-into-an-android-application-part-1.html The patches I

How to handle Import-Package entries which come from jars on the Bundle-Classpath?

岁酱吖の 提交于 2019-11-29 15:01:22
I have put a few jars on my Bundle-Classpath. The line below shows the entry in my pom.xml, which uses the Felix plugin to create the manigest.mf for the bundle. <Bundle-ClassPath>.,lib/com.springsource.org.h2-1.0.71.jar,lib/com.springsource.org.apache.lucene-2.3.2.jar,lib/com.springsource.org.apache.lucene.search-2.3.2.jar</Bundle-ClassPath> These jars have classes which import packages, but from what I can see, they all have a MANIFEST.MF, which has it's own (accurate) list of Import-Package statements. However, when I build my project (using Maven and the bundle plugin), it reports an error

How to convert old “plugin.xml” to new “manifest.mf” file?

纵然是瞬间 提交于 2019-11-29 12:48:11
How to convert plugin.xml file to manifest.mf file as some tags like: <runtime> <library name="aaa.jar"> <export name="*"/> </library> <runtime> are seems to be ignored. Here is some correspondence in the next document, but far from complete reference. http://www.eclipse.org/eclipse/platform-core/runtime/adoption.html Open the file in the plugin.xml editor. On the Overview Tab>Plug-in Content section there should be a link, " ..., create an OSGi manifest " The OSGi manifest is a set of headers describing the bundle, the bundles or packages that are dependencies, and the packages this bundle

How does OSGi manage interaction of components running in separate JVMs?

坚强是说给别人听的谎言 提交于 2019-11-29 12:17:08
问题 I have been trying to understand a bit more about the wider picture of OSGi without reading thru the entire specification. As with so many things, the introduction to what OSGi actually is was probably written by someone who had been working on it for a decade and perhaps wasn't best placed to put themselves in the mindset of someone who knows nothing about it :-) Looking at Felix's example DictionaryService , I don't really understand what is going on. Is OSGi a distinct instance of a JVM

使用eclipse开发felix的OSGI插件

别来无恙 提交于 2019-11-29 11:59:05
1、官网下载 http://felix.apache.org/downloads.cgi , 当前最新版本6.0.3 运行felix窗口有两种方式 (1) 可以直接下载发布版本 Felix Framework Distribution( org.apache.felix.main.distribution-6.0.3.zip ) 解压后目录 进入项目目录,命令行下执行 java -jar ./bin/felix.jar felix.jar 默认会在当前运行目录的 bundle 文件夹内加载启动所需的插件jar,config 目录下的 config.propeties 和 system.properties 里面加载环境变量,如果将其他目录作为启动根目录,该目录下不存在 felix 启动所需信息,启动就会有问题。项目第一次启动的时候会在启动目录下创建一个felix-cache的目录,用于存放框架运行过程产生的数据,当然该目录可以在启动的时候配置,使用 java -jar ./bin/felix.jar <felix-dir> 即可。 (2) 源码导入eclipse运行 下载子项目 Main ( org.apache.felix.main-6.0.3-project.zip ) 解压org.apache.felix.main-6.0.3-project.zip,进入目录,命令行下

Starting Wicket web application with OSGi HTTP Service

余生长醉 提交于 2019-11-29 11:53:49
I'm trying to start a Wicket Application using Felix implementation of OSGi HTTP service, for that I just register the service using WicketServlet with applicationClassName parameter: props.put("applicationClassName", MainApplication.class.getName()); service = (HttpService)context.getService(httpReference); service.registerServlet("/", new WicketServlet(), props, null); I have also tried using Felix Whiteboard implementation and registering the web service as a Servlet one: props.put("alias", "/"); props.put("init.applicationClassName", MainApplication.class.getName()); registration = context

Log4j under OSGI (Eclipse RCP)

旧巷老猫 提交于 2019-11-29 09:06:02
问题 After many tests i concluded that the Log4j is not working under OSGI. I do not use Log4j directly, but i need third party plugins to log with it. I made a plain JAVA project and everything works great, but under PLUGIN development nothing works. I have log4j jar in my Classpath and even tried a Spring repository OSGI compliant Log4j and included it under Dependencies. Nothing works. I've tried this some approach with no success: http://swik.net/Eclipse/Planet+Eclipse/Raja+Kannappan:+Eclipse

get Android permission dynamically

夙愿已清 提交于 2019-11-29 07:27:33
I'm wondering if it's possible to get Android permission dynamically without using AndroidManifest just with some codes, because I've some OSGi bundles running on Android and without Android permission they are restricted in functionality. Thanks for your answers, yes it complicates the user experience and it's also dangerous for the user if that mechanism is provided No this is not possible. You can't alter the contents of an already installed APK. It would be very dangerous to allow such a behavior anyway as the whole permissions system is meant to allow the user to first read what