osgi

OSGi application design - am I abusing the service framework? [closed]

与世无争的帅哥 提交于 2019-12-05 15:51:05
In an application we're developing I have a common interface for data provider components to implement, and I'm hooking these providers up as services. One of my colleagues suggested it might be better to just create one service that can keep track of these implementations (how many are available currently, and perhaps make them available to other parts of the codebase via getters), and we could register/deregister them using the implementation bundle's activators. While this could generally work, this is (almost) exactly what's provided by the service layer in the first place, and to me, it

Can not start eclipse due to org.eclipse.core.runtime

不羁岁月 提交于 2019-12-05 15:34:24
I copied some plugins into my eclipse installation (specifically Green and ObjectAid from this answer ). I deleted them (since it did not work) but now I can not get eclipse to start (even with eclipse -clean ). I get: !SESSION 2013-02-08 16:21:16.949 ----------------------------------------------- eclipse.buildId=M20110210-1200 java.version=1.6.0_29 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=el_GR Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package

How do I access a file inside an OSGi bundle?

对着背影说爱祢 提交于 2019-12-05 15:27:11
问题 I am new to OSGi and created an OSGi-bundle which I run in the Apache Felix OSGi-container. There is a file resource contained in the bundle, which I need to pass to a method as a java.io.File . To instantiate a File-object, either an URI in the "file"-scheme or the path as string is necessary. How do I retrieve any of those in a clean way? I tried using the context.getBundle().getResource("/myfile") (where context is of type org.osgi.framework.BundleContext ) which returns the URI bundle://6

Component camel-jsonpath gives error after adding to pom file

倖福魔咒の 提交于 2019-12-05 14:12:36
In a clean Camel project I add the following dependency: <dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-jsonpath</artifactId> <version>2.16.1</version> </dependency> When I run the project I get the below error. If I remove that dependency it works. I have tried this on two different projects and the same happens. Anything else that has to be added to the pom for jsonpath to work? It seems to complain for ASM? [INFO] Using org.apache.camel.test.blueprint.Main to initiate a CamelContext [INFO] Starting Camel ... [mel.test.blueprint.Main.main()] Activator INFO Camel activator

Setting start levels & auto-start of Eclipse plug-ins: p2.inf vs product definition

纵然是瞬间 提交于 2019-12-05 14:11:00
I know I can set start levels and auto-start flags for bundles in Eclipse using a p2.inf file or using a product definition file. Doing it in the product file gives me tooling support and puts the settings into my launch configuration. On the other hand, using the p2.inf file allows me to manage start levels on a per-feature basis which give me a nice grouping of start-level settings. Now my questions: What's the preferred way of defining start-levels and auto-start flags? p2.inf seems a bit outdated but is there a way to define start-levels and auto-start flags on a per-feature basis without

WebLogic and OSGi

自古美人都是妖i 提交于 2019-12-05 14:03:30
Is there a way to run an OSGi container in the Weblogic Application Server? I know that it works with JBoss, Glassfish and there are possibilities to add an Equinox servlet bridge to your OSGi project (implementation of the bridge is too old). But I want something similar to JBoss/Glassfish functionality where it is very easy to deploy your OSGi environment, because there are already OSGi implementations. Most of the articels I found were very old and there are no more recent ones. Can someone help with hints or better some links? Maybe Bnd could create a .war file for me, but how can I

<Export-Package> for all resources using maven-bundle-plugin

守給你的承諾、 提交于 2019-12-05 14:00:44
As a temporary measure to be able to transition quickly to OSGi I need to create a single jar with all my libraries in it. What i did was put all the jar libraries in src/main/resources so they end up in the root of the created jar. The problem i am having is telling the maven-bundle-plugin to export ALL the packages in the jars. So basically, i want to expose all my libraries to other OSGi bundles This is the first thing I tried in my POM <build> <plugins> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <extensions>true</extensions> <configuration>

Package uses conflict: Import-Package on startup of a bundle

。_饼干妹妹 提交于 2019-12-05 13:54:39
问题 I am getting the following error when trying to install the htmlunit bundle: com.springsource.com.gargoylesoftware.htmlunit_2.6.0 [370] could not be resolved. Reason: Package uses conflict: Import-Package: org.apache.commons.logging.impl; version="1.1.1" I have followed the diagnostic procedure for this type of problem on this blog. And here are my findings: The bundle com.springsource.com.gargoylesoftware.htmlunit_2.6.0 has the following instructions: Import-Package: \ org.apache.commons

What does the private-package manifest header do?

半城伤御伤魂 提交于 2019-12-05 12:57:27
问题 I am familiar with Import-Package and Export-Package , but this is a new one for me. What does it do? 回答1: At runtime in the OSGi container it does nothing. In fact, it's not even mentioned in the OSGi specification (I checked R4). However, it can be specified in a .bnd file for use by bnd at build time. If so, it can be used to determine what goes into the bundle. When bnd builds a bundle, it automatically determines which classes need to go into the bundle. All the classes in packages that

The default package '.' is not permitted by the Import-Package syntax

拈花ヽ惹草 提交于 2019-12-05 12:30:37
Trying to run @org.junit.Test with Intellij IDEA. It's an OSGi bundle, when hit Run 'testMyTest' Getting following exception: Error:osgi: [b2b-bundle] The default package '.' is not permitted by the Import-Package syntax. This can be caused by compile errors in Eclipse because Eclipse creates valid class files regardless of compile errors. The following package(s) import from the default package null Could someone kindly share light on this exception? Thanks, Peter You probably didn't place your class inside a package. Add package your_package_name; at the top of your .java file and you should