[ 
https://issues.apache.org/jira/browse/KARAF-344?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12976348#action_12976348
 ] 

Andreas Pieber commented on KARAF-344:
--------------------------------------

Ok I've tested your bundle on my machine:

-> % uname -a
Linux coprime 2.6.36-ARCH #1 SMP PREEMPT Fri Dec 10 20:32:37 CET 2010 x86_64 
Intel(R) Core(TM) i7 CPU L 620 @ 2.00GHz GenuineIntel GNU/Linux

-> % mvn --version
Apache Maven 3.0.1 (r1038046; 2010-11-23 11:58:32+0100)
Java version: 1.6.0_23
Java home: /opt/java/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.36-arch" arch: "amd64" Family: "unix"

I've tested it against an empty, freshly build karaf from 2.1.x branch and 
trunk; I've to change your imports to the following to avoid a package not 
found exception:

org.apache.karaf.jaas.modules.properties;version="[2.1.2,3)",
*

BUT, after removing this it works like a charm (on 2.1.x and trunk).

Can you please

1) try to also change your import (if this fixes it then it could be a reload 
problem I think)
2) if 1) does not work: can you try to test it against an empty karaf (I've 
seen Bundle id > 300 in your comment); then I'll need a more complex 
environment to reproduce the problem
3) if 1) and 2) does not work: can you try to run against trunk/2.1.x? Maybe 
it's already fixed

Thanks and kind regards,
andreas

> Deploying a new JAAS config requires to restart the framework
> -------------------------------------------------------------
>
>                 Key: KARAF-344
>                 URL: https://issues.apache.org/jira/browse/KARAF-344
>             Project: Karaf
>          Issue Type: Bug
>    Affects Versions: 2.1.2
>         Environment: Apache Maven 2.2.1 (r801777; 2009-08-06 16:16:01-0300)
> Java version: 1.6.0_22
> Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
> Default locale: en_US, platform encoding: MacRoman
> OS name: "mac os x" version: "10.6.5" arch: "x86_64" Family: "mac"
>            Reporter: Rafael Marins
>            Assignee: Andreas Pieber
>             Fix For: 2.1.3, 2.2.0
>
>         Attachments: jaas-config-requires-restart.zip
>
>
> The JAAS realm cannot be used just after a fresh deployment of the JAAS 
> config blueprint xml. The framework needs to be restarted.
> I've prepared the attached project to test this behavior. You can build and 
> simply follow the steps:
> ka...@root> osgi:install \-s 
> mvn:org.neociclo.samples.karaf/jaas-config-requires-restart/1.0-SNAPSHOT
> Bundle ID: 330
> ka...@root> nc:jaaslogin user pwd
> org.osgi.service.blueprint.container.ServiceUnavailableException: Service is 
> unavailable
>       at 
> org.apache.aries.blueprint.container.ReferenceListRecipe$ServiceDispatcher.call(ReferenceListRecipe.java:201)
>       at 
> org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe$CgLibProxyFactory$1.loadObject(AbstractServiceReferenceRecipe.java:652)
>       at 
> org.apache.karaf.jaas.config.JaasRealm$$EnhancerByCGLIB$$59154.getName(<generated>)
>       at 
> org.apache.karaf.jaas.config.impl.OsgiConfiguration.getAppConfigurationEntry(OsgiConfiguration.java:52)
>       at javax.security.auth.login.LoginContext.init(LoginContext.java:243)
>       at javax.security.auth.login.LoginContext.<init>(LoginContext.java:367)
>       at javax.security.auth.login.LoginContext.<init>(LoginContext.java:444)
>       at 
> org.neociclo.samples.karaf.JaasLoginShellCommand.doExecute(JaasLoginShellCommand.java:41)
>       at 
> org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)
>       at 
> org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
>       at 
> org.apache.felix.gogo.runtime.shell.CommandProxy.execute(CommandProxy.java:50)
>       at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:229)
>       at 
> org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:162)
>       at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:101)
>       at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:79)
>       at 
> org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71)
>       at org.apache.karaf.shell.console.jline.Console.run(Console.java:169)
>       at java.lang.Thread.run(Thread.java:680)
> Failed to load LoginContext for realm=nctestka...@root> shutdown
> localhost:karaf rmarins$ ./bin/karaf 
>         __ __                  ____      
>        / //_/____ __________ _/ __/      
>       / ,<  / __ `/ ___/ __ `/ /_        
>      / /| |/ /_/ / /  / /_/ / __/        
>     /_/ |_|\__,_/_/   \__,_/_/         
>   Apache Karaf (2.1.2)
> Hit '<tab>' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit '<ctrl-d>' or 'osgi:shutdown' to shutdown Karaf.
> ka...@root> nc:jaaslogin user pwd
> javax.security.auth.login.FailedLoginException: User user does not exist
>       at 
> org.apache.karaf.jaas.modules.properties.PropertiesLoginModule.login(PropertiesLoginModule.java:97)
>       at 
> org.apache.karaf.jaas.boot.ProxyLoginModule.login(ProxyLoginModule.java:83)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>       at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>       at java.lang.reflect.Method.invoke(Method.java:597)
>       at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)
>       at 
> javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)
>       at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)
>       at java.security.AccessController.doPrivileged(Native Method)
>       at 
> javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)
>       at javax.security.auth.login.LoginContext.login(LoginContext.java:579)
>       at 
> org.neociclo.samples.karaf.JaasLoginShellCommand.doExecute(JaasLoginShellCommand.java:61)
>       at 
> org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)
>       at 
> org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
>       at 
> org.apache.felix.gogo.runtime.shell.CommandProxy.execute(CommandProxy.java:50)
>       at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:229)
>       at 
> org.apache.felix.gogo.runtime.shell.Closure.executeStatement(Closure.java:162)
>       at org.apache.felix.gogo.runtime.shell.Pipe.run(Pipe.java:101)
>       at org.apache.felix.gogo.runtime.shell.Closure.execute(Closure.java:79)
>       at 
> org.apache.felix.gogo.runtime.shell.CommandSessionImpl.execute(CommandSessionImpl.java:71)
>       at org.apache.karaf.shell.console.jline.Console.run(Console.java:169)
>       at java.lang.Thread.run(Thread.java:680)
> Login failed
> ka...@root> nc:jaaslogin karaf karaf
> Login succeed for realm=nctest, user=karaf
> ka...@root>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to