Custom Karaf with Apache Camel
Hey, I'm trying to create a custom distribution of Karaf with Apache Camel. I tried building a distribution with several different version of Apache Camel without any luck. I first tried the version used by ServiceMix: Camel - 2.10.7 without any luck. Maven was complaining: [WARNING] could not resolve wrap:mvn:bsf/bsf/2.4.0 org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact wrap:mvn:jar:bsf/bsf/2.4.0 in servicemix (http://svn.apache.org/repos/asf/servicemix/m2-repo) When I tried Camel - 2.11.3 I got the same result. Finally I tried to use the latest Camel version 2.12.2. This one didn't complain about BSF missing (could be it didn't got that far) but complained on facebook4j-core being missing. [WARNING] could not resolve wrap:mvn:org.facebook4j/facebook4j-core/1.1.12 org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact wrap:mvn:jar:org.facebook4j/facebook4j-core/1.1.12 in servicemix (http://svn.apache.org/repos/asf/servicemix/m2-repo) I assume BSF is needed for scripting in Camel and facebook4j-core for the facebook component both which I don't need. So could it be I could better create a custom feature file only including camel-core bundle and the components that I need? If so could somebody give a small hint how I could accomplish it? Still I find it strange I couldn't build a version with Camel 2.10.7. btw: I'm using Java version 1.7.0_25 with Apache Maven 3.0.5 on Ubuntu 13.04 This is the pom I defined: ?xml version=1.0 encoding=UTF-8? 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; modelVersion4.0.0/modelVersion parent groupIdorg.apache.karaf.assemblies/groupId artifactIdassemblies/artifactId version3.0.0/version relativePath../pom.xml/relativePath /parent groupIdnl.kabisa.esb/groupId artifactIdflux/artifactId packagingpom/packaging nameKabisa Flux Distribution/name properties appendedResourcesDirectory${basedir}/../etc/appended-resources/appendedResourcesDirectory /properties dependencies dependency groupIdorg.apache.karaf.features/groupId artifactIdframework/artifactId typekar/type /dependency dependency groupIdorg.apache.karaf.features/groupId artifactIdstandard/artifactId classifierfeatures/classifier typexml/type scoperuntime/scope /dependency dependency groupIdorg.apache.karaf.features/groupId artifactIdspring/artifactId classifierfeatures/classifier typexml/type scoperuntime/scope /dependency dependency groupIdorg.apache.camel.karaf/groupId artifactIdapache-camel/artifactId version2.12.2/version classifierfeatures/classifier typexml/type /dependency /dependencies build resources resource directory${project.basedir}/../../directory filteringfalse/filtering includes includeREADME/include includeRELEASE*/include includeLICENSE/include includeNOTICE/include /includes /resource /resources plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-resources-plugin/artifactId executions execution idprocess-resources/id goals goalresources/goal /goals /execution /executions /plugin plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-remote-resources-plugin/artifactId configuration skiptrue/skip /configuration /plugin plugin groupIdorg.apache.karaf.tooling/groupId artifactIdkaraf-maven-plugin/artifactId executions execution idprocess-resources/id phaseprocess-resources/phase goals goalinstall-kars/goal /goals /execution execution idpackage/id goals goalinstance-create-archive/goal /goals /execution /executions configuration installedFeatures
Re: Custom Karaf with Apache Camel
Hi Niels, I gonna take a look but it sounds like missing artifacts. We got an issue on Central with some artifacts in ActiveMQ. Let me check if it's not something similar. Regards JB On 01/14/2014 10:06 AM, niels wrote: Hey, I'm trying to create a custom distribution of Karaf with Apache Camel. I tried building a distribution with several different version of Apache Camel without any luck. I first tried the version used by ServiceMix: Camel - 2.10.7 without any luck. Maven was complaining: [WARNING] could not resolve wrap:mvn:bsf/bsf/2.4.0 org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact wrap:mvn:jar:bsf/bsf/2.4.0 in servicemix (http://svn.apache.org/repos/asf/servicemix/m2-repo) When I tried Camel - 2.11.3 I got the same result. Finally I tried to use the latest Camel version 2.12.2. This one didn't complain about BSF missing (could be it didn't got that far) but complained on facebook4j-core being missing. [WARNING] could not resolve wrap:mvn:org.facebook4j/facebook4j-core/1.1.12 org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact wrap:mvn:jar:org.facebook4j/facebook4j-core/1.1.12 in servicemix (http://svn.apache.org/repos/asf/servicemix/m2-repo) I assume BSF is needed for scripting in Camel and facebook4j-core for the facebook component both which I don't need. So could it be I could better create a custom feature file only including camel-core bundle and the components that I need? If so could somebody give a small hint how I could accomplish it? Still I find it strange I couldn't build a version with Camel 2.10.7. btw: I'm using Java version 1.7.0_25 with Apache Maven 3.0.5 on Ubuntu 13.04 This is the pom I defined: ?xml version=1.0 encoding=UTF-8? 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; modelVersion4.0.0/modelVersion parent groupIdorg.apache.karaf.assemblies/groupId artifactIdassemblies/artifactId version3.0.0/version relativePath../pom.xml/relativePath /parent groupIdnl.kabisa.esb/groupId artifactIdflux/artifactId packagingpom/packaging nameKabisa Flux Distribution/name properties appendedResourcesDirectory${basedir}/../etc/appended-resources/appendedResourcesDirectory /properties dependencies dependency groupIdorg.apache.karaf.features/groupId artifactIdframework/artifactId typekar/type /dependency dependency groupIdorg.apache.karaf.features/groupId artifactIdstandard/artifactId classifierfeatures/classifier typexml/type scoperuntime/scope /dependency dependency groupIdorg.apache.karaf.features/groupId artifactIdspring/artifactId classifierfeatures/classifier typexml/type scoperuntime/scope /dependency dependency groupIdorg.apache.camel.karaf/groupId artifactIdapache-camel/artifactId version2.12.2/version classifierfeatures/classifier typexml/type /dependency /dependencies build resources resource directory${project.basedir}/../../directory filteringfalse/filtering includes includeREADME/include includeRELEASE*/include includeLICENSE/include includeNOTICE/include /includes /resource /resources plugins plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-resources-plugin/artifactId executions execution idprocess-resources/id goals goalresources/goal /goals /execution /executions /plugin plugin groupIdorg.apache.maven.plugins/groupId artifactIdmaven-remote-resources-plugin/artifactId configuration skiptrue/skip /configuration /plugin plugin groupIdorg.apache.karaf.tooling/groupId artifactIdkaraf-maven-plugin/artifactId executions execution idprocess-resources/id phaseprocess-resources/phase goals goalinstall-kars/goal /goals /execution
OSGi Compendium APIs
Hi, I want to deploy some services implementing APIs from OSGi Compendium (Preferences and UserAdmin) and followed the instructions in this post: http://karaf.922171.n3.nabble.com/Newbie-question-Useradmin-service-dependency-from-where-td4026903.html I added the package org.osgi.service.useradmin to org.osgi.framework.system.packages configuration and it is listed in the package:exports. My UserAdmin implementation resolves correctly but on start it does not find the classes in org.osgi.service.useradmin. Am I missing something? Thanks Alex -- View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: JPA with Karaf
Hi Nicolas, could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issue. Regards JB On 01/14/2014 10:33 AM, Dutertry Nicolas wrote: Hi, I am trying to use JPA with Karaf 3.0.0 but it does not work. First of all I have installed the following features : karaf@root() feature:install jndi jpa transaction openjpa Then I have created a simple JPA bundle containing: -A HSQLDB datasource configured with blueprint -A JPA entity (class Person) and the file META-INF/persistence.xml -A service for getting and creating people (class PersonService) The JPA EntityManager is injected in PersonService using blueprint. Finally I have deployed hsqldb and my bundle in Karaf, but my bundle’s state is set to “GracePeriod” : karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name - 86 | Active | 80 | 3.0.0 | Apache Karaf :: JNDI :: Command 114 | Active | 80 | 2.3.0 | Apache ServiceMix :: Specs :: Java Persistence API 1.4 115 | Active | 80 | 3.2.1 | Commons Collections 116 | Active | 80 | 1.6.0 | Commons Pool 117 | Active | 80 | 1.4| Commons DBCP 118 | Active | 80 | 2.6| Commons Lang 119 | Active | 80 | 2.3.0 | OpenJPA Aggregate Jar 120 | Active | 80 | 2.3.1 | HSQLDB 121 | GracePeriod | 80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle In the log file we found : 2014-01-14 10:04:28,388 | INFO | raf-3.0.0/deploy | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle test.jpa is waiting for dependencies [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(objectClass=javax.persistence.EntityManagerFactory))] I have attached the sources of my bundle and the full karaf log file in this mail. Is there a bug in Karaf or am I missing something ? Thanks for your help. -- Nicolas Dutertry HR Access - http://www.hraccess.com -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: OSGi Compendium APIs
Hi Alex, is your bundle import the packages correctly ? Regards JB On 01/14/2014 11:34 AM, agrz wrote: Hi, I want to deploy some services implementing APIs from OSGi Compendium (Preferences and UserAdmin) and followed the instructions in this post: http://karaf.922171.n3.nabble.com/Newbie-question-Useradmin-service-dependency-from-where-td4026903.html I added the package org.osgi.service.useradmin to org.osgi.framework.system.packages configuration and it is listed in the package:exports. My UserAdmin implementation resolves correctly but on start it does not find the classes in org.osgi.service.useradmin. Am I missing something? Thanks Alex -- View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999.html Sent from the Karaf - User mailing list archive at Nabble.com. -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: OSGi Compendium APIs
Hi JB yes the import is correct. The bundle is resolved and gets an error during runtime. In fact trying with felix UserAdmin implementation is the same behavior. Trying to deploy version 1.0.3 of Felix UserAdmin I get the following error: org.osgi.framework.BundleException: Activator start error in bundle org.apache.felix.useradmin [79]. at org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)[org.apache.felix.framework-4.2.1.jar:] at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)[org.apache.felix.framework-4.2.1.jar:] at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.2.1.jar:] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[16:org.apache.felix.fileinstall:3.2.6] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[16:org.apache.felix.fileinstall:3.2.6] at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:508)[16:org.apache.felix.fileinstall:3.2.6] at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[16:org.apache.felix.fileinstall:3.2.6] Caused by: java.lang.NoClassDefFoundError: org.osgi.service.useradmin.UserAdminListener at org.apache.felix.useradmin.osgi.UserAdminListenerListHelper.class$(UserAdminListenerListHelper.java:38) at org.apache.felix.useradmin.osgi.UserAdminListenerListHelper.init(UserAdminListenerListHelper.java:38) at org.apache.felix.useradmin.osgi.Activator.createServiceContext(Activator.java:68) at org.apache.felix.useradmin.osgi.Activator.start(Activator.java:37) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146) ... 6 more In my config properties I have set: org.osgi.framework.system.packages= \ org.osgi.framework.startlevel;uses:=org.osgi.framework;version=1.0, \ org.osgi.framework.wiring;uses:=org.osgi.framework;version=1.1, \ org.osgi.framework.hooks.bundle;uses:=org.osgi.framework;version=1.1, \ org.osgi.framework.hooks.service;uses:=org.osgi.framework;version=1.1, \ org.osgi.framework.hooks.resolver;uses:=org.osgi.framework.wiring;version=1.0, \ org.osgi.framework.launch;uses:=org.osgi.framework;version=1.1, \ org.osgi.framework.namespace;uses:=org.osgi.resource;version=1.0, \ org.osgi.framework;version=1.7, \ org.osgi.framework.hooks.weaving;uses:=org.osgi.framework.wiring;version=1.0,\ org.osgi.resource;version=1.0,org.osgi.service.url;version=1.0,\ org.osgi.service.startlevel;uses:=org.osgi.framework;version=1.1,\ org.osgi.service.packageadmin;uses:=org.osgi.framework;version=1.2,\ org.osgi.service.useradmin;uses:=org.osgi.framework;version=1.1,\ org.osgi.service.url;version=1.0, \ org.osgi.util.tracker;uses:=org.osgi.framework;version=1.5.1, \ org.apache.karaf.jaas.boot;version=3.0.0, \ org.apache.karaf.jaas.boot.principal;version=3.0.0, \ org.apache.karaf.management.boot;version=3.0.0, \ org.apache.karaf.version;version=3.0.0, \ ${jre-${java.specification.version}} I am using Karaf 3.0.0 Release. I also tried to look into the libraries that karaf includes and could only find very few the compendium services APIs. Where does karaf get the additonal org.osgi.service packages from? Is there something that needs to be installed in addition? Regards Alexander -- View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999p4031005.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: JPA with Karaf
Yes I'm able to confirm, the openjpa 2.3.0 feature does have an issue. If you take a look at how the openjpa requirements for 2.2.0 are defined in camel you'll find a working sample :) regards, Achim 2014/1/14 Jean-Baptiste Onofré j...@nanthrax.net Hi Nicolas, could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issue. Regards JB On 01/14/2014 10:33 AM, Dutertry Nicolas wrote: Hi, I am trying to use JPA with Karaf 3.0.0 but it does not work. First of all I have installed the following features : karaf@root() feature:install jndi jpa transaction openjpa Then I have created a simple JPA bundle containing: -A HSQLDB datasource configured with blueprint -A JPA entity (class Person) and the file META-INF/persistence.xml -A service for getting and creating people (class PersonService) The JPA EntityManager is injected in PersonService using blueprint. Finally I have deployed hsqldb and my bundle in Karaf, but my bundle’s state is set to “GracePeriod” : karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name - 86 | Active | 80 | 3.0.0 | Apache Karaf :: JNDI :: Command 114 | Active | 80 | 2.3.0 | Apache ServiceMix :: Specs :: Java Persistence API 1.4 115 | Active | 80 | 3.2.1 | Commons Collections 116 | Active | 80 | 1.6.0 | Commons Pool 117 | Active | 80 | 1.4| Commons DBCP 118 | Active | 80 | 2.6| Commons Lang 119 | Active | 80 | 2.3.0 | OpenJPA Aggregate Jar 120 | Active | 80 | 2.3.1 | HSQLDB 121 | GracePeriod | 80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle In the log file we found : 2014-01-14 10:04:28,388 | INFO | raf-3.0.0/deploy | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle test.jpa is waiting for dependencies [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name =test))(objectClass=javax.persistence.EntityManagerFactory))] I have attached the sources of my bundle and the full karaf log file in this mail. Is there a bug in Karaf or am I missing something ? Thanks for your help. -- Nicolas Dutertry HR Access - http://www.hraccess.com -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- Apache Karaf http://karaf.apache.org/ Committer PMC OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer Project Lead OPS4J Pax for Vaadin http://team.ops4j.org/wiki/display/PAXVAADIN/Home Commiter Project Lead blog http://notizblog.nierbeck.de/
Re: JPA with Karaf
Hi, Try adding providerorg.apache.openjpa.persistence.PersistenceProviderImpl/provider to your persistence-unit. I got a working setup with OpenJPA 2.3.0. kind regards, christoph On 2014-01-14 12:01, Jean-Baptiste Onofré wrote: Hi Nicolas, could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issue. Regards JB On 01/14/2014 10:33 AM, Dutertry Nicolas wrote: Hi, I am trying to use JPA with Karaf 3.0.0 but it does not work. First of all I have installed the following features : karaf@root() feature:install jndi jpa transaction openjpa Then I have created a simple JPA bundle containing: -A HSQLDB datasource configured with blueprint -A JPA entity (class Person) and the file META-INF/persistence.xml -A service for getting and creating people (class PersonService) The JPA EntityManager is injected in PersonService using blueprint. Finally I have deployed hsqldb and my bundle in Karaf, but my bundle’s state is set to “GracePeriod” : karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name - 86 | Active | 80 | 3.0.0 | Apache Karaf :: JNDI :: Command 114 | Active | 80 | 2.3.0 | Apache ServiceMix :: Specs :: Java Persistence API 1.4 115 | Active | 80 | 3.2.1 | Commons Collections 116 | Active | 80 | 1.6.0 | Commons Pool 117 | Active | 80 | 1.4| Commons DBCP 118 | Active | 80 | 2.6| Commons Lang 119 | Active | 80 | 2.3.0 | OpenJPA Aggregate Jar 120 | Active | 80 | 2.3.1 | HSQLDB 121 | GracePeriod | 80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle In the log file we found : 2014-01-14 10:04:28,388 | INFO | raf-3.0.0/deploy | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle test.jpa is waiting for dependencies [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(objectClass=javax.persistence.EntityManagerFactory))] I have attached the sources of my bundle and the full karaf log file in this mail. Is there a bug in Karaf or am I missing something ? Thanks for your help. -- Nicolas Dutertry HR Access - http://www.hraccess.com
Re: JPA with Karaf
btw. this is a working feature, I used in a sample with Karaf 3.0 feature name='Karaf-JPA-OpenJPA' version='${project.version}' !-- Container dependencies -- featuretransaction/feature featurejpa/feature featurejndi/feature !-- Dependencies for OpenJPA -- bundlemvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1/ bundle bundlemvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.2/bundle bundlemvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1/bundle bundlemvn:commons-lang/commons-lang/2.6/bundle bundlemvn:commons-collections/commons-collections/3.2.1/bundle bundlemvn:commons-pool/commons-pool/1.6/bundle bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp /1.4_3/bundle bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6 /bundle bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1 /bundle bundlemvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1/bundle bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.asm/3.3_2/ bundle bundlemvn:org.apache.openjpa/openjpa/2.2.2/bundle /feature 2014/1/14 Achim Nierbeck bcanh...@googlemail.com Yes I'm able to confirm, the openjpa 2.3.0 feature does have an issue. If you take a look at how the openjpa requirements for 2.2.0 are defined in camel you'll find a working sample :) regards, Achim 2014/1/14 Jean-Baptiste Onofré j...@nanthrax.net Hi Nicolas, could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issue. Regards JB On 01/14/2014 10:33 AM, Dutertry Nicolas wrote: Hi, I am trying to use JPA with Karaf 3.0.0 but it does not work. First of all I have installed the following features : karaf@root() feature:install jndi jpa transaction openjpa Then I have created a simple JPA bundle containing: -A HSQLDB datasource configured with blueprint -A JPA entity (class Person) and the file META-INF/persistence.xml -A service for getting and creating people (class PersonService) The JPA EntityManager is injected in PersonService using blueprint. Finally I have deployed hsqldb and my bundle in Karaf, but my bundle’s state is set to “GracePeriod” : karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name - 86 | Active | 80 | 3.0.0 | Apache Karaf :: JNDI :: Command 114 | Active | 80 | 2.3.0 | Apache ServiceMix :: Specs :: Java Persistence API 1.4 115 | Active | 80 | 3.2.1 | Commons Collections 116 | Active | 80 | 1.6.0 | Commons Pool 117 | Active | 80 | 1.4| Commons DBCP 118 | Active | 80 | 2.6| Commons Lang 119 | Active | 80 | 2.3.0 | OpenJPA Aggregate Jar 120 | Active | 80 | 2.3.1 | HSQLDB 121 | GracePeriod | 80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle In the log file we found : 2014-01-14 10:04:28,388 | INFO | raf-3.0.0/deploy | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle test.jpa is waiting for dependencies [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name =test))(objectClass=javax.persistence.EntityManagerFactory))] I have attached the sources of my bundle and the full karaf log file in this mail. Is there a bug in Karaf or am I missing something ? Thanks for your help. -- Nicolas Dutertry HR Access - http://www.hraccess.com -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- Apache Karaf http://karaf.apache.org/ Committer PMC OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer Project Lead OPS4J Pax for Vaadin http://team.ops4j.org/wiki/display/PAXVAADIN/Home Commiter Project Lead blog http://notizblog.nierbeck.de/ -- Apache Karaf http://karaf.apache.org/ Committer PMC OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer Project Lead OPS4J Pax for Vaadin http://team.ops4j.org/wiki/display/PAXVAADIN/Home Commiter Project Lead blog http://notizblog.nierbeck.de/
Re: Please help to fix karaf cluster issue
Hi JB, regarding the below, I didn't very understand. could you give more detail? Thank you it's where cluster group can help: you can target the deployment of some resources to only some subset of nodes in the same cluster group. -- View this message in context: http://karaf.922171.n3.nabble.com/Please-help-to-fix-karaf-cluster-issue-tp4030950p4031009.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: OSGi Compendium APIs
It sounds like you're manually adding a package to the system bundle exports without actually providing the package classes. Would it not be better to simply install a bundle that exports the package you need? That means that you don't need to manually edit config files etc... While it's generally recommended that implementations of compendium APIs provide the APIs themselves, you can also obtain them from the compendium API jars: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.osgi%22%20AND%20a%3A%22org.osgi.compendium%22 Cheers, David On 14 January 2014 11:13, agrz alexander.grze...@medisite.de wrote: Hi JB yes the import is correct. The bundle is resolved and gets an error during runtime. In fact trying with felix UserAdmin implementation is the same behavior. Trying to deploy version 1.0.3 of Felix UserAdmin I get the following error: org.osgi.framework.BundleException: Activator start error in bundle org.apache.felix.useradmin [79]. at org.apache.felix.framework.Felix.activateBundle(Felix.java:2196)[org.apache.felix.framework-4.2.1.jar:] at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)[org.apache.felix.framework-4.2.1.jar:] at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.2.1.jar:] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[16:org.apache.felix.fileinstall:3.2.6] at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[16:org.apache.felix.fileinstall:3.2.6] at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:508)[16:org.apache.felix.fileinstall:3.2.6] at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[16:org.apache.felix.fileinstall:3.2.6] Caused by: java.lang.NoClassDefFoundError: org.osgi.service.useradmin.UserAdminListener at org.apache.felix.useradmin.osgi.UserAdminListenerListHelper.class$(UserAdminListenerListHelper.java:38) at org.apache.felix.useradmin.osgi.UserAdminListenerListHelper.init(UserAdminListenerListHelper.java:38) at org.apache.felix.useradmin.osgi.Activator.createServiceContext(Activator.java:68) at org.apache.felix.useradmin.osgi.Activator.start(Activator.java:37) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146) ... 6 more In my config properties I have set: org.osgi.framework.system.packages= \ org.osgi.framework.startlevel;uses:=org.osgi.framework;version=1.0, \ org.osgi.framework.wiring;uses:=org.osgi.framework;version=1.1, \ org.osgi.framework.hooks.bundle;uses:=org.osgi.framework;version=1.1, \ org.osgi.framework.hooks.service;uses:=org.osgi.framework;version=1.1, \ org.osgi.framework.hooks.resolver;uses:=org.osgi.framework.wiring;version=1.0, \ org.osgi.framework.launch;uses:=org.osgi.framework;version=1.1, \ org.osgi.framework.namespace;uses:=org.osgi.resource;version=1.0, \ org.osgi.framework;version=1.7, \ org.osgi.framework.hooks.weaving;uses:=org.osgi.framework.wiring;version=1.0,\ org.osgi.resource;version=1.0,org.osgi.service.url;version=1.0,\ org.osgi.service.startlevel;uses:=org.osgi.framework;version=1.1,\ org.osgi.service.packageadmin;uses:=org.osgi.framework;version=1.2,\ org.osgi.service.useradmin;uses:=org.osgi.framework;version=1.1,\ org.osgi.service.url;version=1.0, \ org.osgi.util.tracker;uses:=org.osgi.framework;version=1.5.1, \ org.apache.karaf.jaas.boot;version=3.0.0, \ org.apache.karaf.jaas.boot.principal;version=3.0.0, \ org.apache.karaf.management.boot;version=3.0.0, \ org.apache.karaf.version;version=3.0.0, \ ${jre-${java.specification.version}} I am using Karaf 3.0.0 Release. I also tried to look into the libraries that karaf includes and could only find very few the compendium services APIs. Where does karaf get the additonal org.osgi.service packages from? Is there something that needs to be installed in addition? Regards Alexander -- View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999p4031005.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: OSGi Compendium APIs
Yes, this is what I did to get it running. But I was wondering if there is another way in karaf providing standard osgi apis. This is what I understood reading this post: http://karaf.922171.n3.nabble.com/Newbie-question-Useradmin-service-dependency-from-where-td4026903.html Thanks anyways Alex -- View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999p4031012.html Sent from the Karaf - User mailing list archive at Nabble.com.
RE: JPA with Karaf
Thank you Achim, the feature with openjpa 2.2.2 you gave me works ! I'm wondering why Karaf 3.0.0 provide an openjpa feature if it does not work ? Regards -- Nicolas Dutertry From: Achim Nierbeck [mailto:bcanh...@googlemail.com] Sent: mardi 14 janvier 2014 12:20 To: user@karaf.apache.org Subject: Re: JPA with Karaf btw. this is a working feature, I used in a sample with Karaf 3.0 feature name='Karaf-JPA-OpenJPA' version='${project.version}' !-- Container dependencies -- featuretransaction/feature featurejpa/feature featurejndi/feature !-- Dependencies for OpenJPA -- bundlemvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.2/bundle bundlemvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1/bundle bundlemvn:commons-lang/commons-lang/2.6/bundle bundlemvn:commons-collections/commons-collections/3.2.1/bundle bundlemvn:commons-pool/commons-pool/1.6/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/1.4_3/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.asm/3.3_2/bundle bundlemvn:org.apache.openjpa/openjpa/2.2.2/bundle /feature 2014/1/14 Achim Nierbeck bcanh...@googlemail.commailto:bcanh...@googlemail.com Yes I'm able to confirm, the openjpa 2.3.0 feature does have an issue. If you take a look at how the openjpa requirements for 2.2.0 are defined in camel you'll find a working sample :) regards, Achim 2014/1/14 Jean-Baptiste Onofré j...@nanthrax.netmailto:j...@nanthrax.net Hi Nicolas, could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issue. Regards JB On 01/14/2014 10:33 AM, Dutertry Nicolas wrote: Hi, I am trying to use JPA with Karaf 3.0.0 but it does not work. First of all I have installed the following features : karaf@root() feature:install jndi jpa transaction openjpa Then I have created a simple JPA bundle containing: -A HSQLDB datasource configured with blueprint -A JPA entity (class Person) and the file META-INF/persistence.xml -A service for getting and creating people (class PersonService) The JPA EntityManager is injected in PersonService using blueprint. Finally I have deployed hsqldb and my bundle in Karaf, but my bundle's state is set to GracePeriod : karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name - 86 | Active | 80 | 3.0.0 | Apache Karaf :: JNDI :: Command 114 | Active | 80 | 2.3.0 | Apache ServiceMix :: Specs :: Java Persistence API 1.4 115 | Active | 80 | 3.2.1 | Commons Collections 116 | Active | 80 | 1.6.0 | Commons Pool 117 | Active | 80 | 1.4| Commons DBCP 118 | Active | 80 | 2.6| Commons Lang 119 | Active | 80 | 2.3.0 | OpenJPA Aggregate Jar 120 | Active | 80 | 2.3.1 | HSQLDB 121 | GracePeriod | 80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle In the log file we found : 2014-01-14 10:04:28,388 | INFO | raf-3.0.0/deploy | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle test.jpa is waiting for dependencies [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.namehttp://osgi.unit.name=test))(objectClass=javax.persistence.EntityManagerFactory))] I have attached the sources of my bundle and the full karaf log file in this mail. Is there a bug in Karaf or am I missing something ? Thanks for your help. -- Nicolas Dutertry HR Access - http://www.hraccess.com -- Jean-Baptiste Onofré jbono...@apache.orgmailto:jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- Apache Karaf http://karaf.apache.org/ Committer PMC OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer Project Lead OPS4J Pax for Vaadin http://team.ops4j.org/wiki/display/PAXVAADIN/Home Commiter Project Lead blog http://notizblog.nierbeck.de/ -- Apache Karaf http://karaf.apache.org/ Committer PMC OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer Project Lead OPS4J Pax for Vaadin http://team.ops4j.org/wiki/display/PAXVAADIN/Home Commiter Project Lead blog http://notizblog.nierbeck.de/
Re: JPA with Karaf
Looks like we've been to optimistic for the 2.3. version switch ... :/ sorry about that. regards, Achim 2014/1/14 Dutertry Nicolas nicolas.duter...@hraccess.com Thank you Achim, the feature with openjpa 2.2.2 you gave me works ! I’m wondering why Karaf 3.0.0 provide an openjpa feature if it does not work ? Regards -- Nicolas Dutertry *From:* Achim Nierbeck [mailto:bcanh...@googlemail.com] *Sent:* mardi 14 janvier 2014 12:20 *To:* user@karaf.apache.org *Subject:* Re: JPA with Karaf btw. this is a working feature, I used in a sample with Karaf 3.0 feature name='Karaf-JPA-OpenJPA' version='${project.version}' !-- Container dependencies -- featuretransaction/feature featurejpa/feature featurejndi/feature !-- Dependencies for OpenJPA -- bundlemvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.2/bundle bundlemvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1/bundle bundlemvn:commons-lang/commons-lang/2.6/bundle bundlemvn:commons-collections/commons-collections/3.2.1/bundle bundlemvn:commons-pool/commons-pool/1.6/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/1.4_3/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.asm/3.3_2/bundle bundlemvn:org.apache.openjpa/openjpa/2.2.2/bundle /feature 2014/1/14 Achim Nierbeck bcanh...@googlemail.com Yes I'm able to confirm, the openjpa 2.3.0 feature does have an issue. If you take a look at how the openjpa requirements for 2.2.0 are defined in camel you'll find a working sample :) regards, Achim 2014/1/14 Jean-Baptiste Onofré j...@nanthrax.net Hi Nicolas, could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issue. Regards JB On 01/14/2014 10:33 AM, Dutertry Nicolas wrote: Hi, I am trying to use JPA with Karaf 3.0.0 but it does not work. First of all I have installed the following features : karaf@root() feature:install jndi jpa transaction openjpa Then I have created a simple JPA bundle containing: -A HSQLDB datasource configured with blueprint -A JPA entity (class Person) and the file META-INF/persistence.xml -A service for getting and creating people (class PersonService) The JPA EntityManager is injected in PersonService using blueprint. Finally I have deployed hsqldb and my bundle in Karaf, but my bundle’s state is set to “GracePeriod” : karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name - 86 | Active | 80 | 3.0.0 | Apache Karaf :: JNDI :: Command 114 | Active | 80 | 2.3.0 | Apache ServiceMix :: Specs :: Java Persistence API 1.4 115 | Active | 80 | 3.2.1 | Commons Collections 116 | Active | 80 | 1.6.0 | Commons Pool 117 | Active | 80 | 1.4| Commons DBCP 118 | Active | 80 | 2.6| Commons Lang 119 | Active | 80 | 2.3.0 | OpenJPA Aggregate Jar 120 | Active | 80 | 2.3.1 | HSQLDB 121 | GracePeriod | 80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle In the log file we found : 2014-01-14 10:04:28,388 | INFO | raf-3.0.0/deploy | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle test.jpa is waiting for dependencies [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name =test))(objectClass=javax.persistence.EntityManagerFactory))] I have attached the sources of my bundle and the full karaf log file in this mail. Is there a bug in Karaf or am I missing something ? Thanks for your help. -- Nicolas Dutertry HR Access - http://www.hraccess.com -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- Apache Karaf http://karaf.apache.org/ Committer PMC OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer Project Lead OPS4J Pax for Vaadin http://team.ops4j.org/wiki/display/PAXVAADIN/Home Commiter Project Lead blog http://notizblog.nierbeck.de/ -- Apache Karaf http://karaf.apache.org/ Committer PMC OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer Project Lead OPS4J Pax for Vaadin http://team.ops4j.org/wiki/display/PAXVAADIN/Home Commiter Project Lead blog http://notizblog.nierbeck.de/
Re: JPA with Karaf
FYI, Karaf 3.0.1 will provide both OpenJPA 2.2.2 and 2.3.0 features: The issue is in OpenJPA 2.3.0 and has been identified after the Karaf 3.0.0 release. Regards JB On 01/14/2014 02:36 PM, Dutertry Nicolas wrote: Thank you Achim, the feature with openjpa 2.2.2 you gave me works ! I’m wondering why Karaf 3.0.0 provide an openjpa feature if it does not work ? Regards -- Nicolas Dutertry *From:*Achim Nierbeck [mailto:bcanh...@googlemail.com] *Sent:* mardi 14 janvier 2014 12:20 *To:* user@karaf.apache.org *Subject:* Re: JPA with Karaf btw. this is a working feature, I used in a sample with Karaf 3.0 feature name='Karaf-JPA-OpenJPA' version='${project.version}' !-- Container dependencies -- featuretransaction/feature featurejpa/feature featurejndi/feature !-- Dependencies for OpenJPA -- bundlemvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.2/bundle bundlemvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1/bundle bundlemvn:commons-lang/commons-lang/2.6/bundle bundlemvn:commons-collections/commons-collections/3.2.1/bundle bundlemvn:commons-pool/commons-pool/1.6/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/1.4_3/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.asm/3.3_2/bundle bundlemvn:org.apache.openjpa/openjpa/2.2.2/bundle /feature 2014/1/14 Achim Nierbeck bcanh...@googlemail.com mailto:bcanh...@googlemail.com Yes I'm able to confirm, the openjpa 2.3.0 feature does have an issue. If you take a look at how the openjpa requirements for 2.2.0 are defined in camel you'll find a working sample :) regards, Achim 2014/1/14 Jean-Baptiste Onofré j...@nanthrax.net mailto:j...@nanthrax.net Hi Nicolas, could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issue. Regards JB On 01/14/2014 10:33 AM, Dutertry Nicolas wrote: Hi, I am trying to use JPA with Karaf 3.0.0 but it does not work. First of all I have installed the following features : karaf@root() feature:install jndi jpa transaction openjpa Then I have created a simple JPA bundle containing: -A HSQLDB datasource configured with blueprint -A JPA entity (class Person) and the file META-INF/persistence.xml -A service for getting and creating people (class PersonService) The JPA EntityManager is injected in PersonService using blueprint. Finally I have deployed hsqldb and my bundle in Karaf, but my bundle’s state is set to “GracePeriod” : karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name - 86 | Active | 80 | 3.0.0 | Apache Karaf :: JNDI :: Command 114 | Active | 80 | 2.3.0 | Apache ServiceMix :: Specs :: Java Persistence API 1.4 115 | Active | 80 | 3.2.1 | Commons Collections 116 | Active | 80 | 1.6.0 | Commons Pool 117 | Active | 80 | 1.4| Commons DBCP 118 | Active | 80 | 2.6| Commons Lang 119 | Active | 80 | 2.3.0 | OpenJPA Aggregate Jar 120 | Active | 80 | 2.3.1 | HSQLDB 121 | GracePeriod | 80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle In the log file we found : 2014-01-14 10:04:28,388 | INFO | raf-3.0.0/deploy | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle test.jpa is waiting for dependencies [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name http://osgi.unit.name=test))(objectClass=javax.persistence.EntityManagerFactory))] I have attached the sources of my bundle and the full karaf log file in this mail. Is there a bug in Karaf or am I missing something ? Thanks for your help. -- Nicolas Dutertry HR Access - http://www.hraccess.com -- Jean-Baptiste Onofré jbono...@apache.org mailto:jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- Apache Karaf http://karaf.apache.org/ Committer PMC OPS4J Pax Web http://wiki.ops4j.org/display/paxweb/Pax+Web/ Committer Project Lead OPS4J Pax for Vaadin http://team.ops4j.org/wiki/display/PAXVAADIN/Home Commiter Project Lead blog http://notizblog.nierbeck.de/ -- Apache Karaf http://karaf.apache.org/ Committer PMC OPS4J Pax Web
Re: JPA with Karaf
We actually didn't switch as we didn't provide any jpa features previously ;) Regards JB On 01/14/2014 02:39 PM, Achim Nierbeck wrote: Looks like we've been to optimistic for the 2.3. version switch ... :/ sorry about that. regards, Achim 2014/1/14 Dutertry Nicolas nicolas.duter...@hraccess.com mailto:nicolas.duter...@hraccess.com Thank you Achim, the feature with openjpa 2.2.2 you gave me works ! __ __ I’m wondering why Karaf 3.0.0 provide an openjpa feature if it does not work ? __ __ Regards -- Nicolas Dutertry *From:*Achim Nierbeck [mailto:bcanh...@googlemail.com mailto:bcanh...@googlemail.com] *Sent:* mardi 14 janvier 2014 12:20 *To:* user@karaf.apache.org mailto:user@karaf.apache.org *Subject:* Re: JPA with Karaf __ __ btw. __ __ this is a working feature, I used in a sample with Karaf 3.0 __ __ feature name='Karaf-JPA-OpenJPA' version='${project.version}' !-- Container dependencies -- featuretransaction/feature featurejpa/feature featurejndi/feature !-- Dependencies for OpenJPA -- bundlemvn:org.apache.geronimo.specs/geronimo-annotation_1.0_spec/1.1.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jpa_2.0_spec/1.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-servlet_2.5_spec/1.2/bundle bundlemvn:org.apache.geronimo.specs/geronimo-el_1.0_spec/1.0.1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1/bundle bundlemvn:commons-lang/commons-lang/2.6/bundle bundlemvn:commons-collections/commons-collections/3.2.1/bundle bundlemvn:commons-pool/commons-pool/1.6/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.commons-dbcp/1.4_3/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.ant/1.7.0_6/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.serp/1.14.1_1/bundle bundlemvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1/bundle bundlemvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.asm/3.3_2/bundle bundlemvn:org.apache.openjpa/openjpa/2.2.2/bundle /feature __ __ 2014/1/14 Achim Nierbeck bcanh...@googlemail.com mailto:bcanh...@googlemail.com Yes I'm able to confirm, the openjpa 2.3.0 feature does have an issue. If you take a look at how the openjpa requirements for 2.2.0 are defined in camel you'll find a working sample :) __ __ regards, Achim __ __ 2014/1/14 Jean-Baptiste Onofré j...@nanthrax.net mailto:j...@nanthrax.net Hi Nicolas, could you try with OpenJPA 2.2.2 ? AFAIR it seems OpenJPA 2.3.0 has an issue. Regards JB On 01/14/2014 10:33 AM, Dutertry Nicolas wrote: Hi, I am trying to use JPA with Karaf 3.0.0 but it does not work. First of all I have installed the following features : karaf@root() feature:install jndi jpa transaction openjpa Then I have created a simple JPA bundle containing: -A HSQLDB datasource configured with blueprint -A JPA entity (class Person) and the file META-INF/persistence.xml -A service for getting and creating people (class PersonService) The JPA EntityManager is injected in PersonService using blueprint. Finally I have deployed hsqldb and my bundle in Karaf, but my bundle’s state is set to “GracePeriod” : karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name - 86 | Active | 80 | 3.0.0 | Apache Karaf :: JNDI :: Command 114 | Active | 80 | 2.3.0 | Apache ServiceMix :: Specs :: Java Persistence API 1.4 115 | Active | 80 | 3.2.1 | Commons Collections 116 | Active | 80 | 1.6.0 | Commons Pool 117 | Active | 80 | 1.4| Commons DBCP 118 | Active | 80 | 2.6| Commons Lang 119 | Active | 80 | 2.3.0 | OpenJPA Aggregate Jar 120 | Active | 80 | 2.3.1 | HSQLDB 121 | GracePeriod | 80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle In the log file we found : 2014-01-14 10:04:28,388 | INFO | raf-3.0.0/deploy | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle test.jpa is waiting for dependencies [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name
Re: Monitoring config directory
I am trying to monitor more than one directory. Please ignore my question. It's working now. I don't know why, but it is working. If I am able to regenerate the problem again, I will report it. The problem was that it doesn't monitor the second directory. Thank you. On Tue, Jan 14, 2014 at 12:55 AM, Jean-Baptiste Onofré j...@nanthrax.net wrote: Hi, you have it in the etc/config.properties: felix.fileinstall.enableConfigSave = true felix.fileinstall.dir= ${karaf.etc} felix.fileinstall.filter = .*\\.cfg felix.fileinstall.poll = 1000 felix.fileinstall.noInitialDelay = true felix.fileinstall.log.level = 3 What do you mean by it doesn't work ? you mean adding your own directory ? The monitoring itself work else Karaf wouldn't load its own configurations. Regards JB On 01/14/2014 12:08 AM, Mansour Al Akeel wrote: This used to work in karaf 2.3.2 felix.fileinstall.dir= ${karaf.base}/etc, /home/mansour/workspace/my-project/conf But it no longer works in 3.0.0. Am I missing something ? -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
issue about karaf cellar cluster
Hi JB, I have an issue about karaf cluster. I used karaf 2.3.3 and cellar 2.2.2. I have 2 nodes, node 1 and node 2. I put camel and spring related third-party bundles under the deploy folder of node 1 and put 3 application bundles jar files under the deploy folder of node 2 demo.camel-bundle-0.1.jar demo.service-bundle-0.1.jar Gravity-VantageOceanPublisher-1.0_A0.jar I changed the below config in the file org.apache.karaf.cellar.groups.cfg in node 2 default.features.blacklist.inbound = **VantageOceanPublisher**,management,hazelcast,cellar* default.features.blacklist.outbound = **VantageOceanPublisher**,management,hazelcast,cellar* default.bundle.blacklist.inbound = **VantageOceanPublisher** default.bundle.blacklist.outbound =* *VantageOceanPublisher** Then I start node 1 and node 2. when I executed the command list bundle in the node 1, I just can see demo.camel-bundle, When I executed the command bundle-list default I can see both demo.camel-bundle and demo.service-bundle *why I can't see the bundle demo.service-bundle when I executed command list ?* -- View this message in context: http://karaf.922171.n3.nabble.com/issue-about-karaf-cellar-cluster-tp4031019.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: issue about karaf cellar cluster
Hi, Generally speaking the deploy folder is not synchronized by Cellar. You have to share the artifacts using a repository known on all nodes. If the artifact location can be accessed on one node, Cellar won't be able to install the bundle on this node. I have a Jira to add sync of the deploy folder: https://issues.apache.org/jira/browse/KARAF-627 However, I think it's better to use a shared repository (just a filesystem or http server, or a Karaf Cave server, or a complete Maven repository manager like Apache Archiva or Sonatype Nexus). Regards JB On 01/14/2014 03:01 PM, simafengyun1984 wrote: Hi JB, I have an issue about karaf cluster. I used karaf 2.3.3 and cellar 2.2.2. I have 2 nodes, node 1 and node 2. I put camel and spring related third-party bundles under the deploy folder of node 1 and put 3 application bundles jar files under the deploy folder of node 2 demo.camel-bundle-0.1.jar demo.service-bundle-0.1.jar Gravity-VantageOceanPublisher-1.0_A0.jar I changed the below config in the file org.apache.karaf.cellar.groups.cfg in node 2 default.features.blacklist.inbound = **VantageOceanPublisher**,management,hazelcast,cellar* default.features.blacklist.outbound = **VantageOceanPublisher**,management,hazelcast,cellar* default.bundle.blacklist.inbound = **VantageOceanPublisher** default.bundle.blacklist.outbound =* *VantageOceanPublisher** Then I start node 1 and node 2. when I executed the command list bundle in the node 1, I just can see demo.camel-bundle, When I executed the command bundle-list default I can see both demo.camel-bundle and demo.service-bundle *why I can't see the bundle demo.service-bundle when I executed command list ?* -- View this message in context: http://karaf.922171.n3.nabble.com/issue-about-karaf-cellar-cluster-tp4031019.html Sent from the Karaf - User mailing list archive at Nabble.com. -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
What is the Blueprint syntax to instantiate and initialize object properties when the command is executed?
Karaf 2.3.3 Karaf 2.3.3 What is the Blueprint syntax to instantiate and initialize object properties when the command is executed? The XML below will define the command and contains a reference to the interface of the service the command will use. I would like the syntax to instantiate and initialize the property MyService for an MyCommand object when the command is executed by a user. *** * blueprint.xml *** command-bundle xmlns=http://karaf.apache.org/xmlns/shell/v1.0.0; command name=“command/doSomething” action class=“com.foo.MyCommand / /command /command-bundle reference id=“Service” interface=“com.foo.MyService” / *** * MyCommand.java *** package com.foo; import org.apache.felix.gogo.commands.Command; import org.apache.karaf.shell.console.OsgiCommandSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Command(scope = “command”, name = “doSomething”, description = Example Command) public class MyCommand extends OsgiCommandSupport { private MyService _myService; private static Logger _logger = LoggerFactory.getLogger(MyCommand.class); protected Object doExecute() throws Exception { _logger.info(“Command ‘command:doSomething’ executed and returned “ + _myService.doSomething()); return void; } MyService getMyService() { return _myService; } void setMyService( MyService service) { _myService = service; }
Re: What is the Blueprint syntax to instantiate and initialize object properties when the command is executed?
Hi Paul, it depends of the xmlns version that you use. With shell xmlns 1.0.0, you have to use command name=command/doSomething/ where command corresponds to the scope and doSomething to the name. In Karaf 3.0.0, with namespace 1.1.0, you can use just command/, the scope and name are extracted from the command class. Regards JB On 01/14/2014 05:54 PM, Paul Spencer wrote: Karaf 2.3.3 Karaf 2.3.3 What is the Blueprint syntax to instantiate and initialize object properties when the command is executed? The XML below will define the command and contains a reference to the interface of the service the command will use. I would like the syntax to instantiate and initialize the property MyService for an MyCommand object when the command is executed by a user. *** * blueprint.xml *** command-bundle xmlns=http://karaf.apache.org/xmlns/shell/v1.0.0; command name=“command/doSomething” action class=“com.foo.MyCommand / /command /command-bundle reference id=“Service” interface=“com.foo.MyService” / *** * MyCommand.java *** package com.foo; import org.apache.felix.gogo.commands.Command; import org.apache.karaf.shell.console.OsgiCommandSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Command(scope = “command”, name = “doSomething”, description = Example Command) public class MyCommand extends OsgiCommandSupport { private MyService _myService; private static Logger _logger = LoggerFactory.getLogger(MyCommand.class); protected Object doExecute() throws Exception { _logger.info(“Command ‘command:doSomething’ executed and returned “ + _myService.doSomething()); return void; } MyService getMyService() { return _myService; } void setMyService( MyService service) { _myService = service; } -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: What is the Blueprint syntax to instantiate and initialize object properties when the command is executed?
Sorry Paul, I missed part of your question. The action class is like a bean, so you use property set on it. Regards JB On 01/14/2014 05:54 PM, Paul Spencer wrote: Karaf 2.3.3 Karaf 2.3.3 What is the Blueprint syntax to instantiate and initialize object properties when the command is executed? The XML below will define the command and contains a reference to the interface of the service the command will use. I would like the syntax to instantiate and initialize the property MyService for an MyCommand object when the command is executed by a user. *** * blueprint.xml *** command-bundle xmlns=http://karaf.apache.org/xmlns/shell/v1.0.0; command name=“command/doSomething” action class=“com.foo.MyCommand / /command /command-bundle reference id=“Service” interface=“com.foo.MyService” / *** * MyCommand.java *** package com.foo; import org.apache.felix.gogo.commands.Command; import org.apache.karaf.shell.console.OsgiCommandSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Command(scope = “command”, name = “doSomething”, description = Example Command) public class MyCommand extends OsgiCommandSupport { private MyService _myService; private static Logger _logger = LoggerFactory.getLogger(MyCommand.class); protected Object doExecute() throws Exception { _logger.info(“Command ‘command:doSomething’ executed and returned “ + _myService.doSomething()); return void; } MyService getMyService() { return _myService; } void setMyService( MyService service) { _myService = service; } -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: What is the Blueprint syntax to instantiate and initialize object properties when the command is executed?
JB, Thank you for the help. Below is the resulting Blueprint.xml. Note: The reference is optional so the command will exist even if the service is not running. The command will need to check for null when using the service. command-bundle xmlns=http://karaf.apache.org/xmlns/shell/v1.0.0; command name=“command/doSomething” action class=“com.foo.MyCommand” property name=“myService” ref=“Service”/ /action /command /command-bundle reference id=“Service” interface=“com.foo.MyService” availability=optional/ Paul Spencer On Jan 14, 2014, at 12:04 PM, Jean-Baptiste Onofré j...@nanthrax.net wrote: Sorry Paul, I missed part of your question. The action class is like a bean, so you use property set on it. Regards JB On 01/14/2014 05:54 PM, Paul Spencer wrote: Karaf 2.3.3 Karaf 2.3.3 What is the Blueprint syntax to instantiate and initialize object properties when the command is executed? The XML below will define the command and contains a reference to the interface of the service the command will use. I would like the syntax to instantiate and initialize the property MyService for an MyCommand object when the command is executed by a user. *** * blueprint.xml *** command-bundle xmlns=http://karaf.apache.org/xmlns/shell/v1.0.0; command name=“command/doSomething” action class=“com.foo.MyCommand / /command /command-bundle reference id=“Service” interface=“com.foo.MyService” / *** * MyCommand.java *** package com.foo; import org.apache.felix.gogo.commands.Command; import org.apache.karaf.shell.console.OsgiCommandSupport; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @Command(scope = “command”, name = “doSomething”, description = Example Command) public class MyCommand extends OsgiCommandSupport { private MyService _myService; private static Logger _logger = LoggerFactory.getLogger(MyCommand.class); protected Object doExecute() throws Exception { _logger.info(“Command ‘command:doSomething’ executed and returned “ + _myService.doSomething()); return void; } MyService getMyService() { return _myService; } void setMyService( MyService service) { _myService = service; } -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: Getting a java.lang.SecurityException: Insufficient credentials.” error when executing various commands in Karaf 3.0.0
Hi Paul, take a look in the documentation: http://karaf.apache.org/manual/latest/users-guide/security.html in the console section. You will the explanations about etc/org.apache.karaf.command.acl.scope.cfg files. Regards JB On 01/14/2014 07:14 PM, Paul Spencer wrote: Karaf 3.0.0 running on Apple OSX Maverick (10.9.1) I am getting a java.lang.SecurityException: Insufficient credentials.” error when executing various commands on a newly installed Karaf 3.0.0. The use case below is for uninstalling a bundle. Is there a configuration change I need to make? *** * Use case *** 1) unzipped the distribution 2) Start the Karaf server with bin/start 3) Tail the log file until the JMX OSGi Agent is finished registering objects (about 30 seconds) 4) Start the Karaf client with bin/client 5) Install a bundle 6) Uninstall the newly installed bundle *** * Command output *** karaf@root() install mvn:com.intekon.customer.kc.ewm.web-service/ewm-sap-dist/1.0-SNAPSHOT Bundle ID: 79 karaf@root() uninstall 79 Error executing command: Insufficient credentials. karaf@root() *** * From karaf.log (I can post the full 28K log if necessary) *** 2014-01-14 12:50:07,960 | INFO | e ssh user karaf | GuardProxyCatalog | 42 - org.apache.karaf.service.guard - 3.0.0 | Current user does not have required roles ([manager]) for service [org.apache.karaf.shell.console.CompletableFunction, org.apache.karaf.shell.console.commands.BlueprintCommand, org.apache.karaf.shell.commands.CommandWithAction, org.apache.felix.service.command.Function, org.apache.karaf.shell.commands.basic.AbstractCommand] method public java.lang.Object org.apache.karaf.shell.commands.basic.AbstractCommand.execute(org.apache.felix.service.command.CommandSession,java.util.List) throws java.lang.Exception and/or arguments 2014-01-14 12:50:07,960 | ERROR | e ssh user karaf | ShellUtil | 47 - org.apache.karaf.shell.console - 3.0.0 | Exception caught while executing command java.lang.SecurityException: Insufficient credentials. at org.apache.karaf.service.guard.impl.GuardProxyCatalog$ProxyInvocationListener.preInvoke(GuardProxyCatalog.java:527) at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:52) at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119) at org.apache.karaf.shell.console.commands.$BlueprintCommand474733692.execute(Unknown Source)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl$DelegateSession.execute(ConsoleImpl.java:497) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:198) at java.lang.Thread.run(Thread.java:724)[:1.7.0_25] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:118)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:109) at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_25] at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:47)[48:org.apache.karaf.jaas.modules:3.0.0] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.run(ConsoleFactoryService.java:107)[47:org.apache.karaf.shell.console:3.0.0] Paul Spencer -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: Getting a java.lang.SecurityException: Insufficient credentials.” error when executing various commands in Karaf 3.0.0
JB, - The use case is successful in 2.3.x, to this sounds like a regression issue. - Per etc/system.properties, the local user has admin and manage roles. karaf@root() jaas:realm-manage --index 1 karaf@root() jaas:user-list User Name | Group | Role karaf | admingroup | admin karaf | admingroup | manager karaf | admingroup | viewer karaf@root() - The way I am reading etc/org.apache.karaf.command.acl.bundle.cfg, a user in the admin group can “install” a bundle and needs to be in the manager group to “uninstall” without the “-f” option. karaf@root() bundle:uninstall 79 Error executing command: Insufficient credentials. karaf@root() bundle:uninstall -f 79 karaf@root() So why is the “bundle:uninstall” command failing when the local user has the manager role? Paul Spencer On Jan 14, 2014, at 2:29 PM, Jean-Baptiste Onofré j...@nanthrax.net wrote: Hi Paul, take a look in the documentation: http://karaf.apache.org/manual/latest/users-guide/security.html in the console section. You will the explanations about etc/org.apache.karaf.command.acl.scope.cfg files. Regards JB On 01/14/2014 07:14 PM, Paul Spencer wrote: Karaf 3.0.0 running on Apple OSX Maverick (10.9.1) I am getting a java.lang.SecurityException: Insufficient credentials.” error when executing various commands on a newly installed Karaf 3.0.0. The use case below is for uninstalling a bundle. Is there a configuration change I need to make? *** * Use case *** 1) unzipped the distribution 2) Start the Karaf server with bin/start 3) Tail the log file until the JMX OSGi Agent is finished registering objects (about 30 seconds) 4) Start the Karaf client with bin/client 5) Install a bundle 6) Uninstall the newly installed bundle *** * Command output *** karaf@root() install mvn:com.intekon.customer.kc.ewm.web-service/ewm-sap-dist/1.0-SNAPSHOT Bundle ID: 79 karaf@root() uninstall 79 Error executing command: Insufficient credentials. karaf@root() *** * From karaf.log (I can post the full 28K log if necessary) *** 2014-01-14 12:50:07,960 | INFO | e ssh user karaf | GuardProxyCatalog | 42 - org.apache.karaf.service.guard - 3.0.0 | Current user does not have required roles ([manager]) for service [org.apache.karaf.shell.console.CompletableFunction, org.apache.karaf.shell.console.commands.BlueprintCommand, org.apache.karaf.shell.commands.CommandWithAction, org.apache.felix.service.command.Function, org.apache.karaf.shell.commands.basic.AbstractCommand] method public java.lang.Object org.apache.karaf.shell.commands.basic.AbstractCommand.execute(org.apache.felix.service.command.CommandSession,java.util.List) throws java.lang.Exception and/or arguments 2014-01-14 12:50:07,960 | ERROR | e ssh user karaf | ShellUtil | 47 - org.apache.karaf.shell.console - 3.0.0 | Exception caught while executing command java.lang.SecurityException: Insufficient credentials. at org.apache.karaf.service.guard.impl.GuardProxyCatalog$ProxyInvocationListener.preInvoke(GuardProxyCatalog.java:527) at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:52) at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119) at org.apache.karaf.shell.console.commands.$BlueprintCommand474733692.execute(Unknown Source)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl$DelegateSession.execute(ConsoleImpl.java:497) at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:198) at java.lang.Thread.run(Thread.java:724)[:1.7.0_25] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3.doRun(ConsoleFactoryService.java:118)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.karaf.shell.console.impl.jline.ConsoleFactoryService$3$1.run(ConsoleFactoryService.java:109) at java.security.AccessController.doPrivileged(Native Method)[:1.7.0_25] at
Re: fail to install openejb-core on Karaf v3.0
Hello Charles, Do you have any estimation for full openejb integration with karaf ?? Thank you. On Thu, Jan 2, 2014 at 10:10 AM, Charles Moulliard ch0...@gmail.com wrote: Even if you install openejb on Karaf, it will not scan your bundles to find classes annotated and inject them @Stateless, @Singleton, ... KarafEE will be required in this case but until now project has not been integrated as a sub(project) of Karaf. On Thu, Jan 2, 2014 at 4:30 AM, Tom Leung tom.le...@netage.com.hk wrote: Dear all, I started a new Karaf v3.0 instance on Ubuntu v13.04, use the default setting and install the following bundles/features: feature:install war feature:install webconsole feature:repo-add openejb 4.5.2 karaf@root() feature:list | grep openejb org.apache.commons| 0.0.0| | openejb-features| xbean | 3.12 | | openejb-features| org.apache.openwebbeans | 1.1.8| | openejb-features| geronimo-osgi | 1.1 | | openejb-features| org.apache.activemq | 5.7.0| | openejb-features| openjpa | 2.2.0| | openejb-features| openejb-core | 4.5.2| | openejb-features| openejb-server| 4.5.2| | openejb-features| openejb-cxf | 4.5.2| | openejb-features| openejb-rest | 4.5.2| | openejb-features| openejb-soap | 4.5.2| | openejb-features| karaf@root() feature:install openejb-core but, I get the following error: karaf@root() feature:install openejb-core Refreshing bundles org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec (130), org.apache.geronimo.specs.geronimo-jaspic_1.0_spec (84), org.apache.geronimo.specs.geronimo-validation_1.0_spec (242) Error executing command: Could not start bundle mvn:org.apache.geronimo.specs/geronimo-jaxb_2.2_spec/1.0.1 in feature(s) javaee-api-6.0-5: Unresolved constraint in bundle org.apache.geronimo.specs.geronimo-jaxb_2.2_spec [260]: Unable to resolve 260.0: missing requirement [260.0] osgi.wiring.package; ((osgi.wiring.package=javax.xml.namespace)(version=1.0.0)) karaf@root() javax.xml.namespace is missing. Which bundle I should install to resolve the missing dependencies? Best Rgds, Tom -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io
Re: OSGi Compendium APIs
I had gotten the User Admin service working correctly in Karaf 3.0.0. I can get the code pushed up in my github repo if you like, maybe it will help. It's pretty easy to do. Ryan On Jan 14, 2014 7:17 AM, agrz alexander.grze...@medisite.de wrote: Yes, this is what I did to get it running. But I was wondering if there is another way in karaf providing standard osgi apis. This is what I understood reading this post: http://karaf.922171.n3.nabble.com/Newbie-question-Useradmin-service-dependency-from-where-td4026903.html Thanks anyways Alex -- View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999p4031012.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Getting a java.lang.SecurityException: Insufficient credentials.” error when executing various commands in Karaf 3.0.0
Hi Pauln it's not a regression: command, services, and JMX security don't exist at all in 2.3.x, it's a new feature from 3.0.0. The local roles are define in etc/system.properties: karaf.local.roles = admin,manager,viewer It's the roles used by the local console. When you use remote console (via ssh), Karaf use the role of the user. If you take a look on etc/org.apache.karaf.command.acl.bundle.cfg, you can see: uninstall[/.*[-][f].*/] = admin uninstall = manager If you are manager, you can use uninstall for non system bundle (with start level greater than 80, so without requiring the -f option). To uninstall system bundle, you have to be admin (who can use the -f option for system bundle). Regards JB On 01/14/2014 10:34 PM, Paul Spencer wrote: JB, - The use case is successful in 2.3.x, to this sounds like a regression issue. - Per etc/system.properties, the local user has admin and manage roles. karaf@root() jaas:realm-manage --index 1 karaf@root() jaas:user-list User Name | Group | Role karaf | admingroup | admin karaf | admingroup | manager karaf | admingroup | viewer karaf@root() - The way I am reading etc/org.apache.karaf.command.acl.bundle.cfg, a user in the admin group can “install” a bundle and needs to be in the manager group to “uninstall” without the “-f” option. karaf@root() bundle:uninstall 79 Error executing command: Insufficient credentials. karaf@root() bundle:uninstall -f 79 karaf@root() So why is the “bundle:uninstall” command failing when the local user has the manager role? Paul Spencer On Jan 14, 2014, at 2:29 PM, Jean-Baptiste Onofré j...@nanthrax.net wrote: Hi Paul, take a look in the documentation: http://karaf.apache.org/manual/latest/users-guide/security.html in the console section. You will the explanations about etc/org.apache.karaf.command.acl.scope.cfg files. Regards JB On 01/14/2014 07:14 PM, Paul Spencer wrote: Karaf 3.0.0 running on Apple OSX Maverick (10.9.1) I am getting a java.lang.SecurityException: Insufficient credentials.” error when executing various commands on a newly installed Karaf 3.0.0. The use case below is for uninstalling a bundle. Is there a configuration change I need to make? *** * Use case *** 1) unzipped the distribution 2) Start the Karaf server with bin/start 3) Tail the log file until the JMX OSGi Agent is finished registering objects (about 30 seconds) 4) Start the Karaf client with bin/client 5) Install a bundle 6) Uninstall the newly installed bundle *** * Command output *** karaf@root() install mvn:com.intekon.customer.kc.ewm.web-service/ewm-sap-dist/1.0-SNAPSHOT Bundle ID: 79 karaf@root() uninstall 79 Error executing command: Insufficient credentials. karaf@root() *** * From karaf.log (I can post the full 28K log if necessary) *** 2014-01-14 12:50:07,960 | INFO | e ssh user karaf | GuardProxyCatalog | 42 - org.apache.karaf.service.guard - 3.0.0 | Current user does not have required roles ([manager]) for service [org.apache.karaf.shell.console.CompletableFunction, org.apache.karaf.shell.console.commands.BlueprintCommand, org.apache.karaf.shell.commands.CommandWithAction, org.apache.felix.service.command.Function, org.apache.karaf.shell.commands.basic.AbstractCommand] method public java.lang.Object org.apache.karaf.shell.commands.basic.AbstractCommand.execute(org.apache.felix.service.command.CommandSession,java.util.List) throws java.lang.Exception and/or arguments 2014-01-14 12:50:07,960 | ERROR | e ssh user karaf | ShellUtil | 47 - org.apache.karaf.shell.console - 3.0.0 | Exception caught while executing command java.lang.SecurityException: Insufficient credentials. at org.apache.karaf.service.guard.impl.GuardProxyCatalog$ProxyInvocationListener.preInvoke(GuardProxyCatalog.java:527) at org.apache.aries.proxy.impl.ProxyHandler$1.invoke(ProxyHandler.java:52) at org.apache.aries.proxy.impl.ProxyHandler.invoke(ProxyHandler.java:119) at org.apache.karaf.shell.console.commands.$BlueprintCommand474733692.execute(Unknown Source)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[47:org.apache.karaf.shell.console:3.0.0] at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[47:org.apache.karaf.shell.console:3.0.0] at
Re: fail to install openejb-core on Karaf v3.0
Hi Mansour, it's something that we plan for February. Regards JB On 01/14/2014 11:56 PM, Mansour Al Akeel wrote: Hello Charles, Do you have any estimation for full openejb integration with karaf ?? Thank you. On Thu, Jan 2, 2014 at 10:10 AM, Charles Moulliard ch0...@gmail.com wrote: Even if you install openejb on Karaf, it will not scan your bundles to find classes annotated and inject them @Stateless, @Singleton, ... KarafEE will be required in this case but until now project has not been integrated as a sub(project) of Karaf. On Thu, Jan 2, 2014 at 4:30 AM, Tom Leung tom.le...@netage.com.hk wrote: Dear all, I started a new Karaf v3.0 instance on Ubuntu v13.04, use the default setting and install the following bundles/features: feature:install war feature:install webconsole feature:repo-add openejb 4.5.2 karaf@root() feature:list | grep openejb org.apache.commons| 0.0.0| | openejb-features| xbean | 3.12 | | openejb-features| org.apache.openwebbeans | 1.1.8| | openejb-features| geronimo-osgi | 1.1 | | openejb-features| org.apache.activemq | 5.7.0| | openejb-features| openjpa | 2.2.0| | openejb-features| openejb-core | 4.5.2| | openejb-features| openejb-server| 4.5.2| | openejb-features| openejb-cxf | 4.5.2| | openejb-features| openejb-rest | 4.5.2| | openejb-features| openejb-soap | 4.5.2| | openejb-features| karaf@root() feature:install openejb-core but, I get the following error: karaf@root() feature:install openejb-core Refreshing bundles org.apache.geronimo.specs.geronimo-j2ee-management_1.1_spec (130), org.apache.geronimo.specs.geronimo-jaspic_1.0_spec (84), org.apache.geronimo.specs.geronimo-validation_1.0_spec (242) Error executing command: Could not start bundle mvn:org.apache.geronimo.specs/geronimo-jaxb_2.2_spec/1.0.1 in feature(s) javaee-api-6.0-5: Unresolved constraint in bundle org.apache.geronimo.specs.geronimo-jaxb_2.2_spec [260]: Unable to resolve 260.0: missing requirement [260.0] osgi.wiring.package; ((osgi.wiring.package=javax.xml.namespace)(version=1.0.0)) karaf@root() javax.xml.namespace is missing. Which bundle I should install to resolve the missing dependencies? Best Rgds, Tom -- Charles Moulliard Apache Committer / Architect @RedHat Twitter : @cmoulliard | Blog : http://cmoulliard.github.io -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: JPA with Karaf
By the way, reviewing the OpenJPA feature, we found that the problem is in the feature itself. We fix both OpenJPA 2.2.2 and 2.3.0 features for the next Karaf release. Sorry about that. Regards JB On 01/14/2014 10:33 AM, Dutertry Nicolas wrote: Hi, I am trying to use JPA with Karaf 3.0.0 but it does not work. First of all I have installed the following features : karaf@root() feature:install jndi jpa transaction openjpa Then I have created a simple JPA bundle containing: -A HSQLDB datasource configured with blueprint -A JPA entity (class Person) and the file META-INF/persistence.xml -A service for getting and creating people (class PersonService) The JPA EntityManager is injected in PersonService using blueprint. Finally I have deployed hsqldb and my bundle in Karaf, but my bundle’s state is set to “GracePeriod” : karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name - 86 | Active | 80 | 3.0.0 | Apache Karaf :: JNDI :: Command 114 | Active | 80 | 2.3.0 | Apache ServiceMix :: Specs :: Java Persistence API 1.4 115 | Active | 80 | 3.2.1 | Commons Collections 116 | Active | 80 | 1.6.0 | Commons Pool 117 | Active | 80 | 1.4| Commons DBCP 118 | Active | 80 | 2.6| Commons Lang 119 | Active | 80 | 2.3.0 | OpenJPA Aggregate Jar 120 | Active | 80 | 2.3.1 | HSQLDB 121 | GracePeriod | 80 | 1.0.0.SNAPSHOT | Test JPA OSGi Bundle In the log file we found : 2014-01-14 10:04:28,388 | INFO | raf-3.0.0/deploy | BlueprintContainerImpl | 4 - org.apache.aries.blueprint.core - 1.3.0 | Bundle test.jpa is waiting for dependencies [(((org.apache.aries.jpa.proxy.factory=true)(osgi.unit.name=test))(objectClass=javax.persistence.EntityManagerFactory))] I have attached the sources of my bundle and the full karaf log file in this mail. Is there a bug in Karaf or am I missing something ? Thanks for your help. -- Nicolas Dutertry HR Access - http://www.hraccess.com -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Question about Cellar 2.2.2
Hi JB, I used Karaf 2.3.3 and Cellar 2.2.2 I used the below command to install cellar for karaf cluster features:addurl mvn:org.apache.karaf.cellar/apache-karaf-cellar/2.3.2/xml/features features:install cellar But I found the below bundles's status is Uninstalled cellar-dosgi cellar-obr cellar-eventadmin cellar-cloud cellar-webconsole *My question: Do I need to use command features:install to install them? If I didn't install them, Is there anything will be affected in karaf cluster?* thanks -- View this message in context: http://karaf.922171.n3.nabble.com/Question-about-Cellar-2-2-2-tp4031034.html Sent from the Karaf - User mailing list archive at Nabble.com.
Re: Question about Cellar 2.2.2
Hi, Cellar is composed: - by core modules (features, config, bundles cluster support) - and optional modules The optional modules bring new features, not essential for the core behaviour, but they can be interesting for you. cellar-dosgi is an optional module providing Distributed OSGi support. It allows an OSGi service to be available on the cluster and be used (remotely). cellar-obr is an optional module providing support of OSGi Bundle Repository on the cluster. It brings new command like cluster:obr-url-add, cluster:obr-deploy, etc. cellar-eventadmin is an optional module providing the event admin support on the cluster. It broadcasts local admin events (on a node) to the cluster (the other nodes). cellar-cloud is an optional module to use a kind of whiteboard pattern for cloud instance. It doesn't perform any provisioning on cloud, but it allows to discover instances on cloud. cellar-webconsole is an optional module providing additional plugins for the Karaf Webconsole (adding new pages/views in the Karaf WebConsole for Cellar). I will add this description in the Cellar documentation, I think it can be helpful for the users. Regards JB On 01/15/2014 07:08 AM, simafengyun1984 wrote: Hi JB, I used Karaf 2.3.3 and Cellar 2.2.2 I used the below command to install cellar for karaf cluster features:addurl mvn:org.apache.karaf.cellar/apache-karaf-cellar/2.3.2/xml/features features:install cellar But I found the below bundles's status is Uninstalled cellar-dosgi cellar-obr cellar-eventadmin cellar-cloud cellar-webconsole *My question: Do I need to use command features:install to install them? If I didn't install them, Is there anything will be affected in karaf cluster?* thanks -- View this message in context: http://karaf.922171.n3.nabble.com/Question-about-Cellar-2-2-2-tp4031034.html Sent from the Karaf - User mailing list archive at Nabble.com. -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: OSGi Compendium APIs
That would be very helpfull. Even if I got it working too now by including the APIs in the jar. And also the Felix UserAdmin has them now included when building the latest verison from sources. rkmoquin wrote I had gotten the User Admin service working correctly in Karaf 3.0.0. I can get the code pushed up in my github repo if you like, maybe it will help. It's pretty easy to do. -- View this message in context: http://karaf.922171.n3.nabble.com/OSGi-Compendium-APIs-tp4030999p4031036.html Sent from the Karaf - User mailing list archive at Nabble.com.