osgi

What is the difference between “Import-Bundle” and “Require-Bundle”?

戏子无情 提交于 2019-12-03 10:59:06
What is the difference between spring source dm server specific Import-Bundle and OSGi's Require-Bundle ? I am confused whether to use Import-Bundle or Require-Bundle in my project. Import-Bundle is similar to Require-Bundle, it creates a complete dependency on the other bundle, including that bundle's dependencies. This transitivity is bad because you have no idea what you depend, creating the infamous " big ball of mud " problem we're so familiar with in Object oriented programming. In OO, we've found a solution to this entanglement by using interfaces, they separate implementation from

Access resources in another osgi bundle?

自作多情 提交于 2019-12-03 10:58:34
I have created two OSGI bundles A and B using the eclipse Plug-in project wizard (using eclipse Helios). In the manifest file of bundle B I have added bundle A as a dependency. Further I have exported the packages in A so they are visible for B. I also have a .properties file in bundle A that I would like to make visible for bundle B. In the build.properties pane in bundle A I have specified: source.. = src/ bin.includes = META-INF/,\ .,\ bundle_A.properties Now in bundle B I try to load the .properties file using: private Properties loadProperties() { Properties properties = new Properties();

Play framework and OSGI

有些话、适合烂在心里 提交于 2019-12-03 10:54:11
Is it possible to integrate play framework with OSGI to create plugable components? Did someone try it? If you mean "create Play modules with OSGi", then no, it's not supported If you mean "deploy Play as an OSGi module" then no, it's not supported And to be fair, there's no reason to push its support. You can read these thoughts from Spring founder on OSGi, as an example. OSGi would add extra complexity to Play, while the main aim of Play is to be a rapid development platform, simple to use, removing some Java conventions (like Sessions). It would kind of defeat the purpose. spume If we're

OSGI runtime inside traditional Java EE server

夙愿已清 提交于 2019-12-03 10:53:42
I understand it should probably be other way round (OSGI runtime hosting Java EE servers), as it is apparently already possible with glassfish. However, our clients have extensive experience in administering traditional Java EE servers and significant investment (licenses, training etc.) Our architecture would benefit from OSGI modular architecture, but I can not ask our clients to switch from Java EE servers to OSGI runtimes. Is there a way to install OSGI runtime as war or ear inside traditional Java EE servers, even if they will use no container-managed resources (for example thread or

What's the difference between features in Karaf and OBR

有些话、适合烂在心里 提交于 2019-12-03 10:32:24
I am looking into ways to deploy and update an OSGI (Karaf, specifically) application. It seems that there are several options. One is to use The OSGi Bundle Repository (OBR), another is to use Features in Karaf, and the third is to use Karaf Cave . I'm not really sure how these options are really different. They all seem to be doing the same things. Are they just different implementations of the same functionality? Could someone please explain the differences or provide some recommendations? Karaf features and OBR are different ways of solving the (sort of) same problem. Both allow you to

OSGI framework hangs when loading native library

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Situation: Open source OSGI framework SMILA (http://www.eclipse.org/smila/) started as Windows Service with the aid of Apache commons-daemon (http://commons.apache.org/daemon/). Trying to load a DLL via System.loadLibrary() from OSGI bundle while Manifest.mf includes Bundle-NativeCode: path/to/dll . Environment: Windows Server 2003, Java 1.6 Error: During the invocation of System.loadLibrary() the complete Java process hangs. When the service is stopped System.loadLibrary() finish and code execution goes on until the OSGI framework shut down

Prioritizing OSGi service selection within a container when more than one implementation exist

送分小仙女□ 提交于 2019-12-03 10:18:19
I am playing with OSGi and have a few bundles. Bundle A and B both contain a registered service which implements a single interface. The third bundle C includes code to lookup a service implementing the previously mentioned interface. The A and B bundles have different version numbers, however it appears that C picks up the service from the first started bundle. I have changed the start level to do the right thing, but version is only used to accept rather than order which service is returned. A version 1.0 start level 1 B version 1.1 start level 2 C requires both bundles, start level 3 In the

OSGi + Hibernate

微笑、不失礼 提交于 2019-12-03 09:48:03
问题 Instead of having database actions scattered in four (osgi) bundles, all doing there slightly different things. I want to create a (simple) OSGi bundle that is responsible for all persistance issues. I feel that this is not as simple as it sounds because of the "unique classloader per bundle" thing. So what I really would appreciate is if someone knows the solution(s) to this kind of problem. 回答1: (If you are using Hibernate Annotations) Save all the Entities class loaders when the Hibernate

How to stop an OSGI Application from command line

匿名 (未验证) 提交于 2019-12-03 08:46:08
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I do have a running osgi (equinox container) application. It will been started via a bash script. See felix gogo shell java -jar ... _osgi.jar -console 1234 & This all works pretty well and I also can stop it via telnet localhost 1234 <osgi>stop 0 But what I am looking for is how can I embed this into a bash script to stop the osgi application. I already tried this echo stop 0 | telnet localhost 1234 but this doesn't work. So if someone has idea how to put this in a bash script, please let me know. 回答1: Telneting into the Gogo shell seems

Error while using jersey-client in osgi - No generator was provided

匿名 (未验证) 提交于 2019-12-03 08:36:05
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I get the following exception when I try to create a WebTarget from a Jersey client. My code Client client = ClientBuilder.newClient(); WebTarget baseTarget = client.target("http://127.0.0.1:9000"); Exception stack trace java.lang.IllegalStateException: No generator was provided and there is no default generator registered at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.internalCreate(ServiceLocatorFactoryImpl.java:266) at org.glassfish.hk2.internal.ServiceLocatorFactoryImpl.create(ServiceLocatorFactoryImpl.java:247) at org.glassfish