FAQ Database Discussion Community


Use OpenStack4j in an OSGi platform

osgi,openstack
I want to use OpenStack4j in an OSGi platform. Specifically I'm using Apache Karaf OSGi runtime (based on Apache Felix OSGi implementation). Issue arises when OpenStack4j tries to discovers Connectors. Based on Getting started official documentation guide, I'm trying to instantiate a v2.0 client with this line: OSClient os =...

Getting ClassNotFound for PaxExam Option class when running test

java,osgi,classpath,pax-exam
When running unit tests with PaxExam I'm getting this ClassNotFoundException: java.lang.ClassNotFoundException: org.ops4j.pax.exam.Option at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:513) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:429) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:417) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at...

How to obtain Felix Framework's properties in the config.properties file?

java,properties,osgi,apache-felix,osgi-bundle
I have this line of code that returns me null and it should return 9193 which is the value that the property really has in my config.properties file... System.getProperty("org.osgi.service.http.port") // returns null dunno why My config.properties has the property correctly set up: org.osgi.service.http.port=9193 Probably I am missing something here, because...

How to consume ManagedServiceFactory services

java,osgi
I have a class that implements ManagedServiceFactory like this: public class GreeterFactory implements ManagedServiceFactory { private volatile BundleContext bundleContext = FrameworkUtil.getBundle(GreeterFactory.class).getBundleContext(); private final Map<String, ServiceRegistration> registrations = new ConcurrentHashMap<>(); @Override public String getName() { return "Greeter Factory Implementation"; } /** * Greeter Service Factory * @param pid this is the...

Best way to handle dynamic OSGi service dependencies

java,osgi,declarative-services
I have a optional service dependency that looks something like this: @Component class TestComponent { private AtomicReference<TestService> testServiceRef; @Reference(type = '?') protected void setTestService(TestService testService) { testServiceRef.set(testService); } protected void unsetTestService(TestService testService) { testServiceRef.set(null); } public void doStuff() { TestService testService = testServiceRef.get(); if (testService != null) testService.performSomeTask(); } }...

Loading Resource in a OSGi Bundle from a different Bundle

osgi
I have two OSGi bundles A and B. Both are created with the API/implementation model. Both the bundles are activated through Blueprint mechanism. Both the API bundles export the interfaces whereas the implementation bundles don't export anything. Only A has dependency on B. My issue is, I want to pass...

How can i call service from another in OSGI

service,osgi,bundle
I started developping an OSGI bundle base application. I created a bundle A that consumes service from bundle B, wich in its turn must consume service from bundle C. But i dont see how get a service inside the code of another. The servicetracker needs the bundlecontext and i don't...

Can I deploy a fab bundle on any OSGI-compliant container/application server?

osgi,web-deployment,fuseesb,jbossfuse
I am currently trying to deploy my camel app as a FAB bundle in the Fuse ESB container. I understand that I can install Fab(Fabric-bundle) as a feature on OSGI containers like Karaf or felix and deploy the bundle. I want to know if this feature is available on all...

Pack ServletContainerInitializers from different bundles to a single OSGi bundle

maven,tomcat,osgi,maven-bundle-plugin
I'm creating an OSGi bundle which consist of following dependencies <artifactId>tomcat-dbcp</artifactId> <artifactId>tomcat-embed-core</artifactId> <artifactId>tomcat-embed-jasper</artifactId> <artifactId>tomcat-embed-websocket</artifactId> <artifactId>tomcat-jasper</artifactId> <artifactId>ecj</artifactId> I want to pack the SCIs in both websocket and jasper. My IncludeResource section is as follows <Include-Resource> {maven-resources},...

Force Imports in Apache Karaf

osgi,apache-karaf
I have bundle that deals mostly with interfaces and it uses a factory from a thrid party jar to get the instances for the interfaces it is using. For example, my-bundle.jar has... com.oth.itf.Intrface itf = Fctry.getInstance('ABC'); has the imports-package for com.oth.itf third-party.jar has.. public static com.oth.itf.Intrface getInstance(String abc) { if...

Eclipse/OSGi: How to control the file-name created via an exported plugin (jar)

java,eclipse,eclipse-plugin,osgi
Trying to control the name of the file created via Export when exported an OSGi plugin from Eclipse. This is specifically by selecting the plug-in the Project Explorer, then selecting the menus: 'Export | Deployable plugins and fragments'. The options seem limited or almost non existent. For example, if I...

How can I install postgresqljdbc to work in Karaf OSGi?

osgi,karaf
I want to install org.postgresql/postgresql/9.4-1201-jdbc41 in Karaf but I get errors. How can I resolve these errors? Strangely on Windows my Karaf doesn't have errors with this Postgres jdbc but on Ubuntu it has these errors. Any clues appreciated. Install Kar feature social_importer.kar/1.0-SNAPSHOT java.lang.Exception: Could not start bundle mvn:org.postgresql/postgresql/9.4-1201-jdbc41 in...

OSGi Bundle getting Loaded through another bundle

osgi,fuse
I am having an issue where one of my bundles is getting loaded through another bundle even when the two don't have any direct dependency on each other. Here's the scenario. I have 3 bundles. Bundle A, B & C. The process flow is A->B->C. Hence there is no dependency...

How can I use Equinox Weaving with bndtools

osgi,aspectj,equinox,load-time-weaving,bndtools
How can I use equinox Weaving with bndtools because the equinox Weaving example is old and can't get it to work? update: when trying to run the weaving sample for Hello world I have two bundles: public class HelloService implements BundleActivator { public void start(final BundleContext context) throws Exception {...

How to use dependent bundles in different container in Fabri8?

osgi,jboss6.x,jbossfuse,karaf,fabric8
I am trying to understand the capabilities of Fabric8's container management. I just want to clarify weather the following scenario can be achieved by using Fabric8 in JBossFuse. I have created simple 2 bundles (tick, tock bundles inspired by the : http://kevinboone.net/osgitest.html). Simply Tick bundle is exporting a package and...

how to use maven bundle plugin to exclude package out of bundle

osgi,pom.xml,exclude,maven-bundle-plugin
i have a bundle that uses maven-jaxb2-plugin to generate all classes to target/generated/src/main/java. Then i use maven bundle plugin to create a bundle. It simply works. Now, i want to exclude (remove) a generated package com.xxx.yyyy.common out of this bundle. So i use: <Export-Package> !com.xxx.yyyy.common,com.xxx.* </Export-Package> But after having a...

Camel 2.10 change blueprint.xml location

java,osgi,apache-camel,blueprint
Is there an way to change the blueprint.xml file location? In my application, camel look for this on classpath and "OSGI-INF\blueprint" folder, but I want to point its reference to another file outside this folder (just like a second blueprint.xml option). I've tried the "fileApplicationContextUri" option on camel-maven-plugin plugin inside...

OSGi: service binding without lifecycle management

service,osgi,components,declarative-services
I am building a Java application on the Equinox OSGi framework and I have been using DS (declarative services) to declare referenced and provided services. So far all the service consumers I have implemented happened to be service providers as well, so it was natural for me to make them...

What is correct path for creation of micro services in Java? Spring Boot or OSGI

spring,osgi,spring-boot,spring-dm
I found a book "Spring DM in action". When I started to check the latest release of Spring for OSGI, I found out that Spring has discontinued this project. As I have some experience of developing in Spring, I would like to understand should I continue to read about Spring...

how to send email on contact form submit button click..?

adobe,osgi,cq5,aem
I create component with default component using FormComponent now on submit button click I want to send an email to recently submitted user, I configure SMTP for mail server on : http://localhost:4502/system/console/configMgr Now I'm stuck how to send email, can someone help me to figure out what I'm missing here....

Third party OSGi library dependency conflict

eclipse-plugin,osgi
In our Eclipse based product we're introducing a new third party plugin that depends on ANTLR v3.2+. We have an existing plugin, also third party (openarchitectureware), that requires ANTLR v3.0. The problem is that the openarchitectureware plugins don't specify a dependency version range: Require-Bundle: org.openarchitectureware.core.workflow,org.apache.comm ons.logging, org.antlr.runtime,org.apache.log4j;resolution:=optional This means they...

Do I need to create seperate OSGi bundles for each jar

maven,log4j,osgi,log4j2,osgi-bundle
I want to create an OSGi bundle for log4j2. I need to use some additional jars along with log4j2 such as log4j2-jcl, log4j2-jul, log4j2-web etc. I want to clarify some confusions listed below about this. However this is not specific to log4j2 I'm asking this as a general procedure. Do...

Can we use java 8 features in plugins on equinox from Eclipse 3.7.2?

java,eclipse,osgi,osgi-bundle
I am developing some plugins for equinox from Eclipse version 3.7.2. Unfortunatelly I cannot upgrade to the latest equinox platform. The provided equinox platform does not provides "Require-Capability: osgi.ee; filter="(&(osgi.ee=JavaSE)(version=1.8))" entry in its manifest. So I cannot use "Bundle-RequiredExecutionEnvironment: JavaSE-1.8" in my plugins. According to the answer Java 8 &...

how to activate LDAPLoginModule in Apache Karaf 3.0.3

login,ldap,osgi,jaas,karaf
I want to active Ldap Login Module in apache karaf 3.0.3. My karaf-jaas-module.xml is ; . . . <jaas:config name="karaf" rank="2"> <jaas:module className="org.apache.karaf.jaas.modules.ldap.LDAPLoginModule" flags="required"> initialContextFactory=com.sun.jndi.ldap.LdapCtxFactory connection.username=admin connection.password=xxxxxxx connection.protocol= connection.url=ldap://activedirectory_host:389 user.base.dn=cn=orcladmin,cn=users,dc=vmldapdevelop,dc=com user.filter=(sAMAccountName=%u) user.search.subtree=true...

How to unit test an OSGi bundle from another OSGi bundle

unit-testing,osgi
I'm new in OSGi and I have some trouble with unit test. I've an OSGi bundle that exports some services, installed on a Jboss Fuse. I have to create a new OSGi bundle that unit tests the first bundle's services. How can I do it?

How to change the eclipse osgi service to timeout

eclipse,osgi
I need to debug through the start of an OSGi dynamic service in Eclipse RCP application but the timeout is too short (or I'm too slow at debugging!). !ENTRY org.eclipse.equinox.ds 2 0 2015-02-25 21:46:26.374 !MESSAGE Getting a lock required more than 10000 ms. There might be a synchronization problem in...

Unable to Acquire the State Change Lock

java,osgi,eclipse-luna
Our products are using the latest production-ready release of SWT, 3.7.2. Now since no one back then knew what the next Java version would be called (and how would they know that 8 came after 7, that's like higher mathematics), we were forced to swap the org.eclipse.osgi from 3.7.2 to...

Blueprint Osgi - Service created/destroyed Listener

osgi,blueprint-osgi,eclipse-gemini
Is possible add a Listener to know when a Bean Service with a particular Interface is created. And when the bean with the same interface is destroyed??? What is the best way to do it? reading the list of injecting services <reference-list id="javoraiConceptProcessList" interface="com.api.MyTask" availability="optional" ></reference-list> What is the way...

Set a bundle start level programatically on embedded Apache Felix 5

osgi,bundle
I have embedded Apache Felix 5.0.0 in an application I'm building. When installing the bundles to the Felix framework object, I have no way of setting the bundles start level from code, and I read everywhere that people do it by hand using Gogo, but because I'm going to automatically...

OSGi bundle (State - Active) (Spring - Started)

spring,osgi,karaf
When I start karaf client and type list command i can see OSGi bundles statistic. For each OSGi bundle there is several values, and 'Spring' among them. I need programmatically get Spring state from all OSGi bundles where there is Spring context. I'm tying to write an util method that...

MySQL Connector in OSGi Environment (Gradle): NoClassDefFoundError

java,mysql,intellij-idea,osgi,apache-felix
I'm trying to use the mysql-connector in an OSGi-Bundle to connect to a MySQL database. Unfortunately I'm always getting the NoClassDefFoundError when I'm trying to obtain the database driver in my bundle. I'm already sitting here for two days, banging my head against the wall. I tried everything I found...

Is it possible to build a SOA without a service broker? Is there any good example of this?

java,web-services,rest,osgi,soa
I have built an application in OSGi which offers a REST API for reading values from different data sources. Then I have several modules installed in my application exposing those data sources. For example one module exposes readings from a database, another exposes from a website, another reads from a...

OSGi - should I create service tracker for every bundle?

java,osgi,apache-felix
I have 10 bundles (A,B,C..). And in bundle A I want to create service tracker to track those services which implement some interface. These osgi services can be in any bundle (A,B,C..). I thought that I should create one service tracker and start it. However, what confuses me is that...

How to log starting of Eclipse plug-ins / OSGi bundles?

eclipse,eclipse-plugin,osgi,eclipse-rcp,osgi-bundle
In an Eclipse RCP application, how can I automatically log each plug-in as it is being started? I know about these, but am looking for something more akin to Java's -verbose:class: OSGi console's ability to query the current set of plug-ins. Handcoding a logging call in each plug-in's activator. This...

Restlet in OSGI can not find com/sun/net/httpserver/HttpHandler

java,osgi,restlet,restlet-2.0
I am trying to use Restlet in embedded OSGi environment. I have added the org.restlet.jar version 2.3.0 in the class path of my restlet test bundled. But it kept giving me the following error. java.lang.NoClassDefFoundError: com/sun/net/httpserver/HttpHandler The documentation says that this jar should be enough but it is currently not...

How is the thread model implemented in Karaf?

multithreading,osgi,apache-karaf,osgi-bundle,karaf
i am trying to understand the karaf thread model. from what i can understand in OSGI in case the bundle starts threads it is also responsible for closing them. is this the case in karaf as well? are there any other solutions for managing threads in karaf?

Using an external java library in OSGI bundle

java,eclipse,osgi,dependency-management,osgi-bundle
I want to use this java library [1]enj-library in my OSGI bundle that will be executed under KURA eclipse platform. I compiled the library as jar and then I created a new plugin project under eclipse "Plug-in from existing JAR archive" then I tried to add it to my bundle,...

Configure Response object for Rest Services inside a Jersey-Grizzly server, in OSGi container (CORS error prevention with Jersey 1x)

java,rest,jersey,osgi
The last couple of days, I have been struggling with an issue. I've created a rest service hosted by a Grizzly server inside an OSGi container. Everything is working perfectly at this point. Now, I want to add a header in every response.Not so complex or illogical right? Yet, I...

Mark OSGI Event As Handled

java,osgi
When I register event handlers to OSGI, I technically register services, which might or might not have a ranking. So since there is a fix order in which the event handlers are executed, I want to be able to tell all successive events that the event was already handled and...

OSGi bundles won't start - Unable to resolve sun.reflect.generics.reflectiveObjects

java,osgi,cq5,aem,apache-felix
After seemingly irrelevant changes in the code of my AEM project, my bundle fails to resolve. Upon inspecting the logs, I can see the following errors appearing. 22.04.2015 11:00:18.650 *ERROR* [qtp1266495948-35] org.apache.felix.http.jetty %bundles.pluginTitle: Cannot start (org.osgi.framework.BundleException: Unresolved constraint in bundle my-bundle ... [caused by: Unable to resolve 401.121: missing requirement...

Running Server Edge SDK with OSGI Framework in Eclipse RCP

java,osgi,eclipse-rcp
I followed the instructions here about setting up a development environment in order to either develop a custom Rifidi Edge Server(RFID Middleware) application, or modify an existing Edge Server bundle. every thing was ok but when i clicked on run button,instead of 'OSGi:' i saw this Error: Error: Could not...

OSGi Felix Framework EventDispatcher class is occupying >1GB of RAM?

java,osgi,profiling,apache-felix,yourkit
I was profiling my OSGi App with YourKit, using a heap dump I've made of my App that is running for 44 hours. I suddenly realize that the class EventDispatcher is huge in terms of occupied memory... What can I do to solve this? This makes the entire App to...

Log4j2 api cannot find Log4j2 core in OSGi environment

java,logging,log4j,osgi,log4j2
I'm trying to use log4j2 OSGi bundles, but it seems log4j2 api cannot find log4j2 core in an OSGi environment. I'm continuously getting the following exception : ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console I...

Getting ClassNotFoundException: org.eclipse.jetty.server.Server

jetty,osgi,jetty-8
I'm using the class "org.eclipse.jetty.server.Server" in XML file to intialize it with various parameters(Please note this is an OSGi environment). However my bundle which is using the class "org.eclipse.jetty.server.Server" is not starting and throwing the following exception: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Server at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown...

Apache Felix - Resolving WebConsole dependencies

json,osgi,apache-felix
I am trying to install the Apache Felix WeConsole and I found a small problem with the requirements. I get to install the WebConsole bundle along with its dependencies but the org.json dependency. Happens that this dependency is not even an OSGi bundle, so Felix seems to not care about...

CDI+OSGI: bundle packages scope

java,osgi,cdi,weld,pax
I use javase and solution osgi (felix)+cdi(weld)+paxcdi. I have two bundles A and B. Bundle B is a lib bundle. In bundle A I have one class and one package. package com.example.firstpackage; import com.example.secondpackage.Class2; public class Class1{ @Inject private Class2 class2; } In bundle B I have two classes and...

POI - Can't open xslx files in osgi

java,excel,osgi,apache-camel,apache-poi
Getting the next exception when trying to read xlsx files in osgi (jboss-fuse). Xls is working fine. Using the next jar files inside the bundle : <br> lib/xml-apis-1.0.b2.jar, \<br> lib/poi-scratchpad-3.9-20121203.jar, \<br> lib/poi-3.9-20121203.jar, \<br> lib/dom4j-1.6.1.jar, \<br> lib/poi-ooxml-schemas-3.9-20121203.jar, \<br> lib/poi-ooxml-3.9-20121203.jar, \<br> lib/xmlbeans-2.3.0.jar, \<br> lib/poi-excelant-3.9-20121203.jar, \<br> lib/xmlbeans-xpath-2.3.0.jar <br>...

When OSGi ServiceTracker modifiedService() method is actually invoked by the Framework?

java,osgi
I'm using the OSGi service tracker and I have noticed that the method ServiceTracker.modifiedService(...) is never called. I have tried to register the service twice with different properties, unregister it, etc..., but that method is never invoked by the Framework. Anyone knows under which circumstances the OSGi Framework consider a...

How to run some code as soon as Eclipse has started?

java,eclipse-plugin,osgi,equinox,osgi-bundle
I'm developing an Eclipse plugin that needs to figure out the amount of time that it took for Eclipse to start. I can get the amount of time since JVM startup in my plugin by using org.eclipse.ui.startup extension point and recording the time by using ManagementFactory.getRuntimeMXBean().getUptime() or eclipse.startTime system property....

How to get the name of an OSGI bundle from a bundle context in karaf

osgi,apache-karaf
I'm loading 3 small OSGI bundles with Karaf (bundles A, B, C). Each bundle is composed of one Activator class which implements the start and stop methods. From bundle A's start method I would like to print out a list of all installed bundles. output: Bundle A's name, Bundle B's...

pax-provision without gogo shell

osgi,apache-felix,pax,gogo-shell
I recently started with osgi. I'm using pax tools to generate and deploy my bundles. I'm trying to create a console application, but everytime I launch pax-provision command gogo shell is fired. I also want to know what is the difference between pax-provision and pax-run ( I don't use pax-run...

Why does bnd figures my bundle REQUIRES optional services (*, 0..n, ReferenceCardinality.MULTIPLE)?

java,osgi,bnd,bndtools
My bundle defines an interface, and a component that uses this interface implementations to call them all back (if some exists...). A good analogy is the LogService; if one (or more) exists, calls them with the message. Here's my DS declaration: @Reference(cardinality= ReferenceCardinality.MULTIPLE, policy = ReferencePolicy.DYNAMIC, service = ITestResultsParserService.class) public...

How to register an org.apache.aries.blueprint.Interceptor in OSGi Karaf?

java,apache,osgi,interceptor,karaf
tl;dr: Title is self-explanatory. I'm trying to implement a simple Interceptor to invoke methods of registered services in an OSGi Karaf environment. The services are published via blueprint configuration and, although there are working examples how to intercept CXF web-services, I can't find any documentation of how to register an...

execute bundle who cintains xml parser (SAX)

xml,osgi,bundle,sax,ipojo
i want to run bundle who contains code of parser xml(SAX) when i execute the commande start file:bundle's path i have a problem this is the error msg -> start file:C:\felix\bundles\home.analyser-1.0.0.jar org.osgi.framework.BundleException: Unresolved constraint in bundle home.analyse r [13]: package; (package=org.xml.sax.helpers) i try to search the jar file on the...

Karaf OSGI blueprint cm:property-placeholder dows not load from cfg file

osgi,configuration-files,karaf,blueprint
my blueprint contains: <cm:property-placeholder persistent-id="pool-service" update-strategy="reload"> <cm:default-properties> <cm:property name="maxTotalPerKey" value="2" /> </cm:default-properties> </cm:property-placeholder> I placed etc/pool-service.cfg containing maxTotalPerKey=3 when I deploy jar, it picks value 2. If I comment cm:default-properties, it fails with number format exception, so cfg is not read. Is there anything I am missing (maven dependency, import,...

Is there a pre-packed vanilla Apache Felix installation with Jetty 9?

jetty,osgi,bundle
Is there somewhere I can download a plain Apache Felix with all the bundles required for running the latest Jetty 9? I've been trying to do this by following the Jetty documentation to no avail, it's like trying to put together a puzzle where you don't know where the missing...

How to connect to osgi framework (felix)

java,osgi,apache-felix
I use apache felix and I want to connect osgi framework and to control it - in particularly to stop. By other words I have application A (osgi based) and application B. I want from B to connect to running A and stop osgi. I suppose felix must support interface...

Felix OSGi Web Console and Grizzly HTTP Server (HTTP Port Conflict)

osgi,apache-felix,grizzly
When my Felix (OSGi) starts it launches Felix Web Console bundle. This bundle uses Jetty which uses the felix property org.osgi.service.http.port to determine which HTTP port number to use. One of my bundles on OSGi, developed by myself requires Grizzly to deal with WebSockets and so forth, therefore, one of...

How to configure user bundles so that they can be autostarted with higher priority - hence earlier than others?

java,maven,osgi,equinox
I need to run certain plugins before others. First thought was to add names of bundles, priorities in '\configuration\bundles.info' but on start of OSGI it was throwing error java.lang.Exception: Could not find plugin com.example.myplugin. The added line was similar to this: com.example.myplugin,1.1.1,dropins/MY-ARTIFACT-1.2.3-SNAPSHOT/eclipse/plugins/com.example.myplugin-1.1.0.SNAPSHOT.jar,2,true Then I added to \configuration\config.ini the parameter: osgi.bundles=reference\:file\[email protected]\:start...

Is it possible to “extend”, or re-use, an Eclipse extension point?

eclipse,eclipse-plugin,osgi,eclipse-rcp
I'm developing an Eclipse RCP application (3.x), which also provides extension points. Up to now, I've simply created a new schema for the extension points, since they are linked to specific application functionalities. Now, however, I'd like to provide an extension point for new editors. I'd like to use the...

Integrate OSGi with WildFly-8.2.0.Final

jboss,osgi,wildfly,wildfly-8
I would like to know the steps to integrate OSGi with WildFly-8.2.0.Final. I have followed https://docs.jboss.org/author/display/JBOSGI/Getting+Started?_sscc=t but it is for older version and thrown exceptions on startup. Please share if you ave any idea. Thanks!...

“org.apache.jasper.JasperException” while accessing JSPs in jetty

jsp,servlets,jetty,osgi
I'm trying to run a webapp with JSPs inside Jetty. I've added the following dependencies for JSP support. 1)javax.servlet.jsp-2.2.0.v201112011158.jar 2)org.apache.jasper.glassfish-2.2.2.v201112011158.jar 3)[email protected] 4)javax.el-2.2.0.v201303151357.jar 5)org.eclipse.jetty.orbit.org.eclipse.jdt.core-3.8.2.v20130121.jar However while accessing one of the JSP i'm getting the following exceptions: HTTP ERROR 500 Problem accessing /ui/servletcontext.jsp. Reason: Server Error Caused by: org.apache.jasper.JasperException: PWC6033:...

OSGi bundle's Activator class not found

java,eclipse,osgi,equinox,osgi-bundle
I have an OSGi bundle, which has an activator class. I embedded Equinox in my webapp, and installed my bundle in it. The installation goes well, but when I try to start the bundle, the following error comes: org.osgi.framework.BundleException: The activator com.rr.fr.base.barcode.activator.Activator for bundle fr-base-barcode is invalid at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:171) at...

FreeMarker and OSGI

java,jsp,java-ee,osgi,freemarker
We have done a lot of work with building our framework using javaee and osgi. As a template system JSP was selected as the fastest and very mature. However, we came across one very serious problem. As we use osgi, we have one web application bundle - wab. This bundle...

Starting Jetty from Restlet in OSGi

java,jetty,osgi,restlet,equinox
I'm using Restlet in OSGi (equinox). I keep encountering a java.io.IOException: The thread blocked at the cyclic barrier has timed out. exception with the default HTTP server and so am trying to use Jetty instead. From reading various forums and articles, it seems that the correct way to use Jetty...

Using iPOJO in a JavaFX Application

osgi,javafx-8,apache-felix,ipojo
I am doing a Javafx application in Apache Felix along with some experiments using iPOJO. First is I called the Application.launch() method in a different class and then start an another class containing the iPOJO @Requires like this: public class JavafxApp extends Application { @Override public void start(Stage primaryStage){ /*...

Embedded OSGi: accessing dynamically loaded bundle components

java,runtime,osgi,bundle
I'm getting a little lost when dealing with embedding OSGi into an application/library, loading a bundle at runtime and then using that bundle in the host application/library. This is code to load the bundle from my host: // framework is the embedded OSGi framework Bundle b = framework.getBundleContext().installBundle( "file:/project_dir/bundle/MyBundle.jar" );...

OSGI runtime cannot pull dependencies from my local repository

maven,osgi,apache-camel,osgi-bundle,fuseesb
I am working on a camel project and am trying to package the project as a osgi bundle and deploy on a Fuse ESB container which uses karaf. The POM File is reproduced below. When I tried a mvn install, I got a couple of unresolved package errors. So, I...

JPA and Apache Aries: persistence unit unresolved dependency

java,jpa,osgi,blueprint-osgi,aries
I'm trying to configure a datasource for mysql and a corresp. persistence bundle on top of Apache Aries. This is the datasource's blueprint file <bean id="mysqlDataSource" class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"> <property name="url" value="jdbc:mysql://matteos-mbp:3306/" /> <property name="user" value="root" /> <property name="password" value="root" /> <property name="databaseName" value="testDBBlueprint" /> <property name="createDatabaseIfNotExist" value="true" /> </bean> <bean...

PAX-CDI change log level

osgi,cdi,pax
I am using pax-cdi and when I start it I get hundreds lines of information - what package is scanned, qualifiers etc. How to disable outputting this information?

Java and telnet - java.net.SocketException: Broken pipe

java,osgi,telnet
I have an osgi framework and I want to connect to it via telnet in oder to send only one command - shutdown. That's why I don't want to use telnet libs like apache commons telnet. My code: System.out.println("I am stopping...."); Socket socket=new Socket("localhost",6666); String command="shutdown"; PrintWriter pw = new...

How to Import Javafx8 in a bundle in OSGI

osgi,bundle,javafx-8
I'm working on an OSGI application with Felix. Now I want to use some JavaFx8 classes in a bundle but I have the following error : Unable to resolve 1.0: missing requirement [1.0] osgi.wiring.package; (osgi.wiring.package=javafx.geometry How can I import JavaFx8 SDK packages in my bundle. Thanks in advance, ...

Why won't my OSGI example print “Hello World” on bundle start?

java,eclipse,osgi,equinox,osgi-bundle
Taking an example from Neil Bartlett's book "OSGi in Practice", I copied the following code which can start, stop, and check for bundles in a directory, and which is supposed to print messages on bundle start and stop: package tutorial; import java.io.File; import org.osgi.framework.Bundle; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.BundleException;...

AWS SDK in OSGi causing “Unable to resolve/Missing requirement” errors

java,eclipse,amazon-web-services,osgi
I'm running into a really annoying issue while trying to get an OSGi program setup while also using the AWS SDK for Java. I'm using Eclipse with Bndtools and have created about as basic of a project as I can. All I have to do is import any part of...

OSGi bundle not started : missing requirement osgi.wiring.package; > &(osgi.wiring.package=org.apache.felix.dm)

java,eclipse,osgi,apache-felix,bndtools
I have been trying to follow 'Building Modular Cloud Apps with OSGi'. In chapter 3 of the book 'Creating the first OSGi application' the author describes how to create a simple OSGi application with a service in eclipse with bndtools. Below is the screenshot of my classes and configurations. The...

Dynamically wire OSGi Services by configuration properties

java,osgi,bndtools
I am currently facing a problem of how to dynamically "wire" OSGi Services depending on their configuration properties. I want to do that with Declarative Services. To give a concrete example: I have two different OSGi Services A and B which both are ManagedServiceFactories and require configuration. So I can...

How can I specify location of property file in OSGi blueprint?

osgi,blueprint-osgi
I would like to specify location of property file, from which OSGi blueprint property placeholder should read properties values: <cm:property-placeholder persistent-id="myBundle"/> <bean id="myCoolBean" class="test.properties.MyCoolBean"> <property name="echo" value="${echo}"/> </bean> UPDATE: Configuration felix.configadmin + felix.fileinstall works for me. I installed: org.apache.felix.configadmin-1.8.0.jar org.apache.felix.fileinstall-3.1.4.jar org.eclipse.equinox.cm-3.2.0.jar I specified VM argument...

Eclipse OSGI unsatisfied constraint

java,eclipse,maven,osgi
I have a basic OSGI project in Eclipse. When I created a class Activator and imported the BundleActivator, Eclipse changed the MANIFEST.MF adding these lines: Export-Package: my.package.name;uses:="org.osgi.framework";version="0.0.1.SNAPSHOT" Import-Package: org.osgi.framework;version="[1.8,2)" Now Eclipse ("problems view") prompts this error message: Unsatisfied constraint: 'Import-Package: org.osgi.framework; version="[1.8.0,2.0.0)"' Plug-in Problem MANIFEST.MF I have imported the newest...