FAQ Database Discussion Community

How to use @WebServlet and @Component in pax-web

I have a setup where I use the Pax-Web WAR-Extender so I can register servlets in standard-fashion. Before using the WAR-Extender the servlet was a singleton where I was able to inject other osgi-references. With the extender, the services get injected due to a Declarative-Service XML but when I access...

Force Imports in 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...

How to change the startup screen of Servicemix

I want to change the startup screen of servicemix which is as below, ____ _ __ __ _ / ___| ___ _ ____ _(_) ___ ___| \/ (_)_ __ \___ \ / _ \ '__\ \ / / |/ __/ _ \ |\/| | \ \/ / ___) | __/...

How to load external properties file through OSGi blueprint property-placeholder and Java DSL

I have a bundle installed in Apache servicemix that is using apache blueprint for configuration. I am using an external properties file abc.cfg located in /config folder and is being loaded as follows: via blueprint <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:camel-cxf="http://camel.apache.org/schema/blueprint/cxf" xmlns:jaxrs="http://cxf.apache.org/jaxrs" xmlns:cxf="http://cxf.apache.org/blueprint/core" xsi:schemaLocation=" http://cxf.apache.org/jaxrs...

Karaf is unable to resolve bundle depending on ActiveMQ feature due to multiple Joda-Time versions

My bundle has a transative bundle dependency on Joda-Time 2.x and gets deployed via a Karaf (3.0.3) feature file. It deployed just fine until I added dependencies to the activemq-broker (5.11.1) and activemq-camel features delivered with Karaf. My bundle now fails resolution because two paths to the package "org.joda.time" are...

just install jboss-fuse but management console is not reachable

I have install jboss-fuse on linux centos and runt it. But management console is not reachable. I have found some relevant documentation on redhat's website and followed the steps. https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_Fuse/6.0/html/Using_the_Management_Console/files/FMCUGAccess.html In that document it is said fabric-webui is to be installed. So I have run this command; "profile-edit --features fabric-webui...

Best way to debug OSGI bundles in Karaf

To date, I've been successful at building OSGI bundles, and invoking web services defined in these bundles via Apache CXF. Next, I'd like to be able to set breakpoints in my bundles as they are executed within the Karaf environment. I've looked into EIK, but it doesn't seem that project...

Camel not finding “sftp” component in registry and shutting down

I'm using the camel-sftp component to upload a file to an SFTP server. The code is simple: File source = new File(path); final String sftpUri = "sftp://" + userId + "@" + serverAddress + "/" + remoteDirectory+"?password="+pwd; CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { @Override public void configure() throws...

What are the steps to creating a custom Service Mix distribution

ServiceMix's documentation on creating a custom distribution merely states the steps to creating a custom karaf distribution. I understand that Karaf is the backbone of ServiceMix and ServiceMix is a custom distribution of Karaf. Has anyone actually built a custom esb on top of servicemix rather than on top of...

How to get the name of an OSGI bundle from a bundle context in 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...

Karaf / Maven - Unable to resolve: missing requirement osgi.wiring.package

I am unable to start a bundle in Karaf (version 3.0.1). The bundle is built using maven and it imports gson. I included gson in maven as required: <dependency> <groupId>com.google.code.gson</groupId> <artifactId>gson</artifactId> <version>2.3.1</version> </dependency> The build goes fine. However, when deploying the bundle I receive this Warning from Karaf: 2015-05-27 12:45:07,371...

How is the thread model implemented in 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?