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
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.