apache-karaf

Unable to make logback work with karaf 3.0.4

狂风中的少年 提交于 2019-12-13 22:07:31
问题 I am attempting to make karaf 3.0.4 use logback. In the code i attempt to programatically create a FileAppender for a logback logger. ch.qos.logback.classic.Logger logger = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger("bingo"); Here the LoggerFactor is SLF4J LoggerFactory. I have not posted the code which adds the file appender. This throws the following exception in karaf: Caused by: java.lang.ClassCastException: org.ops4j.pax.logging.slf4j.Slf4jLogger cannot be cast to ch.qos

Looking up OSGi services from outside the OSGi container

会有一股神秘感。 提交于 2019-12-13 10:24:30
问题 I have a set of bundles deployed in Karaf and exposing a number of OSGi services which I would like to be able to lookup and call remotely, from an application running on a (possibly) different machine and in a non-OSGi container. My initial though was to use JNDI lookup to get the services I want however I understand from an earlier stackoverflow post that this might not be supported (I say might since I haven't been able to find any information on whether anything has changed on the Aries

Install odl-restconf in custom karaf distribution

蹲街弑〆低调 提交于 2019-12-13 07:18:56
问题 I have a custom karaf installation. I want to do a feature:install odl-restconf. for doing this i have done a feature:repo-add of feature file available in the below location https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/org/opendaylight/controller/features-restconf/1.3.0-SNAPSHOT/ After this i have made entries in karaf org.ops4j.pax.url.mvn.cfg file and added the below url as part of maven repo http://nexus.opendaylight.org/content/repositories@id=public, \ http:

java.lang.LinkageError while using HttpServletRequest

夙愿已清 提交于 2019-12-13 04:25:44
问题 Just want to use HttpServletRequest in my Rest service. Get the follow error page when try to do GET request: java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoader) previously initiated loading for a different type with name "javax/servlet/http/HttpServletRequest" I use apache-karaf-4.1.5 as a container, apache-cxf for JAX-RS implementation. And I marked javax.servlet-api as provided in pom.xml: <dependency>

Add custom log4j2 appender for Karaf and Pax Logging

妖精的绣舞 提交于 2019-12-12 23:15:53
问题 I am trying to add new custom log4j2 appender. Karaf 3.0.2 use pax-logging 1.7.4 which does not support log4j2. I have a appender which extend org.apache.logging.log4j.core.appender.AbstractAppender . I followed this blog http://blog.nanthrax.net/2012/12/create-custom-log4j-appender-for-karaf-and-pax-logging/ writen by Jean-Baptiste. It will not work because my appender is written in log4j2. What are the alternatives so that karaf also log using this appender? 回答1: The answer is already in

Where to find and install org.osgi.framework package?

流过昼夜 提交于 2019-12-12 21:08:50
问题 I am trying to follow this tutorial: apache felix tutorial #1 But I don't understand the directory structure. Where do I place the Activator.java file? Where, relative to the Activator.java file do I place the MANIFEST.MF? In this tutorial when I try to compile the Activator.java file, I get errors that org.osgi.framework does not exist. Where can I get the org.osgi.framework package and where should it be installed? How does the javac build command know how to find the org.osgi.framework

What is the natural start order for package-dependent OSGI bundles (under Karaf)?

本秂侑毒 提交于 2019-12-12 18:29:52
问题 I have a problem on 2.2.8 version of Karaf (and most probably on the earlier versions too). I'm going to use Karaf to host the system with dynamically deployed bundles. Bundles are deployed by users and i cannot know beforehand which are they. I expect order of the BundleActivator.start() to exactly correspond to package dependencies between bundles (dependencies of import/export packages) and planning to expect that it will be safe to assume that bundle0 will be completely initialized before

Deploy Microsoft Azure API jar on karaf

ⅰ亾dé卋堺 提交于 2019-12-12 05:36:18
问题 i am new to Maven and OSGI, can anyone please help me knowing how to deploy Microsoft Azure API jar on karaf OSGI container? Following is pom content of my Maven project. com.microsoft.windowsazure microsoft-windowsazure-api 0.4.3 <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.1.1</version> </dependency> <dependency

Red Hat JBoss Fuse 6.2.1: Osgi Missing Requirement: Oracle JDBC Driver

送分小仙女□ 提交于 2019-12-12 04:19:08
问题 This is a problem that I am facing with Jboss fuse, where a dependency (Oracle JDBC JAR) is not found as an OSGI bundle. The source code works fine when run locally, but errors out when deployed on a Karaf container. A detailed explanation of the issue and associated source code is placed at: https://developer.jboss.org/message/948643 Any suggestions on this would be welcome. Thanks for your patience. Prabal 回答1: The Oracle JAR File that you are trying to deploying on the Fuse Server is not a

How to call karaf console command in Java

扶醉桌前 提交于 2019-12-12 02:49:31
问题 If I want to execute a karaf shell command in my plugin (java), how to do it? ex: opendaylight-user@root> snmp4sdn:printdb "org.apache.felix.service.command.CommandProcessor" can handle it ? 回答1: In Karaf 3, you have to use the Felix Gogo services, ie the CommandProcessor . From a CommandProcessor , you can create a CommandSession and then call execute on this session. Two notes on this: In Karaf4, the service has changed - it's not dependent on Gogo anymore All the shell commands use an