osgi

How could I get BundleContext in Spring DM?

馋奶兔 提交于 2019-12-23 09:48:05
问题 I am newly on Spring DM and I would like to access Bundlecontext. My problem is that I have a bundle with Activator, but it does not have xml config file. I cannot touch this bundle, then I need to access to BundleContext and serviceReference to obtain the service in my bundle. I am using Spring DM in my bundle. So, how could I get BundleContext? Thanks! Regards! 回答1: One way is to implement BundleContextAware and the other one, if you don't want to rely on DM and its mechanisms:

How to modularize an Enterprise Application with OSGi and EE6?

跟風遠走 提交于 2019-12-23 09:38:03
问题 I know that there are already some questions related to this topic but I couldn't find a real solution yet. Currently I am developing applications with EE6, using JPA, CDI, JSF. I would like to take a more modular approach than packaging everything into a WAR or EAR and deploy the whole thing on an Application Server. I am trying to design my applications as modular as possible by separating a module into 3 maven projects: API - Contains the interfaces for (stateless) services Model -

Disabling Cache in Apache Felix

你离开我真会死。 提交于 2019-12-23 09:37:27
问题 i'm trying to follow the instructions in this thread (http://osdir.com/ml/dev-felix-apache/2009-05/msg00051.html) to disable file system bundle cache in felix. I couldn not find a concrete example online. Can somebody help me with this? Is this really working? Thanks in advance. Klaus. 回答1: It is not possible to disable the bundle cache, it is required by the framework. You can configure it to be cleaned each startup (org.osgi.framework.storage.clean) or you can try to use the approach

Is it possible to do bytecode manipulation when using OSGi?

我怕爱的太早我们不能终老 提交于 2019-12-23 07:37:09
问题 I'm making an application server and in it I need to use some bytecode manipulation (e.g. inserting custom equals and hashCode methods to classes annotated with @Entity ). Now I give the JVM a Java Agent (the -javaagent option) which does bytecode transformations using ASM. I've been considering using OSGi, but I don't know whether it allows me to do the necessary bytecode manipulation. Is it possible to do bytecode manipulation when using OSGi? How? Is it possible for a bundle to declare

Apache Felix File Install jar from deploy folder

送分小仙女□ 提交于 2019-12-23 04:53:40
问题 I am trying to use Apache Felix File Install with an embedded version of Felix. The basic idea is simple, I have a jar application file that can be launched using standard java -jar app.jar and the application will startup Apache Felix framework and then look in a hot deploy folder installing, updating and removing the OSGi bundles that are in/placed/updated/removed from that folder at runtime. I currently have managed to create the ability to startup the embedded Felix and I can deploy

Download Java EE API JARs as OSGI bundles

强颜欢笑 提交于 2019-12-23 04:05:16
问题 Is there a place where I can download Java EE API JARs as OSGi bundles? 回答1: I don't know of anywhere where you can do that, but you can wrap the jars and deploy them as bundles with the wrap scheme. So the command that you would want to use to pull them from maven and wrap them as bundles would be osgi:install -s wrap:mvn:javax/javaee-api/6.0 . 回答2: Apache Geronimo produces API jars for the Java EE packages and they are all (at least all the ones I've used) OSGi bundles. They are all

Using Service Component Runtime

落花浮王杯 提交于 2019-12-23 01:51:34
问题 I goal is to remove dependencies on OSGi from my bundles. I use felix (v 4.2.1) as impl and run it embeddable. I install org.apache.felix.scr (v. 1.6.2) bundle to have Service Component Runtime support. But when I run ServiceReference ref = bundleContext().getServiceReference(ScrService.class.getName()); ScrService s = (ScrService) bundleContext().getService(ref); I get ClassCastException: org.apache.felix.scr.impl.ComponentRegistry cannot be cast to org.apache.felix.scr.ScrService . Okay. I

Dependency management in OSGI bundle ServiceMix

风格不统一 提交于 2019-12-23 01:28:30
问题 Hi I am new to ServiceMix, so probably I am asking same question which might be answered but I couldn't figure out. My doubt is how do I manage compile time vs runtime dependencies when using bundle in ServiceMix OSGI. That is if I am building a .jar workable(by unit tests aleast) artifact with maven where all compile time dependencies say example(camel,spring) are handled by pom.xml dependencies and are loaded into jar as needed libs for successful build. So when I am deploying the jar in

How to run Vaadin 7 applications in Karaf?

岁酱吖の 提交于 2019-12-22 18:29:24
问题 I have been looking for days now, with lots of experiments, for an answer to this question. What do I need to do to be able to run applications, using version 7 of Vaadin Web framework, inside Karaf? There are some information about it but none of the solutions I read worked. The only related question I found on SO (How to integrate Vaadin 7 with OSGi?) does not really have an valid answer, at least for my question. Every time I follow a solution found by googling I always get lots of missing

How to upgrade groovy-all from 2.4 to 2.5 when running in OSGi?

烂漫一生 提交于 2019-12-22 18:03:04
问题 I'm maintaining an open source library based partly on Groovy called Rest Assured. In the next version I'd like to upgrade the Groovy dependency from 2.4.x to 2.5.x. However when doing this I run into issues when running the OSGi tests. The tests are using Pax Exam they typically look something like this: @RunWith(PaxExam.class) public class XmlPathOSGiITest { @Configuration public static Option[] configure() { return new Option[] { mavenBundle("org.apache.servicemix.bundles", "org.apache