osgi

OSGi: programmatically add imports to a bundle

坚强是说给别人听的谎言 提交于 2019-12-11 04:42:49
问题 How can I add packages to a bundle's import from within code? I need it since I use libraries which rely on reflection and require other packages and I don't want to need to manually add those packages to MANIFEST.MF for each bundle I develop 回答1: You cannot. Import-Packages are evaluated in the Resolution phase. (Phases are Installed -> Resolved -> Active ). Your code is executed when the bundle is Active, therefore too late to add Import-Packages. You can do 2 things: Import-Package the

Use Spring AOP in OSGi bundle

 ̄綄美尐妖づ 提交于 2019-12-11 04:19:09
问题 I am trying to use the Spring AOP for logging purposes. I have set up the logging bundle, and the OSGi service in it. I have other OSGi bundle which uses the service from logging bundle as a OSGi reference. The logging bundle is deployed into Apache Karaf and running. I can not get my other bundle deployed. The spring configuration in my bundle is like that: <osgi:reference id="loggingIterceptor" interface="com.groupgti.commons.log.LoggingInterceptorAdvice"/> <aop:config> <aop:pointcut id=

Classloader Issues with Envers in OSGi

若如初见. 提交于 2019-12-11 04:14:54
问题 I've successfully started Hibernate in an OSGi context, and now I want to add Envers. The documentation claims that's possible. I don't believe it anymore. There is no documentation of any kind for this subject and nobody seems to have actually done it. Moreover even with a Blueprint implementation I had to hack the classloader to make Hibernate even find Envers: osgiClassLoader = new org.hibernate.osgi.OsgiClassLoader(); osgiClassLoader.addBundle(requestingBundle); osgiClassLoader.addBundle

Error implementing a OSGI REST: `OSGi bundle not started : missing requirement`

三世轮回 提交于 2019-12-11 04:13:50
问题 I'm trying to code a OSGI REST bundle with bndtools. I added all the jars that I need in the cnf project. Then I added them to the bundle build path. I get the following runtime exception OSGi bundle not started : missing requirement osgi.wiring.package (&(osgi.wiring.package=javax.ws.rs)(version =2.0.0)( (version =3.0.0))) I don't understand the error because I use javax.ws.rs-api 2.0.1. I tried to specify the version explicitly in the buildpath like this -buildpath: \ javax.ws.rs-api

Apache POI, Excel 2007+ XML, and OSGI

喜欢而已 提交于 2019-12-11 03:42:27
问题 For a project I'm trying to get Excel XML functionality using Apache POI to work with OSGI. I've tried the POI ServiceMix bundle, but this was missing the ooxml-schemas jar. Adding the jar to the bundle and including it in the manifest didn't seem to work. Then I tried to creating wrapper bundles for POI 3.10, but also to no avail. Same error. Caused by: java.lang.ClassNotFoundException: org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl not found by org.apache.poi [8] at org.apache.felix

OSGI bundle exception, maven dependency issue

时光总嘲笑我的痴心妄想 提交于 2019-12-11 03:09:07
问题 I'm pretty new to the OSGI, Felix and Maven stuffs, just started with it. I'm deploying the java build through jenkins and I get the below dependency issue. Below is the pom file contents which includes the dependency, I'm not sure whether it is correct, but it still complains about it. It is looking for "javax.jws" and the version is between 2.0 and 3.0 javax.jws;version>="2.0.0",!javax.jws;version>="3.0.0" Below is the pom contents. <Import-Package>!sun.misc,!org.apache.avalon.framework

JavaFx: second application throws Not on FX application thread

微笑、不失礼 提交于 2019-12-11 02:49:10
问题 I have and osgi based application. The loading process is the following: start.sh runs not osgi loader.jar which starts felix and installs and starts bundles. By other words start.sh->loader.jar->osgi+bundles. I want to show loading process in loader.jar via javafx and I use there Application.launch(Gui.class). Everything is ok. The problem appears when in osgi bundle main program is started (also via Application.launch) and I get : Caused by: java.lang.IllegalStateException: Application

JNDI lookup from OSGI equinox bundle deployed on tomcat (bridged mode)

倾然丶 夕夏残阳落幕 提交于 2019-12-11 02:41:27
问题 I have my datasource configured in tomcat\context.xml. I have deployed a bridge.war provided by Eclipse to get servletbridge environment. I have developed another osgi bundle which contains servlet registation code and my aim is to do JNDI look up for datasource from this servlet bundle. However I get javax.naming.NoInitialContextException:Cannot instantiate class: org.apache.naming.java.javaURLContextFactory (root cause classnotfound for org.apache.naming.java.javaURLContextFactory) when I

Install ActiveMq in Apache Karaf 4.0.0.M2

泄露秘密 提交于 2019-12-11 02:39:15
问题 I'm trying to Install ActiveMQ in Karaf 4.0.0M2. But it always fails with an error. Please see console below. Please help me to resolve this problem. karaf@root()> feature:install jms karaf@root()> feature:repo-add activemq Adding feature url mvn:org.apache.activemq/activemq-karaf/LATEST/xml/features karaf@root()> feature:install activemq-broker Error executing command: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=activemq-web-console ; type=karaf.feature;

How to embed external jars dependency in OSGI bundles?

大城市里の小女人 提交于 2019-12-11 02:14:33
问题 I am trying to convert my project into an OSGI application. I have few doubts. Suppose ModuleA in my application is dependent on external jars jarA and jarB. Now to make ModeuleA run, I am embedding both the jars using embed-dependency property of maven-bundle-plugin. Now suppose I have another module ModuleB which is also dependent on jarA. So this module also embeds the jarA. My project ends up having jarA being embedded 2 times which will unnecessarily bloat the size of project. Is there