osgi

How to load all the jars from a directory dynamically?

こ雲淡風輕ζ 提交于 2019-12-08 03:18:50
问题 Hi I am creating a plugin which requires loading jars dynamically and accessing the classes and methods of these jars. I tried using URLClassLoader and am able to load the classes as shown below URL myJarFile = new URL("jar","","file:"+jarPath); URLClassLoader sysLoader =(URLClassLoader)ClassLoader.getSystemClassLoader(); Class sysClass = URLClassLoader.class; Method sysMethod = sysClass.getDeclaredMethod("addURL", new Class[]{URL.class}); sysMethod.setAccessible(true); sysMethod.invoke

Is there a Tomcat-like classloader that can be used standalone?

空扰寡人 提交于 2019-12-08 02:53:14
问题 I'm working with a Java sort-of-application-server (Smartfox) which can run multiple applications ("extensions") but has a very inconvenient classpath setup to go along with it, along with issues when trying to use SLF4J. To work around that I'd like to wrap my applications in their own classloaders. Such a containing classloader should be much like Tomcat's, in that it Can load classes from a directory containing JARs. Prefers classes from its own classpath over those from the parent Is

NoClassDefFoundError: org/hamcrest/Matchers using PowerMock-OSGi

天涯浪子 提交于 2019-12-08 02:39:40
问题 I get an NoClassDefFoundError for org.hamcrest.Matchers, when i run my Test as OSGi PlugIn test, but when i run it as plain JUnit test everthing works as expected. I am using the OSGi version of PowerMock and have all neccessary dependencies in my launch config. What i am doing wrong? It seems like the Testrunner doesnt see the class, for some reason. Edit: I created a reduced sample project and figured out that the Problem only appear when i use @PrepareForTest(XXX.class) in my class

Component-based application with scalability in mind: OSGi or Akka?

Deadly 提交于 2019-12-08 00:39:42
问题 For my master thesis I'm developing an application framework for selling tickets for large events. My main requirements are modifiability, scalability and performance. My clients (event organisers) should be able to easily replace a component at runtime and add functionality. An example of such a component could be the seat assignment component. My mentors said to look at OSGi. The idea of loosely coupled bundles is certainly appealing. When looking for alternatives I discovered Akka. This

OSGi Declarative services filter references at runtime

时光总嘲笑我的痴心妄想 提交于 2019-12-07 21:42:59
问题 I've been trying some examples with OSGi Declarative Services (among other things, such as Blueprint) on Karaf. The problem I am trying to solve now, is how to get references to certain services at runtime (so annotations and/or XML are not really an option here) I will explain my use case: I am trying to design (so far only in my head, that's why I am still only experimenting with OSGi :) ) a system to control certain automation processes in industry. To communicate with devices, a special

How to analize/visualize OSGi, maven dependencies

微笑、不失礼 提交于 2019-12-07 21:18:31
问题 I am trying to build Aptana studio using Maven/Tycho. It has a lot of Eclipse plugins and I would like to exclude some of them from the build. However the excluded plugins may be required by other plugins. How to see what plugins are dependent on the current plugin? Is the some tools to visualize dependencies in a directed graph? 回答1: The Plugin Dependencies View which comes with PDE has a button (two-to-one graph) to show plugins depending on the focused plugin. If you want to see the full

Karaf Cave vs org.apache.felix.bundlerepository

笑着哭i 提交于 2019-12-07 18:46:32
问题 Good day. I am trying to get the benefits of OBR in my application. I took Karaf Cave (4.0.0) as OBR implementation and org.apache.felix.bundlerepository (2.0.4) as OBR client. I successfully configured the repository itself but I can't properly use it. The problem is: when I install the bundle via OBR and all its dependencies are already installed in OSGI runtime, it is installed successfully. But if some of the requirements are missing, I got an "Unsatisfied requirements" error, which is

How to integrate Vaadin 7 with OSGi?

百般思念 提交于 2019-12-07 17:58:39
问题 I want to integrate vaadin 7 with osgi but there is no longer any AbstractApplicationServlet class. I've followed the integration using the vaadin bridge by Neil Bartlett https://github.com/njbartlett/VaadinOSGi. I've tried using the VaadinServlet somehow but with no luck. I've also searched for other solutions but found none. Do you have any suggestions? Thanks 回答1: Vaadin 7 has a lot of design changes that are not visible for default use cases, but especially for OSGi integration you have

Bind order of OSGi declarative services

时光总嘲笑我的痴心妄想 提交于 2019-12-07 17:40:46
问题 Assuming I use OSGi Declarative Services and I have a service that have a number references with policy = dynamic... A - Mandatory unary. B - Mandatory unary. C - Mandatory multiple. D - Optional unary. E - Optional multiple. All references are available when my service starts. Is there any way to control what order bind is called in? I'd like to have B bind first and do something to each E that comes in, but I have no way of ensuring that B is bound before E. Yes, the more logical approach

Can't lookup OSGI services through JNDI

会有一股神秘感。 提交于 2019-12-07 16:59:00
问题 I'm working with JBossAS7. My application has some OSGI modules and big non-OSGI part. I tried lookup osgi services in non-osgi subsystem through JNDI but they are not present in JNDI context. I found similar problem at JBOSS 7 - Osgi Bundles not present in JNDI TREE but I dont found any solution there. If JBoss team didn't implement this functionality yet, how can I resolve this problem now? I tried adding my service to JNDI context manually but got an exception because JNDI context is read