apache-felix

PAX-URL: “Protocol not supported” at Felix's startup

馋奶兔 提交于 2019-12-10 19:55:02
问题 I'm using PAX-URL to launch a Felix based project from Eclipse. I use the assembly protocol to avoid having to pre-pack my bundles. In the project, felix is started using the felix.jar and a config.properties which includes felix.auto.start.1=assembly:foo/bar/classes to start one of my unpacked bundles. The trouble is, felix doesn't know about the pax-url protocols until after it's finished reading that config file, so I get an "Unknown Protocol: assembly" error. What am I doing wrong? Is it

OSGi component configurable via Apache Felix

ぐ巨炮叔叔 提交于 2019-12-10 18:34:37
问题 I'm a complete newb at this so I apologize in advance. I'm trying to create an OSGi component that simply shows a hello world message and is configurable via the input from felix. Then spits it out on a jsp page. I'm using scr annotations to help do this. Here is my java code package com.training.cq5.trainingApp; import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Properties; import org.apache.felix.scr

java.lang.NoClassDefFoundError on OSGi

孤者浪人 提交于 2019-12-10 13:19:10
问题 I have a bundle, with an activator declared. This activator create a JFrame and show it. Running on Eclipse as Plugin project it works fine. When I put on Felix it doesn't work anymore. It shows: java.lang.NoClassDefFoundError: com/griep/ui/MainFrame But MainFrame is located in the same bundle the activator is, as a public class, of course. I don't understand why the classloader isn't finding the class. Anyone knows what is happening? 回答1: Make sure you import the javax.swing package into

How do I register a service in OSGi (Apache Felix)?

浪尽此生 提交于 2019-12-10 10:41:43
问题 I have successfully managed to start Apache Felix from code and register an own Bundle. Following relation between OSGI-projects is needed: [OsgiInterface] -- provides interfaces. [OsgiModuleA] -- (bundle) provides an implementation of those interfaces. knows [OsgiInterface] [OsgiUsage] -- makes use of one or more bundle. knows [OsgiInterface] and [OsgiModuleA] Now I have problems registering a service which implements an interface. I would guess that my entries in manifest.mf files are wrong

How Apache Karaf sorts bundles to install and start?

青春壹個敷衍的年華 提交于 2019-12-10 10:05:18
问题 I have defined four bundles: bundle 1 : export package x version 1 bundle 2 : import package x ver [1,2] and export package y;y uses x bundle 3 : export package x version 2 bundle 4 : import package y and also import package x version 2 Using apache felix (distribuable binary), I found that I should manually impose to not resolve (or start) the bundle 1 and then bundle 2 before starting the bundle 3 (otherwise a uses constraint problem appears because bundle 2 will use package x version 1 and

Looking for basic example of using Apache Felix in dynamic loading of Jar file and instancing a class at runtime in Java

亡梦爱人 提交于 2019-12-09 13:09:41
问题 I tried implementing my own class loader based on some examples. However, I think it is not working as expected ( unable to reload Jar file etc. I see few references of recommending using OSGI or Apache Felix for handling Jar file loading. Is there any examples of loading Jar, instancing a class from the Jar? More details on what I am trying to accomplish..I have a Java command line application that essentially continuously runs. I want it to be able to reference JAR files dynamically at

Apache Felix File Install example

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 16:40:49
问题 Is there any example of how to configure/install Apache Felix File install? In official website, it has been mentioned you need to configure properties etc. But no way they have mentioned where you need to put those configuration properties, how to set it up etc. I have downloaded org.apache.felix.fileinstall-3.2.6.jar file and I have felix framework installed. Now I am not getting where should I put those configuration properties so that file install will read that. Can anyone guide me on

Apache Felix not able to access Postgres JDBC

落爺英雄遲暮 提交于 2019-12-08 09:47:55
问题 I downloaded Postgresql-9.2-1003.jdbc3.jar and put it in felix\bundle directory. My program accesses Postgres table EMP and prints it. I am trying to do it in Felix OSGi server. There are two parts of my program: Part-1 program which simply connects to Postgres JDBC driver and opens the database: package com.myprogram.myemp; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import org.postgresql.Driver; public class

Deploy exploded bundle to Apache Felix using an Eclipse launch task

♀尐吖头ヾ 提交于 2019-12-08 06:49:48
问题 I am looking for a way to (re)deploy an exploded bundle (meaning not jarred but in a folder) to a running Apache Felix OSGi container from within Eclipse, preferably using a launch task. I found this question, which has an answer that comes close but it depends on typing commands into a Gogo shell, which is not convenient for long-term development use. I'd like to use Eclipse's launch task mechanism for this, but if there are alternatives that are equally fast and convenient I am open to that

Karaf Cave vs org.apache.felix.bundlerepository

笑着哭i 提交于 2019-12-07 18:46:32
问题 Good day. I am trying to get the benefits of OBR in my application. I took Karaf Cave (4.0.0) as OBR implementation and org.apache.felix.bundlerepository (2.0.4) as OBR client. I successfully configured the repository itself but I can't properly use it. The problem is: when I install the bundle via OBR and all its dependencies are already installed in OSGI runtime, it is installed successfully. But if some of the requirements are missing, I got an "Unsatisfied requirements" error, which is