Karaf
  1. Karaf
  2. KARAF-1709

pax-web-jetty: jetty imports not visible

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: 2.2.6, 2.2.8
    • Fix Version/s: None
    • Component/s: karaf-webcontainer
    • Labels:
      None

      Description

      Original issue [1].
      During security configuration I got exception [2].
      Bundle refresh helps - but until next restart:
      > refresh org.ops4j.pax.web.pax-web-jetty
      Comment from Achim Nierbeck @ [1]:
      Did you try with the latest version of Karaf and Pax Web?
      Is it still an issue.
      If so you might want to ask at Karaf to fix this, cause it's probably more a resolving timing issue
      related to the optional import. So the Karaf features.xml might needs some adjustment to first load the
      jetty-plus bundle and then start the pax-web jetty bundle.
      I just can't switch to non-optional since people using Pax Web standalone might not need the Jaas part.

      1. http://team.ops4j.org/browse/PAXWEB-362
      2. 11:53:02,437 | WARN | qtp753281240-91 | lipse.jetty.util.log.JavaUtilLog 69 | 54 - org.eclipse.jetty.util - 7.5.4.v20111024 | /bonita-server-rest/API/managementAPI/checkUserCredentials/admin
      java.lang.RuntimeException: java.lang.ClassNotFoundException: org.eclipse.jetty.plus.jaas.JAASRole not found by mvn_org.ow2.bonita_bonita-server-rest_5.6.2_war [209]
      at org.eclipse.jetty.plus.jaas.JAASLoginService.getGroups(JAASLoginService.java:306)[67:org.eclipse.jetty.plus:7.5.4.v20111024]
      at org.eclipse.jetty.plus.jaas.JAASLoginService.login(JAASLoginService.java:223)[67:org.eclipse.jetty.plus:7.5.4.v20111024]
      at org.eclipse.jetty.security.authentication.BasicAuthenticator.validateRequest(BasicAuthenticator.java:83)[61:org.eclipse.jetty.security:7.5.4.v20111024]
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:442)[61:org.eclipse.jetty.security:7.5.4.v20111024]
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117)[72:org.ops4j.pax.web.pax-web-jetty:1.0.11]
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)[62:org.eclipse.jetty.servlet:7.5.4.v20111024]
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.eclipse.jetty.server.Server.handle(Server.java:349)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)[56:org.eclipse.jetty.http:7.5.4.v20111024]
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)[56:org.eclipse.jetty.http:7.5.4.v20111024]
      at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)[60:org.eclipse.jetty.server:7.5.4.v20111024]
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[55:org.eclipse.jetty.io:7.5.4.v20111024]
      at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[55:org.eclipse.jetty.io:7.5.4.v20111024]
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[54:org.eclipse.jetty.util:7.5.4.v20111024]
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[54:org.eclipse.jetty.util:7.5.4.v20111024]
      at java.lang.Thread.run(Thread.java:662)[:1.6.0_33]
      Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.plus.jaas.JAASRole not found by mvn_org.ow2.bonita_bonita-server-rest_5.6.2_war [209]
      at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)[org.apache.felix.framework-3.0.9.jar:]
      at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)[org.apache.felix.framework-3.0.9.jar:]
      at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)[org.apache.felix.framework-3.0.9.jar:]
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_33]
      at org.apache.felix.framework.ModuleImpl.getClassByDelegation(ModuleImpl.java:645)[org.apache.felix.framework-3.0.9.jar:]
      at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1619)[org.apache.felix.framework-3.0.9.jar:]
      at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:900)[org.apache.felix.framework-3.0.9.jar:]
      at org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[71:org.ops4j.pax.web.pax-web-runtime:1.0.11]
      at org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:194)[71:org.ops4j.pax.web.pax-web-runtime:1.0.11]
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)[:1.6.0_33]
      at org.eclipse.jetty.plus.jaas.JAASLoginService.getGroups(JAASLoginService.java:294)[67:org.eclipse.jetty.plus:7.5.4.v20111024]
      ... 23 more

        Activity

        Hide
        Freeman Fang added a comment -

        Hi,

        How you install features?
        If you just install http feature which depend jetty feature then the jetty-plus is available so that the pax-web-jetty optional import org.eclipse.jetty.plus.jaas should get picked up automatically.
        Did you use some way else to install those bundles? Or did you change any default configuration?

        Freeman

        Show
        Freeman Fang added a comment - Hi, How you install features? If you just install http feature which depend jetty feature then the jetty-plus is available so that the pax-web-jetty optional import org.eclipse.jetty.plus.jaas should get picked up automatically. Did you use some way else to install those bundles? Or did you change any default configuration? Freeman
        Hide
        Alexey Markevich added a comment -
        • run fresh container;
        • karaf@root> features:install war
        • shutdown container;
        • add security configuration to \apache-karaf-2.2.8\etc\jetty.xml like
          <Call name="addBean">
          <Arg>
          <New class="org.eclipse.jetty.plus.jaas.JAASLoginService">
          <Set name="name">BonitaRESTServer</Set>
          <Set name="loginModuleName">karaf</Set>
          <Set name="roleClassNames">
          <Array type="java.lang.String">
          <Item>org.ow2.bonita.identity.auth.BonitaPrincipalRole</Item>
          </Array>
          </Set>
          </New>
          </Arg>
          </Call>
        • run container again;
        • deploy war which use this security configuration;
        • try to access app context:
          2012-08-06 13:09:07,281 | WARN | qtp343598919-33 | JAASLoginService | 54 - org.eclipse.jetty.util - 7.5.4.v20111024 |
          javax.security.auth.login.FailedLoginException: login failed
          at org.apache.karaf.jaas.modules.properties.PropertiesLoginModule.login(PropertiesLoginModule.java:92)
          at org.apache.karaf.jaas.boot.ProxyLoginModule.login(ProxyLoginModule.java:83)[karaf-jaas-boot.jar:]
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.6.0_33]
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)[:1.6.0_33]
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)[:1.6.0_33]
          at java.lang.reflect.Method.invoke(Method.java:597)[:1.6.0_33]
          at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769)[:1.6.0_33]
          at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186)[:1.6.0_33]
          at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683)[:1.6.0_33]
          at java.security.AccessController.doPrivileged(Native Method)[:1.6.0_33]
          at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680)[:1.6.0_33]
          at javax.security.auth.login.LoginContext.login(LoginContext.java:579)[:1.6.0_33]
          at org.eclipse.jetty.plus.jaas.JAASLoginService.login(JAASLoginService.java:217)[67:org.eclipse.jetty.plus:7.5.4.v20111024]
          at org.eclipse.jetty.security.authentication.BasicAuthenticator.validateRequest(BasicAuthenticator.java:83)[61:org.eclipse.jetty.security:7.5.4.v20111024]
          at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:442)[61:org.eclipse.jetty.security:7.5.4.v20111024]
          at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117)[72:org.ops4j.pax.web.pax-web-jetty:1.0.11]
          at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409)[62:org.eclipse.jetty.servlet:7.5.4.v20111024]
          at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.eclipse.jetty.server.Server.handle(Server.java:349)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582)[56:org.eclipse.jetty.http:7.5.4.v20111024]
          at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218)[56:org.eclipse.jetty.http:7.5.4.v20111024]
          at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)[60:org.eclipse.jetty.server:7.5.4.v20111024]
          at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)[55:org.eclipse.jetty.io:7.5.4.v20111024]
          at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)[55:org.eclipse.jetty.io:7.5.4.v20111024]
          at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)[54:org.eclipse.jetty.util:7.5.4.v20111024]
          at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)[54:org.eclipse.jetty.util:7.5.4.v20111024]
          at java.lang.Thread.run(Thread.java:662)[:1.6.0_33]

        Only after the
        karaf@root> refresh org.ops4j.pax.web.pax-web-jetty
        application is available

        Show
        Alexey Markevich added a comment - run fresh container; karaf@root> features:install war shutdown container; add security configuration to \apache-karaf-2.2.8\etc\jetty.xml like <Call name="addBean"> <Arg> <New class="org.eclipse.jetty.plus.jaas.JAASLoginService"> <Set name="name">BonitaRESTServer</Set> <Set name="loginModuleName">karaf</Set> <Set name="roleClassNames"> <Array type="java.lang.String"> <Item>org.ow2.bonita.identity.auth.BonitaPrincipalRole</Item> </Array> </Set> </New> </Arg> </Call> run container again; deploy war which use this security configuration; try to access app context: 2012-08-06 13:09:07,281 | WARN | qtp343598919-33 | JAASLoginService | 54 - org.eclipse.jetty.util - 7.5.4.v20111024 | javax.security.auth.login.FailedLoginException: login failed at org.apache.karaf.jaas.modules.properties.PropertiesLoginModule.login(PropertiesLoginModule.java:92) at org.apache.karaf.jaas.boot.ProxyLoginModule.login(ProxyLoginModule.java:83) [karaf-jaas-boot.jar:] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [:1.6.0_33] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [:1.6.0_33] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [:1.6.0_33] at java.lang.reflect.Method.invoke(Method.java:597) [:1.6.0_33] at javax.security.auth.login.LoginContext.invoke(LoginContext.java:769) [:1.6.0_33] at javax.security.auth.login.LoginContext.access$000(LoginContext.java:186) [:1.6.0_33] at javax.security.auth.login.LoginContext$4.run(LoginContext.java:683) [:1.6.0_33] at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_33] at javax.security.auth.login.LoginContext.invokePriv(LoginContext.java:680) [:1.6.0_33] at javax.security.auth.login.LoginContext.login(LoginContext.java:579) [:1.6.0_33] at org.eclipse.jetty.plus.jaas.JAASLoginService.login(JAASLoginService.java:217) [67:org.eclipse.jetty.plus:7.5.4.v20111024] at org.eclipse.jetty.security.authentication.BasicAuthenticator.validateRequest(BasicAuthenticator.java:83) [61:org.eclipse.jetty.security:7.5.4.v20111024] at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:442) [61:org.eclipse.jetty.security:7.5.4.v20111024] at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:941) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:117) [72:org.ops4j.pax.web.pax-web-jetty:1.0.11] at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:409) [62:org.eclipse.jetty.servlet:7.5.4.v20111024] at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:186) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:875) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.eclipse.jetty.server.Server.handle(Server.java:349) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:919) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:582) [56:org.eclipse.jetty.http:7.5.4.v20111024] at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218) [56:org.eclipse.jetty.http:7.5.4.v20111024] at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51) [60:org.eclipse.jetty.server:7.5.4.v20111024] at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586) [55:org.eclipse.jetty.io:7.5.4.v20111024] at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44) [55:org.eclipse.jetty.io:7.5.4.v20111024] at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598) [54:org.eclipse.jetty.util:7.5.4.v20111024] at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533) [54:org.eclipse.jetty.util:7.5.4.v20111024] at java.lang.Thread.run(Thread.java:662) [:1.6.0_33] Only after the karaf@root> refresh org.ops4j.pax.web.pax-web-jetty application is available
        Show
        Alexey Markevich added a comment - https://issues.apache.org/jira/browse/KARAF-1305

          People

          • Assignee:
            Unassigned
            Reporter:
            Alexey Markevich
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development