Hi,

did you take a look at how the jetty.xml configures the handlers?
Cause you might need to tweak your configuration to look alike.
Jetty inside Karaf is working a bit differently since the Jetty Container
is already started and configured.
Therefore your jetty.xml might need to use a different syntax for
configuration.

Another question which version of Karaf are you using?
Cause Pax-Web does support jetty-web.xml only limited depending on the
version used :-/

regards, Achim


2013/1/29 siv vasan <[email protected]>

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



-- 

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

Reply via email to