osgi

How to setup an Eclipse Project with multiple Subprojects (OSGi-Bundles)

痞子三分冷 提交于 2019-12-01 16:24:28
Sherlog is an OSGi-based log analyzer, if I import this project as an workspace snapshot I receive lot's of projects in my workspace, but I would prefere to have them as subprojects in a project. The other option would be to checkout from svn, but then I face other problems (I don't know how to setup the dependencies for automatically build) Does anyone have an idea or good links on this topic? Thanks Thorbjørn Ravn Andersen EDIT: For Eclipse 4.5 and newer please see https://stackoverflow.com/a/34134833/53897 Eclipse does not support subprojects. The Eclipse way of life is one or more projects

How to include a dependency to a jar file from an eclipse/osgi application?

柔情痞子 提交于 2019-12-01 16:01:44
I created an Eclipse 4 application and I needed a jar offering a functionality as part of my application (this could be anything e.g. log4j to make it trivial). I added the jar as part of my project's classpath ( Right Click->Configure Build Path ) but on runtime my service failed with a ClassNotFound error (from OSGI I guess?). Anyway searching this it turned out, at least as I have understand it, that I should add the jar as part of another Plugin and create a dependency from my application/service to this new plugin. I.e. I created a Plugin Project from Existing JAR archives . This time the

Consuming Services from Embedded OSGi Framework

孤街浪徒 提交于 2019-12-01 14:38:30
I have embeddable Felix. I have some API bundle and Impl. API exports interface C .Impl imports that interface and register impl in activator. Now I want get C impl otside OSGi FrameworkFactory ff = new FrameworkFactory(); ... BundleContext bc = fwk.getBundleContext(); ... final ServiceReference[] serviceReferences = bc.getServiceReferences(C.class.getName(), "(objectclass=" + C.class.getName() + ")"); for(ServiceReference serviceReference : serviceReferences){ final Object service = bc.getService(serviceReference); ... } Now I want to interact with it. I can do it with reflection System.out

Jpa-hibernate error while starting the service

北城余情 提交于 2019-12-01 13:12:51
Below is the error from the log that i see after starting the service... can you help resolving this issue. 2013-08-22 10:35:37,111 | DEBUG | l Console Thread | AbstractServiceReferenceRecipe | r.AbstractServiceReferenceRecipe 143 | 7 - org.apache.aries.blueprint.core - 1.1.0 | Found initial references null for OSGi service (&(&(org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=tenant))(objectClass=javax.persistence.EntityManagerFactory)) 2013-08-22 10:35:37,111 | DEBUG | l Console Thread | BlueprintContainerImpl | container.BlueprintContainerImpl 280 | 7 - org.apache.aries.blueprint

[插件化开发] 1. 初识OSGI

点点圈 提交于 2019-12-01 10:01:02
初识 OSGI 背景 当前product是以solution的方式进行售卖,但是随着公司业务规模的快速夸张,随之而来的是新客户的产品开发,老客户的产品维护,升级以及修改bug,团队的效能明显下降,为了解决此类问题,必须站在公司战略的统一高度来重构系统。 荣幸的是,本人在此时加入团队并负责系统架构的升级与重构工作。因为公司在全世界都有客户,而且客户又来自于各行各业,带来的问题就是如何抽离公共业务的同时,又能不影响客户的定制化需求开发?产品团队专注于系统的核心逻辑开发,而一些定制化需求交付给global team 去开发? 选型 技术没有银弹,目前没有完全确定要使用OSGI的方式来实现,因为本人之前使用Spring Cloud & Spring Cloud Alibaba各实现了一种demo, 当然也可以实现我们的服务化,高可用以及动态扩展。但是在解决插件定制化这块,相对来说还是不太熟悉,然后OSGI进入眼帘了。 OSGI 简介 OSGI 是 O pen S ervice G ateway I nitiative(开发服务网关协议)。 指维护OSGI规范的官方联盟 OSGi Alliance是一个由Sun Microsystems、IBM、爱立信等于1999年3月成立的开放的标准化组织,最初名为Connected Alliance。 官方联盟维护的基于JAVA语言的服务规范

How do I “install” a log4j bundle?

时光毁灭记忆、已成空白 提交于 2019-12-01 09:16:43
问题 I've downloaded the code for an Eclipse plugin. The code uses log4j, but it doesn't just use it as a library (referred jar), but as a "bundle". So it doesn't compile because of the following reason: Bundle 'org.apache.log4j' cannot be resolved I'm not really sure what's the correct approach to solve this. I know how to add jars to a project, but how do I add "bundles"? Is it something I need to add to the entire Eclipse host? I "solved" this by creating a new plugin project with no code but

Spring : PropertyPlaceholderConfigurer cannot find property file

╄→гoц情女王★ 提交于 2019-12-01 09:11:53
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 project). I have tried almost every combination ("jdbc.properties", "/jdbc.properties", "classpath:jdbc

Karaf - Kafka OSGI bundle - Producer issue

谁说我不能喝 提交于 2019-12-01 08:15:01
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.serialization.StringSerializer"); props.put("partitioner.class","org.apache.kafka.clients.producer.internals

How to get a resource in another jar

余生长醉 提交于 2019-12-01 08:09:23
I have a jar embedded in a bundle that needs to fetch a resource packaged with it like so: MyBundle -\ src -\lib -\MyEmbeddedJar -\src -\SomeClass -\someResource.xml I am trying to access 'someResource.xml' from 'SomeClass' like so: SomeClass.class.getResource( "someResource.xml" ); But I've had no luck. I've tried several variations with the CWD appended (eg: './someResource.xml') but I just can't get this resource to load. I know that the "right" way is to use Activator to get hooks back to the proper classloader, but the embedded jar can be used in other projects, so I'd hate to have to add

XPathFactoryImpl not found error (using myBatis)

大兔子大兔子 提交于 2019-12-01 07:38:05
Using myBatis standAlone (Atlassian jira plugin(OSGi) environmnent) The following error has occurred. [INFO] [talledLocalContainer] org.apache.ibatis.exceptions.PersistenceException: [INFO] [talledLocalContainer] ### Error building SqlSession. [INFO] [talledLocalContainer] ### Cause: java.lang.RuntimeException: XPathFactory#newInstance() failed to create an XPathFactory for the default o bject model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: java. util.ServiceConfigurationError: javax.xml.xpath