osgi

How do I attach the sources for a library bundle in OSGi/Equinox/Eclipse?

和自甴很熟 提交于 2019-12-01 06:57:31
I created a library bundle for commons-lang3 and this works well. I can build the bundle, add a dependency and then use all the classes in this bundle in my plugins. But I don't see the sources in the debugger. What is the simplest way to create a source bundle for this library bundle? PS: A library bundle is a plugin which contains the original JAR file; Eclipse doesn't compile the source again, it just adds the existing JAR to the classpath. If you add the source files to their own jar then create a META-INF/MANIFEST.MF file with an 'Eclipse-SourceBundle' entry which specifies the symbolic

Karaf - Kafka OSGI bundle - Producer issue

夙愿已清 提交于 2019-12-01 06:50:29
问题 I am trying to create a simple bundle for Kafka producer in apache Karaf version 4.0.3 . Here is my Java code Properties props = new Properties(); props.put("bootstrap.servers", "localhost:9092"); props.put("acks", "all"); props.put("retries", 0); props.put("batch.size", 16384); props.put("linger.ms", 1); props.put("buffer.memory", 33554432); //props.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); //props.put("value.serializer", "org.apache.kafka.common

Find the dependent bundles in Eclipse at runtime

最后都变了- 提交于 2019-12-01 06:36:17
How can an Eclipse bundle (eg. within activator code) find the dependent Bundle instances at runtime? I would like to find the bundles that Eclipse has choosen to satisfy the dependency requirements, I do not want to interprete the manifest myself. An example: I would like to find all resources named "marker.txt" in all bundles on which my current bundle depends upon. Also the transitive dependencies. In order to accomplish this I need to be able to find all these bundles to begin with. There is no easy way to determine the dependency. The best way is to go through the PackageAdmin interface.

How to work with a bundle in eclipse when it was downloaded from AEM

耗尽温柔 提交于 2019-12-01 06:25:24
I downloaded a zip from a running instance of AEM from package manager - http://localhost:4502/crx/packmgr/index.jsp . The zip file, when extracted contains, jcr_root and META-INF . I would like to build some functionality on top of this zip file. So I'm wondering if there is a way to work with this file in eclipse? However, there are no pom.xml files in this zip folder. So I can't just import it in Eclipse. I have AEM developer tools downloaded for Eclipse. Is there a guide available that explains how to do this? The zip file contains some Java files and I would like to make changes to those

Spring : PropertyPlaceholderConfigurer cannot find property file

淺唱寂寞╮ 提交于 2019-12-01 06:22:07
问题 I have a strange problem with Spring using PropertyPlaceholderConfigurer . One of my beans is designed as follow : <bean name="propertyPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <value>classpath:jdbc.properties</value> </property> </bean> The problem is that spring never find jdbc.properties ( FileNotFoundException ). The file is in a folder named "resources" that is in the bundle classpath (I am working in a OSGi

Best way to load dynamically routes in Apache Camel

眉间皱痕 提交于 2019-12-01 06:15:29
we have developped application based on Karaf and Apache Camel. While our application is entirely based on bundles ( OSGI ) we are also loading the Camel context ( and its' Route Contexts ) on startup, whcih would mean that we have defined some static routes. My question is. Is there a way to dynamically LOAD routes while the application is running without the need to reread the Camel Context as this will reset/restart the already existing routes. The same would apply to already created routes, for example if we want to edit a route whcih already exist. The whole idea is that we are planning

How to work with a bundle in eclipse when it was downloaded from AEM

隐身守侯 提交于 2019-12-01 05:23:49
问题 I downloaded a zip from a running instance of AEM from package manager - http://localhost:4502/crx/packmgr/index.jsp . The zip file, when extracted contains, jcr_root and META-INF . I would like to build some functionality on top of this zip file. So I'm wondering if there is a way to work with this file in eclipse? However, there are no pom.xml files in this zip folder. So I can't just import it in Eclipse. I have AEM developer tools downloaded for Eclipse. Is there a guide available that

How do I attach the sources for a library bundle in OSGi/Equinox/Eclipse?

[亡魂溺海] 提交于 2019-12-01 05:12:04
问题 I created a library bundle for commons-lang3 and this works well. I can build the bundle, add a dependency and then use all the classes in this bundle in my plugins. But I don't see the sources in the debugger. What is the simplest way to create a source bundle for this library bundle? PS: A library bundle is a plugin which contains the original JAR file; Eclipse doesn't compile the source again, it just adds the existing JAR to the classpath. 回答1: If you add the source files to their own jar

Lazy activation of Eclipse plugins

与世无争的帅哥 提交于 2019-12-01 04:44:37
I would like to know what is "Activate this plug-in when one of its classes is loaded" check-box in Eclipse manifest editor useful for. I thought Eclipse always use "lazy initialization" approach. Does have this option a relation to the BundleActivator class of the plugin? is initialization something different to activation? Here is a similar question, but I don't understand it entirely. Ticking the box causes the following header to be set in the manifest: Bundle-ActivationPolicy: lazy I'll start with how "pure" OSGi deals with this. IF the bundle is started with the START_ACTIVATION_POLICY

How to add Import-Package instructions for runtime dependencies?

僤鯓⒐⒋嵵緔 提交于 2019-12-01 04:36:25
I'm building an OSGi jar using Gradle, and I'm having a bit of trouble with the manifest. Here's an excerpt from my build script: apply plugin: 'java' apply plugin: 'osgi' jar { baseName = 'awesome' manifest { name = 'An Awesome Application' symbolicName = 'com.example.awesome' // instruction 'Import-Package', 'org.springframework.orm' } } Using the above, Gradle detects my dependencies and adds an Import-Package with all my compile-time dependencies. But say my application has a runtime dependency on org.springframework.orm as well, how do I tell Gradle to include that as an argument in