I have a war file with WEB-INF/jetty-web.xml, Basically declaring login
service. This works fine in Standard jetty (Verified on bouth 7 and 8).  
But when i deployed it on Karaf using, 

osgi:install -s
webbundle:file:///C:/Users/xxx/workspace/MyTestApp/target/MyTestApp.war

Deployment fails with below error. On debugging I found that
SecurityHandler.findLoginService() is not loading my CBILDAP loginservice.
It is only loading defaut,  and karaf services form etc/jetty.xml.   How can
i configure it to load login service from my jetty-web.xml


jetty-web.xml content
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC &quot;-//Mort Bay Consulting//DTD
Configure//EN&quot; &quot;http://jetty.mortbay.org/configure.dtd&quot;>
<Configure class="org.eclipse.jetty.webapp.WebAppContext">      
 <Set name="securityHandler"> 
        <New class="org.eclipse.jetty.security.ConstraintSecurityHandler">    
    <Set name="loginService"> 
      <New class="org.eclipse.jetty.plus.jaas.JAASLoginService"> 
            <Set name="name">LDAP</Set>                        
            <Set name="LoginModuleName">LDAP</Set>        
            
            <Set name="RoleClassNames">
                            <Array type="java.lang.String">
                              
<Item>org.apache.karaf.jaas.boot.principal.UserPrincipal</Item>
                              
<Item>org.apache.karaf.jaas.boot.principal.RolePrincipal</Item>
                            </Array>
                        </Set>                   
      </New> 
    </Set> 
    </New>
 </Set>
</Configure>


Error:
org.eclipse.jetty.security.ConstraintSecurityHandler@362a7b:
java.lang.IllegalStateException: No LoginService for
org.eclipse.jetty.security.authentication.FormAuthenticator@1ef158 in
org.eclipse.jetty.security.ConstraintSecurityHandler@362a7b
java.lang.IllegalStateException: No LoginService for
org.eclipse.jetty.security.authentication.FormAuthenticator@1ef158 in
org.eclipse.jetty.security.ConstraintSecurityHandler@362a7b
        at
org.eclipse.jetty.security.authentication.LoginAuthenticator.setConfiguration(LoginAuthenticator.java:45)[65:org.eclipse.jetty.security:7.6.7.v20120910]
        at
org.eclipse.jetty.security.authentication.FormAuthenticator.setConfiguration(FormAuthenticator.java:129)[65:org.eclipse.jetty.security:7.6.7.v20120910]
        at
org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:376)[65:org.eclipse.jetty.security:7.6.7.v20120910]
        at
org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:233)[65:org.eclipse.jetty.security:7.6.7.v20120910]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[58:org.eclipse.jetty.util:7.6.7.v20120910]
        at
org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)[64:org.eclipse.jetty.server:7.6.7.v20120910]
        at
org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:115)[64:org.eclipse.jetty.server:7.6.7.v20120910]
        at
org.eclipse.jetty.server.session.SessionHandler.doStart(SessionHandler.java:120)[64:org.eclipse.jetty.server:7.6.7.v20120910]
        at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)[58:org.eclipse.jetty.util:7.6.7.v20120910]
        at
org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)[64:org.eclipse.jetty.server:7.6.7.v20120910]



--
View this message in context: 
http://karaf.922171.n3.nabble.com/Karaf-Jetty-is-not-considering-JAAS-configuration-from-context-xml-tp4027521.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Reply via email to