Hi, Thanks for the reply.

I am using Karaf 2.3.0.

I have declared below service in <karaf-home>/etc/Jetty.xml. I configured
it as per this link(http://wiki.eclipse.org/Jetty/Tutorial/JAAS).

<Call name="addBean">
      <Arg>
        <New class="org.eclipse.jetty.plus.jaas.JAASLoginService">
  <Set name="name">karaf</Set>
          <Set name="loginModuleName">karaf</Set>
  <Set name="roleClassNames">
<Array type="java.lang.String">
  <Item>org.apache.karaf.jaas.boot.principal.RolePrincipal</Item>
</Array>
  </Set>
        </New>
      </Arg>
    </Call>

 It seems to be taking the login service but this is giving class not found
exception for org.apache.karaf.jaas.boot.principal.RolePrincipal- probably
I will post another question for this.




On Wed, Jan 30, 2013 at 6:58 PM, Achim Nierbeck [via Karaf] <
[email protected]> wrote:

> 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 <[hidden 
> email]<http://user/SendEmail.jtp?type=node&node=4027538&i=0>
> >
>
>> 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/>
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://karaf.922171.n3.nabble.com/Karaf-Jetty-is-not-considering-JAAS-configuration-from-context-xml-tp4027521p4027538.html
>  To unsubscribe from Karaf-Jetty is not considering JAAS configuration
> from context xml, click 
> here<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4027521&code=c3Zhc2FudGEudGV6QGdtYWlsLmNvbXw0MDI3NTIxfDMxNDUyNjAxNw==>
> .
> NAML<http://karaf.922171.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




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

Reply via email to