Re: Getting a java.lang.SecurityException: Insufficient credentials.” error when executing various commands in Karaf 3.0.0
Hi Paul, This could be an omission on my part. When I worked on the command security I didn't really focus at the client command, but mainly worked with the bin/karaf command and SSH access. I can look into this. Would you like to file a bug for it? In the mean time, if you need the bin/client command to access Karaf, you can use it with the shell commands RBAC disabled. You can disable it by commenting out the following line in etc/system.properties: karaf.secured.services = ((osgi.command.scope=*)(osgi.command.function=*)) Cheers, David On 15 January 2014 12:54, Paul Spencer pau...@apache.org wrote: JB, I have seen the error with other commands while developing a bundle, although I focused on the bundle:uninstall. In addition to connecting to Karaf with ssh, the use case succeeds when connection with bin/karaf. Paul Spencer On Jan 15, 2014, at 7:15 AM, Jean-Baptiste Onofré j...@nanthrax.net wrote: Let me try to reproduce the issue using bin/client. It's weird as bin/client is a ssh client, so it's basically the same as ssh. Did you see the issue with other commands ? I think that the ACL can be enhanced: instead of checking the -f option, it should check the bundle level. It's not so easy as bundle:uninstall accept bundle ID, bundle name, etc. Regards JB On 01/15/2014 12:45 PM, Paul Spencer wrote: JB, If is connect to Karaf vis SSH, the use case works, but if I connect via bin/client the use case fails. Why does the command uninstall without -f generate the log message “Current user does not have required roles ([manager]) for service” when connected to Karaf via bin/client? *** * Role definition in etc/system.properties *** sparrow-2:apache-karaf-3.0.0 paul$ grep local etc/system.properties # Roles to use when logging into a local Karaf console. karaf.local.roles = admin,manager,viewer sparrow-2:apache-karaf-3.0.0 paul$ *** * Log of connecting to Karaf via SSH then bin/client *** sparrow-2:apache-karaf-3.0.0 paul$ ssh karaf@127.0.0.1 -p 8101 Authenticated with partial success. Authenticated with partial success. Password authentication Password: __ __ / //_/ __ _/ __/ / , / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/ /_/ |_|\__,_/_/ \__,_/_/ Apache Karaf (3.0.0) Hit 'tab' for a list of available commands and '[cmd] --help' for help on a specific command. Hit 'system:shutdown' to shutdown Karaf. Hit 'ctrl-d' or type 'logout' to disconnect shell from current session. karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name -- 80 | Installed | 100 | 1.0.0.SNAPSHOT | APMS/EWM SAP File Distribution karaf@root() uninstall 80 karaf@root() install mvn:com.intekon.customer.kc.ewm.web-service/ewm-sap-dist/1.0-SNAPSHOT Bundle ID: 81 karaf@root() uninstall 81 karaf@root() logout Connection to 127.0.0.1 closed. sparrow-2:apache-karaf-3.0.0 paul$ bin/client Logging in as karaf 566 [pool-2-thread-2] WARN org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - Server at /0.0.0.0:8101 presented unverified key: __ __ / //_/ __ _/ __/ / , / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/ /_/ |_|\__,_/_/ \__,_/_/ Apache Karaf (3.0.0) Hit 'tab' for a list of available commands and '[cmd] --help' for help on a specific command. Hit 'system:shutdown' to shutdown Karaf. Hit 'ctrl-d' or type 'logout' to disconnect shell from current session. karaf@root() install mvn:com.intekon.customer.kc.ewm.web-service/ewm-sap-dist/1.0-SNAPSHOT Bundle ID: 82 karaf@root() uninstall 82 Error executing command: Insufficient credentials. karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name -- 82 | Installed | 80 | 1.0.0.SNAPSHOT | APMS/EWM SAP File Distribution karaf@root() logout sparrow-2:apache-karaf-3.0.0 paul$ *** * From data/log/karaf.log *** 2014-01-15 06:34:25,902 | 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-15 06:34:25,902 | ERROR | e ssh user karaf | ShellUtil | 47 - org.apache.karaf.shell.console -
Re: Getting a java.lang.SecurityException: Insufficient credentials.” error when executing various commands in Karaf 3.0.0
Hi David, I started to fix the client (it's not a big deal as it's likely a SSH client). I gonna create the Jira and attach my current patch. Regards JB On 01/16/2014 09:43 AM, David Bosschaert wrote: Hi Paul, This could be an omission on my part. When I worked on the command security I didn't really focus at the client command, but mainly worked with the bin/karaf command and SSH access. I can look into this. Would you like to file a bug for it?LOGGER David, In the mean time, if you need the bin/client command to access Karaf, you can use it with the shell commands RBAC disabled. You can disable it by commenting out the following line in etc/system.properties: karaf.secured.services = ((osgi.command.scope=*)(osgi.command.function=*)) Cheers, David On 15 January 2014 12:54, Paul Spencer pau...@apache.org wrote: JB, I have seen the error with other commands while developing a bundle, although I focused on the bundle:uninstall. In addition to connecting to Karaf with ssh, the use case succeeds when connection with bin/karaf. Paul Spencer On Jan 15, 2014, at 7:15 AM, Jean-Baptiste Onofré j...@nanthrax.net wrote: Let me try to reproduce the issue using bin/client. It's weird as bin/client is a ssh client, so it's basically the same as ssh. Did you see the issue with other commands ? I think that the ACL can be enhanced: instead of checking the -f option, it should check the bundle level. It's not so easy as bundle:uninstall accept bundle ID, bundle name, etc. Regards JB On 01/15/2014 12:45 PM, Paul Spencer wrote: JB, If is connect to Karaf vis SSH, the use case works, but if I connect via bin/client the use case fails. Why does the command uninstall without -f generate the log message “Current user does not have required roles ([manager]) for service” when connected to Karaf via bin/client? *** * Role definition in etc/system.properties *** sparrow-2:apache-karaf-3.0.0 paul$ grep local etc/system.properties # Roles to use when logging into a local Karaf console. karaf.local.roles = admin,manager,viewer sparrow-2:apache-karaf-3.0.0 paul$ *** * Log of connecting to Karaf via SSH then bin/client *** sparrow-2:apache-karaf-3.0.0 paul$ ssh karaf@127.0.0.1 -p 8101 Authenticated with partial success. Authenticated with partial success. Password authentication Password: __ __ / //_/ __ _/ __/ / , / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/ /_/ |_|\__,_/_/ \__,_/_/ Apache Karaf (3.0.0) Hit 'tab' for a list of available commands and '[cmd] --help' for help on a specific command. Hit 'system:shutdown' to shutdown Karaf. Hit 'ctrl-d' or type 'logout' to disconnect shell from current session. karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name -- 80 | Installed | 100 | 1.0.0.SNAPSHOT | APMS/EWM SAP File Distribution karaf@root() uninstall 80 karaf@root() install mvn:com.intekon.customer.kc.ewm.web-service/ewm-sap-dist/1.0-SNAPSHOT Bundle ID: 81 karaf@root() uninstall 81 karaf@root() logout Connection to 127.0.0.1 closed. sparrow-2:apache-karaf-3.0.0 paul$ bin/client Logging in as karaf 566 [pool-2-thread-2] WARN org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - Server at /0.0.0.0:8101 presented unverified key: __ __ / //_/ __ _/ __/ / , / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/ /_/ |_|\__,_/_/ \__,_/_/ Apache Karaf (3.0.0) Hit 'tab' for a list of available commands and '[cmd] --help' for help on a specific command. Hit 'system:shutdown' to shutdown Karaf. Hit 'ctrl-d' or type 'logout' to disconnect shell from current session. karaf@root() install mvn:com.intekon.customer.kc.ewm.web-service/ewm-sap-dist/1.0-SNAPSHOT Bundle ID: 82 karaf@root() uninstall 82 Error executing command: Insufficient credentials. karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name -- 82 | Installed | 80 | 1.0.0.SNAPSHOT | APMS/EWM SAP File Distribution karaf@root() logout sparrow-2:apache-karaf-3.0.0 paul$ *** * From data/log/karaf.log *** 2014-01-15 06:34:25,902 | 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
Re: Bundle not starting : missing requirement
Thanks for the reply. How can i add OSGi bundle for AWS at ServiceMix to my ESB? On Thu, Jan 16, 2014 at 3:58 PM, Jean-Baptiste Onofré j...@nanthrax.netwrote: Hi, It seems that your bundle import AWS. By the way, you have an OSGi bundle for AWS at ServiceMix. Regards JB On 01/16/2014 11:10 AM, Muhzin wrote: Hi, when I am trying to start an osgi bundle I am getting the following error. - start 64 Error executing command: Error starting bundles: Unable to start bundle 64: Unresolved constraint in bundle shamar-queue-consumer-osgi [64]: Unable to resolve 64.0: missing requirement [64.0] osgi.wiring.package; (osgi.wiring.package=com.amazonaws.auth) I've tried to add it by adding the following to the bundle configuration Embed-Dependency com.amazonaws.auth;scope=compile /Embed-Dependency Still no use, can anybody help me to find what I am doing. Sorry i'm new to osgi and karaf so please bear my ignorance . - BR Muhsin -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- BR Muhsin
Re: Bundle not starting : missing requirement
osgi:install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aws-java-sdk/1.6.7_1 Regards JB On 01/16/2014 11:36 AM, Muhzin wrote: Thanks for the reply. How can i add OSGi bundle for AWS at ServiceMix to my ESB? On Thu, Jan 16, 2014 at 3:58 PM, Jean-Baptiste Onofré j...@nanthrax.net mailto:j...@nanthrax.net wrote: Hi, It seems that your bundle import AWS. By the way, you have an OSGi bundle for AWS at ServiceMix. Regards JB On 01/16/2014 11:10 AM, Muhzin wrote: Hi, when I am trying to start an osgi bundle I am getting the following error. - start 64 Error executing command: Error starting bundles: Unable to start bundle 64: Unresolved constraint in bundle shamar-queue-consumer-osgi [64]: Unable to resolve 64.0: missing requirement [64.0] osgi.wiring.package; (osgi.wiring.package=com.__amazonaws.auth) I've tried to add it by adding the following to the bundle configuration Embed-Dependency com.amazonaws.auth;scope=__compile /Embed-Dependency Still no use, can anybody help me to find what I am doing. Sorry i'm new to osgi and karaf so please bear my ignorance . - BR Muhsin -- Jean-Baptiste Onofré jbono...@apache.org mailto:jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- BR Muhsin -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: Bundle not starting : missing requirement
No, it's fine: it's just because AWS requires other bundles to be install first (like commons-codec, commons-lang, etc). Regards JB On 01/16/2014 11:51 AM, Muhzin wrote: There is some issues with the version. Error executing command: Error installing bundles: Unable to start bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aws-java-sdk/1.2.12_1: Unresolved constraint in bundle org.apache.servicemix.bundles.aws-java-sdk [67]: Unable to resolve 67.0: missing requirement [67.0] osgi.wiring.package; ((osgi.wiring.package=org.apache.commons.codec.binary)(version=1.3.0)(!(version=2.0.0))) On Thu, Jan 16, 2014 at 4:12 PM, Jean-Baptiste Onofré j...@nanthrax.net wrote: osgi:install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aws-java-sdk/1.6.7_1 Regards JB On 01/16/2014 11:36 AM, Muhzin wrote: Thanks for the reply. How can i add OSGi bundle for AWS at ServiceMix to my ESB? On Thu, Jan 16, 2014 at 3:58 PM, Jean-Baptiste Onofré j...@nanthrax.net mailto:j...@nanthrax.net wrote: Hi, It seems that your bundle import AWS. By the way, you have an OSGi bundle for AWS at ServiceMix. Regards JB On 01/16/2014 11:10 AM, Muhzin wrote: Hi, when I am trying to start an osgi bundle I am getting the following error. - start 64 Error executing command: Error starting bundles: Unable to start bundle 64: Unresolved constraint in bundle shamar-queue-consumer-osgi [64]: Unable to resolve 64.0: missing requirement [64.0] osgi.wiring.package; (osgi.wiring.package=com.__amazonaws.auth) I've tried to add it by adding the following to the bundle configuration Embed-Dependency com.amazonaws.auth;scope=__compile /Embed-Dependency Still no use, can anybody help me to find what I am doing. Sorry i'm new to osgi and karaf so please bear my ignorance . - BR Muhsin -- Jean-Baptiste Onofré jbono...@apache.org mailto:jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- BR Muhsin -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
Re: Bundle not starting : missing requirement
Thanks JB. On Thu, Jan 16, 2014 at 4:24 PM, Jean-Baptiste Onofré j...@nanthrax.net wrote: No, it's fine: it's just because AWS requires other bundles to be install first (like commons-codec, commons-lang, etc). Regards JB On 01/16/2014 11:51 AM, Muhzin wrote: There is some issues with the version. Error executing command: Error installing bundles: Unable to start bundle mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aws-java-sdk/1.2.12_1: Unresolved constraint in bundle org.apache.servicemix.bundles.aws-java-sdk [67]: Unable to resolve 67.0: missing requirement [67.0] osgi.wiring.package; ((osgi.wiring.package=org.apache.commons.codec.binary)(version=1.3.0)(!(version=2.0.0))) On Thu, Jan 16, 2014 at 4:12 PM, Jean-Baptiste Onofré j...@nanthrax.net wrote: osgi:install -s mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aws-java-sdk/1.6.7_1 Regards JB On 01/16/2014 11:36 AM, Muhzin wrote: Thanks for the reply. How can i add OSGi bundle for AWS at ServiceMix to my ESB? On Thu, Jan 16, 2014 at 3:58 PM, Jean-Baptiste Onofré j...@nanthrax.net mailto:j...@nanthrax.net wrote: Hi, It seems that your bundle import AWS. By the way, you have an OSGi bundle for AWS at ServiceMix. Regards JB On 01/16/2014 11:10 AM, Muhzin wrote: Hi, when I am trying to start an osgi bundle I am getting the following error. - start 64 Error executing command: Error starting bundles: Unable to start bundle 64: Unresolved constraint in bundle shamar-queue-consumer-osgi [64]: Unable to resolve 64.0: missing requirement [64.0] osgi.wiring.package; (osgi.wiring.package=com.__amazonaws.auth) I've tried to add it by adding the following to the bundle configuration Embed-Dependency com.amazonaws.auth;scope=__compile /Embed-Dependency Still no use, can anybody help me to find what I am doing. Sorry i'm new to osgi and karaf so please bear my ignorance . - BR Muhsin -- Jean-Baptiste Onofré jbono...@apache.org mailto:jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- BR Muhsin -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com
JNDI Commands - missing / delimiter in jndi name
Hi If I correctly understand the JNDI Service Specification, each registered service is available under the osgi:service/interface JNDI name Assume following service bean id=dataSource class=org.apache.derby.jdbc.EmbeddedXADataSource property name=databaseName value=test/ property name=createDatabase value=create / /bean service ref=dataSource interface=javax.sql.DataSource service-properties entry key=osgi.jndi.service.name value=jdbc/test/ /service-properties /service This service should be available under following names: * osgi:service/javax.sql.DataSource * osgi:service/javax.sql.DataSourc/(osgi.jndi.service.name=jdbc/test) * osgi:service/jdbc/test I haven't tested in Karaf 3.x yet, if the services can be retrieved using these jndi names and jndi api, but in Karaf 2.3.x in worked for me as I needed it. I assume in Karaf 3.x it works too. But if I use jndi:names command to list the available jndi names I'm getting following result karaf@root() jndi:names JNDI Name | Class Name osgi:service/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl osgi:servicejdbc/test | org.apache.derby.jdbc.EmbeddedXADataSource The command completer gives following result karaf@root() jndi:alias osgi:service osgi:service/jndi osgi:servicejdbc/test I think, the jndi commands have an issue and the / character is missing in the jndi name for services with defined osgi.jndi.service.name property. The service osgi:service/jndi has a correct name but it is registered with osgi.jndi.service.name=/jndi. Best regards Krzysztof -- Krzysztof Sobkowiak JEE OSS Architect | Technical Architect @ Capgemini Capgemini http://www.pl.capgemini.com/ | Software Solutions Center http://www.pl.capgemini-sdm.com/ | Wroclaw e-mail: krzys.sobkow...@gmail.com mailto:krzys.sobkow...@gmail.com | Twitter: @KSobkowiak
Re: Getting a java.lang.SecurityException: Insufficient credentials.” error when executing various commands in Karaf 3.0.0
David, 1) I see JB will file a bug for this issue. 2) The workaround is working for me. Paul Spencer On Jan 16, 2014, at 3:43 AM, David Bosschaert david.bosscha...@gmail.com wrote: Hi Paul, This could be an omission on my part. When I worked on the command security I didn't really focus at the client command, but mainly worked with the bin/karaf command and SSH access. I can look into this. Would you like to file a bug for it? In the mean time, if you need the bin/client command to access Karaf, you can use it with the shell commands RBAC disabled. You can disable it by commenting out the following line in etc/system.properties: karaf.secured.services = ((osgi.command.scope=*)(osgi.command.function=*)) Cheers, David On 15 January 2014 12:54, Paul Spencer pau...@apache.org wrote: JB, I have seen the error with other commands while developing a bundle, although I focused on the bundle:uninstall. In addition to connecting to Karaf with ssh, the use case succeeds when connection with bin/karaf. Paul Spencer On Jan 15, 2014, at 7:15 AM, Jean-Baptiste Onofré j...@nanthrax.net wrote: Let me try to reproduce the issue using bin/client. It's weird as bin/client is a ssh client, so it's basically the same as ssh. Did you see the issue with other commands ? I think that the ACL can be enhanced: instead of checking the -f option, it should check the bundle level. It's not so easy as bundle:uninstall accept bundle ID, bundle name, etc. Regards JB On 01/15/2014 12:45 PM, Paul Spencer wrote: JB, If is connect to Karaf vis SSH, the use case works, but if I connect via bin/client the use case fails. Why does the command uninstall without -f generate the log message “Current user does not have required roles ([manager]) for service” when connected to Karaf via bin/client? *** * Role definition in etc/system.properties *** sparrow-2:apache-karaf-3.0.0 paul$ grep local etc/system.properties # Roles to use when logging into a local Karaf console. karaf.local.roles = admin,manager,viewer sparrow-2:apache-karaf-3.0.0 paul$ *** * Log of connecting to Karaf via SSH then bin/client *** sparrow-2:apache-karaf-3.0.0 paul$ ssh karaf@127.0.0.1 -p 8101 Authenticated with partial success. Authenticated with partial success. Password authentication Password: __ __ / //_/ __ _/ __/ / , / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/ /_/ |_|\__,_/_/ \__,_/_/ Apache Karaf (3.0.0) Hit 'tab' for a list of available commands and '[cmd] --help' for help on a specific command. Hit 'system:shutdown' to shutdown Karaf. Hit 'ctrl-d' or type 'logout' to disconnect shell from current session. karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name -- 80 | Installed | 100 | 1.0.0.SNAPSHOT | APMS/EWM SAP File Distribution karaf@root() uninstall 80 karaf@root() install mvn:com.intekon.customer.kc.ewm.web-service/ewm-sap-dist/1.0-SNAPSHOT Bundle ID: 81 karaf@root() uninstall 81 karaf@root() logout Connection to 127.0.0.1 closed. sparrow-2:apache-karaf-3.0.0 paul$ bin/client Logging in as karaf 566 [pool-2-thread-2] WARN org.apache.sshd.client.keyverifier.AcceptAllServerKeyVerifier - Server at /0.0.0.0:8101 presented unverified key: __ __ / //_/ __ _/ __/ / , / __ `/ ___/ __ `/ /_ / /| |/ /_/ / / / /_/ / __/ /_/ |_|\__,_/_/ \__,_/_/ Apache Karaf (3.0.0) Hit 'tab' for a list of available commands and '[cmd] --help' for help on a specific command. Hit 'system:shutdown' to shutdown Karaf. Hit 'ctrl-d' or type 'logout' to disconnect shell from current session. karaf@root() install mvn:com.intekon.customer.kc.ewm.web-service/ewm-sap-dist/1.0-SNAPSHOT Bundle ID: 82 karaf@root() uninstall 82 Error executing command: Insufficient credentials. karaf@root() list START LEVEL 100 , List Threshold: 50 ID | State | Lvl | Version| Name -- 82 | Installed | 80 | 1.0.0.SNAPSHOT | APMS/EWM SAP File Distribution karaf@root() logout sparrow-2:apache-karaf-3.0.0 paul$ *** * From data/log/karaf.log *** 2014-01-15 06:34:25,902 | 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
Unable to start karaf 3.0.0
I am unable to start the latest version of karaf in my machine. It gives the following stack trace in karaf-home/data/log/karaf.log Jan 17, 2014 9:57:41 AM org.apache.karaf.main.lock.SimpleFileLock lock INFO: Trying to lock /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/lock Jan 17, 2014 9:57:41 AM org.apache.karaf.main.lock.SimpleFileLock lock INFO: Lock acquired Jan 17, 2014 9:57:41 AM org.apache.karaf.main.Main$KarafLockCallback lockAquired INFO: Lock acquired. Setting startlevel to 100 2014-01-17 09:57:41,319 | INFO | FelixStartLevel | Activator | 42 - org.apache.karaf.service.guard - 3.0.0 | Adding role-based security to services with filter: ((osgi.command.scope=*)(osgi.command.function=*)) 2014-01-17 09:57:41,368 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.org.apache.karaf.bundle.cfg 2014-01-17 09:57:41,371 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.cfg 2014-01-17 09:57:41,373 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.java.lang.Memory.cfg 2014-01-17 09:57:41,375 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.features.cfg 2014-01-17 09:57:41,378 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.osgi.compendium.cm.cfg 2014-01-17 09:57:41,380 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.command.acl.kar.cfg 2014-01-17 09:57:41,381 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.command.acl.feature.cfg 2014-01-17 09:57:41,383 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.felix.fileinstall-deploy.cfg 2014-01-17 09:57:41,385 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.management.cfg 2014-01-17 09:57:41,387 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.kar.cfg 2014-01-17 09:57:41,388 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.ops4j.pax.logging.cfg 2014-01-17 09:57:41,390 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.org.apache.karaf.security.jmx.cfg 2014-01-17 09:57:41,392 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.features.repos.cfg 2014-01-17 09:57:41,393 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.features.obr.cfg 2014-01-17 09:57:41,395 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.command.acl.system.cfg 2014-01-17 09:57:41,396 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.command.acl.jaas.cfg 2014-01-17 09:57:41,398 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.command.acl.bundle.cfg 2014-01-17 09:57:41,399 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.jaas.cfg 2014-01-17 09:57:41,401 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.org.apache.karaf.config.cfg 2014-01-17 09:57:41,403 | INFO | FelixStartLevel | fileinstall | 16 -
Re: Unable to start karaf 3.0.0
Hi all, It was due to a corrupt download of karaf distribution.Fixed with new one. On Fri, Jan 17, 2014 at 10:08 AM, Muhzin rmuh...@gmail.com wrote: I am unable to start the latest version of karaf in my machine. It gives the following stack trace in karaf-home/data/log/karaf.log Jan 17, 2014 9:57:41 AM org.apache.karaf.main.lock.SimpleFileLock lock INFO: Trying to lock /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/lock Jan 17, 2014 9:57:41 AM org.apache.karaf.main.lock.SimpleFileLock lock INFO: Lock acquired Jan 17, 2014 9:57:41 AM org.apache.karaf.main.Main$KarafLockCallback lockAquired INFO: Lock acquired. Setting startlevel to 100 2014-01-17 09:57:41,319 | INFO | FelixStartLevel | Activator | 42 - org.apache.karaf.service.guard - 3.0.0 | Adding role-based security to services with filter: ((osgi.command.scope=*)(osgi.command.function=*)) 2014-01-17 09:57:41,368 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.org.apache.karaf.bundle.cfg 2014-01-17 09:57:41,371 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.cfg 2014-01-17 09:57:41,373 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.java.lang.Memory.cfg 2014-01-17 09:57:41,375 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.features.cfg 2014-01-17 09:57:41,378 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.osgi.compendium.cm.cfg 2014-01-17 09:57:41,380 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.command.acl.kar.cfg 2014-01-17 09:57:41,381 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.command.acl.feature.cfg 2014-01-17 09:57:41,383 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.felix.fileinstall-deploy.cfg 2014-01-17 09:57:41,385 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.management.cfg 2014-01-17 09:57:41,387 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.kar.cfg 2014-01-17 09:57:41,388 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.ops4j.pax.logging.cfg 2014-01-17 09:57:41,390 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/jmx.acl.org.apache.karaf.security.jmx.cfg 2014-01-17 09:57:41,392 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.features.repos.cfg 2014-01-17 09:57:41,393 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.features.obr.cfg 2014-01-17 09:57:41,395 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.command.acl.system.cfg 2014-01-17 09:57:41,396 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.command.acl.jaas.cfg 2014-01-17 09:57:41,398 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.command.acl.bundle.cfg 2014-01-17 09:57:41,399 | INFO | FelixStartLevel | fileinstall | 16 - org.apache.felix.fileinstall - 3.2.6 | Installed /home/muhsin/work/Shamar/Queue/apache-karaf-3.0.0/etc/org.apache.karaf.jaas.cfg 2014-01-17 09:57:41,401 | INFO | FelixStartLevel | fileinstall | 16 -
Re: JNDI Commands - missing / delimiter in jndi name
Hi I still don't understand something. Specification says: The URL scheme is specified as follows: service ::= ’osgi:service/’ query query ::= jndi-name | qname ( ’/’ filter )? jndi-name ::= any string Thus the following lookup is valid: osgi:servicelist/javax.sql.DataSource/((db=mydb)(version=3.1)) A service can provide a JNDI service name if it provides the following service property: • osgi.jndi.service.name - An alternative name that the service can be looked up by when the osgi: URL scheme is used. If a service is published with a JNDI service name then the service matches any URL that has this service name in the place of interface. For example, if the JNDI service name is foo, then the following URL selects this service: osgi:service/foo I think, the delimiter / should be added automatically. In this case when my sample configuration defines osgi.jndi.service.name as jdbc/test so I should be able to obtain the service using ctx.lookup(osgi:service/jdbc/test) I should be also able to reference the data source in my persistence using non-jta-data-sourceosgi:service/jdbc/test/non-jta-data-source So, the service is registered in jndi as osgi:service/jdbc/test. When I am wrong at this point please correct me. If the text above is correct, I don't understand why the commands do something other Best regards Krzysztof On 17.01.2014 06:20, Jean-Baptiste Onofré wrote: Hi, You have to use the correct name. You JNDI name should be /jdbc/test. I'm registering the JNDI service with /jndi as name (which is correct). As you don't define the prefix context, the JNDI name is osgi:servicejdbc/test (which is correct as the context is osgi:service). So the JNDI command just display what you provided. In the special case of osgi:service, the command doesn't do a JNDI lookup, it does a service lookup. Regards JB On 01/16/2014 10:04 PM, Krzysztof Sobkowiak wrote: Hi If I correctly understand the JNDI Service Specification, each registered service is available under the osgi:service/interface JNDI name Assume following service bean id=dataSource class=org.apache.derby.jdbc.EmbeddedXADataSource property name=databaseName value=test/ property name=createDatabase value=create / /bean service ref=dataSource interface=javax.sql.DataSource service-properties entry key=osgi.jndi.service.name value=jdbc/test/ /service-properties /service This service should be available under following names: * osgi:service/javax.sql.DataSource * osgi:service/javax.sql.DataSourc/(osgi.jndi.service.name=jdbc/test) * osgi:service/jdbc/test I haven't tested in Karaf 3.x yet, if the services can be retrieved using these jndi names and jndi api, but in Karaf 2.3.x in worked for me as I needed it. I assume in Karaf 3.x it works too. But if I use jndi:names command to list the available jndi names I'm getting following result karaf@root() jndi:names JNDI Name | Class Name osgi:service/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl osgi:servicejdbc/test | org.apache.derby.jdbc.EmbeddedXADataSource The command completer gives following result karaf@root() jndi:alias osgi:service osgi:service/jndi osgi:servicejdbc/test I think, the jndi commands have an issue and the / character is missing in the jndi name for services with defined osgi.jndi.service.name property. The service osgi:service/jndi has a correct name but it is registered with osgi.jndi.service.name=/jndi. Best regards Krzysztof -- Krzysztof Sobkowiak JEE OSS Architect | Technical Architect @ Capgemini Capgemini http://www.pl.capgemini.com/ | Software Solutions Center http://www.pl.capgemini-sdm.com/ | Wroclaw e-mail: krzys.sobkow...@gmail.com mailto:krzys.sobkow...@gmail.com | Twitter: @KSobkowiak
Re: JNDI Commands - missing / delimiter in jndi name
FYI: https://issues.apache.org/jira/browse/KARAF-2690 I will push in around 30mn. Regards JB On 01/17/2014 08:30 AM, Krzysztof Sobkowiak wrote: Hi I still don't understand something. Specification says: The URL scheme is specified as follows: service ::= ’osgi:service/’ query query ::= jndi-name | qname ( ’/’ filter )? jndi-name ::= any string Thus the following lookup is valid: osgi:servicelist/javax.sql.DataSource/((db=mydb)(version=3.1)) A service can provide a JNDI service name if it provides the following service property: • osgi.jndi.service.name - An alternative name that the service can be looked up by when the osgi: URL scheme is used. If a service is published with a JNDI service name then the service matches any URL that has this service name in the place of interface. For example, if the JNDI service name is foo, then the following URL selects this service: osgi:service/foo I think, the delimiter / should be added automatically. In this case when my sample configuration defines osgi.jndi.service.name as jdbc/test so I should be able to obtain the service using ctx.lookup(osgi:service/jdbc/test) I should be also able to reference the data source in my persistence using non-jta-data-sourceosgi:service/jdbc/test/non-jta-data-source So, the service is registered in jndi as osgi:service/jdbc/test. When I am wrong at this point please correct me. If the text above is correct, I don't understand why the commands do something other Best regards Krzysztof On 17.01.2014 06:20, Jean-Baptiste Onofré wrote: Hi, You have to use the correct name. You JNDI name should be /jdbc/test. I'm registering the JNDI service with /jndi as name (which is correct). As you don't define the prefix context, the JNDI name is osgi:servicejdbc/test (which is correct as the context is osgi:service). So the JNDI command just display what you provided. In the special case of osgi:service, the command doesn't do a JNDI lookup, it does a service lookup. Regards JB On 01/16/2014 10:04 PM, Krzysztof Sobkowiak wrote: Hi If I correctly understand the JNDI Service Specification, each registered service is available under the osgi:service/interface JNDI name Assume following service bean id=dataSource class=org.apache.derby.jdbc.EmbeddedXADataSource property name=databaseName value=test/ property name=createDatabase value=create / /bean service ref=dataSource interface=javax.sql.DataSource service-properties entry key=osgi.jndi.service.name value=jdbc/test/ /service-properties /service This service should be available under following names: * osgi:service/javax.sql.DataSource * osgi:service/javax.sql.DataSourc/(osgi.jndi.service.name=jdbc/test) * osgi:service/jdbc/test I haven't tested in Karaf 3.x yet, if the services can be retrieved using these jndi names and jndi api, but in Karaf 2.3.x in worked for me as I needed it. I assume in Karaf 3.x it works too. But if I use jndi:names command to list the available jndi names I'm getting following result karaf@root() jndi:names JNDI Name | Class Name osgi:service/jndi | org.apache.karaf.jndi.internal.JndiServiceImpl osgi:servicejdbc/test | org.apache.derby.jdbc.EmbeddedXADataSource The command completer gives following result karaf@root() jndi:alias osgi:service osgi:service/jndi osgi:servicejdbc/test I think, the jndi commands have an issue and the / character is missing in the jndi name for services with defined osgi.jndi.service.name property. The service osgi:service/jndi has a correct name but it is registered with osgi.jndi.service.name=/jndi. Best regards Krzysztof -- Krzysztof Sobkowiak JEE OSS Architect | Technical Architect @ Capgemini Capgemini http://www.pl.capgemini.com/ | Software Solutions Center http://www.pl.capgemini-sdm.com/ | Wroclaw e-mail: krzys.sobkow...@gmail.com mailto:krzys.sobkow...@gmail.com | Twitter: @KSobkowiak -- Jean-Baptiste Onofré jbono...@apache.org http://blog.nanthrax.net Talend - http://www.talend.com