osgi

Having IStartup.earlyStartup() run without BundleActivator.start() being called although the Activator was properly set. Why?

空扰寡人 提交于 2019-12-24 19:12:29
问题 To put it bluntly: is there any explanation for having an Eclipse plugin running its IStartup.earlyStartup() method but not BundleActivator.start() other than having a faulty(or no) Activator set on the Manifest file? I quadruple checked and I'm positive I didn't incorrectly set the Activator in the Manifest, so I'm finding this behavior rather bizarre. When running this plugin as part of a tool we're developing, the Activator is indeed ran although for some reason earlyStartup() doesn't, but

Deploying an osgi bundle (jsp hook) in liferay 7

末鹿安然 提交于 2019-12-24 17:30:01
问题 Created an osgi bundle (jsp hook) in liferay. Using the server tab in Liferay Workspace environment, added the bundle to configured server. Checked the osgi shell with lb -s mytest.hook START LEVEL 20 ID|State |Level|Symbolic name 455|Installed | 1|mystest.hook (1.0.0.201603221133) The state is "Installed". Not sure how to proceed further in terms of the deployment. How will the State change to "Active" ? 回答1: Try the following command: start 455 Probably your bundle does not resolve

ByteBuddy rebasing, synthetic types and OSGi

爱⌒轻易说出口 提交于 2019-12-24 15:04:21
问题 I have the following interceptor developed for byte-buddy: public class SecurityInterceptor() { @RuntimeType public static Object intercept( @SuperCall Callable<Object> supercall, @This Object target, @Origin Method method, @AllArguments Object[] args) { // Check args and annotations ... Object obj = supercall.call(); // Post-process obj content ... } } The interceptor is registered as follows: Unloaded<Object> unloaded = new ByteBuddy() .rebase(type, classFileLocator) .method(ElementMatchers

Declarative OSGi Services

久未见 提交于 2019-12-24 14:18:34
问题 I have a question about declarative OSGi Services. I have the following interface : public interface PrintService { public void print(); } and its implementation: public class PrintServiceImpl implements PrintService { @Override public void print() { System.out.println("Hello from PrintServiceImpl!"); } } OSGI-INF/component.xml : <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="service"> <implementation class="service.PrintServiceImpl"/> <service> <provide interface=

Maven how to aggregate source from project depedencies

℡╲_俬逩灬. 提交于 2019-12-24 14:08:29
问题 I use maven-bundle-plugin to create osgi plugin from non osgi depedency and I want to include the source from this depedency into the projet build. This is an example I create an OSGI bundle from jfreechart and when I publish it I want to include jfreechart sources. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0<

Running JAI in OSGi

荒凉一梦 提交于 2019-12-24 13:30:35
问题 I'm trying to run Java Advanced Imaging (JAI) within an OSGi container (spring-dm). I'm able to access the JAI libraries, but receive the following error when I call JAI for the first time: Error: Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode. Occurs in: com.sun.media.jai.mlib.MediaLibAccessor com.sun.media.jai.mlib.MediaLibLoadException The DLLs are on the classpath and referenced as Bundle-NativeCode libraries in my Manifest. Is it possible to run the

OSGi HTTP Bundle - Bind to two ports

拜拜、爱过 提交于 2019-12-24 13:16:12
问题 I'm using the Apache Felix HTTP Jetty bundle. I can start the servlet container / HttpService and assign it to a port using the system property org.osgi.service.http.port=8080 But I would like to have two such services, bound to two different ports, eg my application API should be served on 8080, but some static web pages should be served on port 80. How can I start the HTTP service a second time on a different port? When registering servlets, how can I know which service is bound to which

OSGi bundle access Spring context file from another bundle

大憨熊 提交于 2019-12-24 10:12:22
问题 I have an existing application that exists as multiple Spring projects. Project A's Spring context XML file improts B's Spring context XML file using <import resource="classpath*:/META-INF/spring/BContext.xml" /> However, it I get a FileNotFoundException . I assume this is caused by the fact that the resource is not exposed by project B's bundle. I can access the classes, but not the file. When researching this issue the common comment was to use OSGi services and inject the services instead

Running multiple versions of a servlet web application parallel

送分小仙女□ 提交于 2019-12-24 07:46:10
问题 I want to run multiple versions (like myapp2.1, myapp2.2 ...) of several Java Servlet based web applications parallel. One possibility could be to deploy each version to a separate servlet context (which should have its own class loader?!). But I think it will be hard to manage and won't be flexible, since an application is a quite large block. What if an application should contain a service in two different versions? Maybe that is not a good idea ... The environment will be GlassFish >= 3.0.

Eclipse 3.4 - external JARs with environment variables

半腔热情 提交于 2019-12-24 07:13:07
问题 I am developing a Plug-in for Lotus Notes (which is Eclipse 3.4) and need to rely on an external SDK/Connector for some Java dependencies and also Configuration files. It seems that in order to function properly, a file from the Connector installation folder has to be in the classpath. Since I don't know where it's installed, I have to rely on an environment variable that is set during installation ("IBMCMROOT"), which contains the folder. Is there any way to use Windows environment variables