3 Replies Latest reply on Jul 8, 2011 9:51 AM by Michael Grom

    jetty with LDAP JAAS - class not found: org.apache.karaf.jaas.modules.RoleP

    Michael Grom Newbie

      Dear Forum,

       

      struggling with an authenticated jetty endpoint from a blueprint context, I encounter a problem that one of the classes used according to the example I found on the net is not being found in the classpath, despite the package being mentioned in the manifest.

       

      Caused by: java.lang.ClassNotFoundException: org.apache.karaf.jaas.modules.RolePrincipal

       

      The class is contained in org.apache.karaf.jaas.modules-2.2.0-fuse-00-39.jar and I don't know which bundle to install/start to have it exported.

       

      Please see my pom and blueprint.xml attached - If anyone knows what's going wrong and how to fix it, please let me know.

       

      Kind regards,

      Michael

        • 1. Re: jetty with LDAP JAAS - class not found: org.apache.karaf.jaas.modules.RoleP
          Freeman(Yue) Fang Master

          Hi,

           

          By default org.apache.karaf.jaas.modules-2.2.0-fuse-00-39.jar already get installed, you can use

          osgi:list -t 0

          to see if it's already there

          Apache Karaf :: JAAS :: Modules (2.2.0.fuse-00-39)

           

          And use packages:exports |grep org.apache.karaf.jaas.modules

          you can check if this package get exported.

           

          Freeman

          • 2. Re: jetty with LDAP JAAS - class not found: org.apache.karaf.jaas.modules.RoleP
            Michael Grom Newbie

            Hi!

            Yes, it's created, but doesn't seem to be picked up by the camel bundle under blueprint. The package / class is only mentionend in the blueprint XML, not in code.

             

            karaf@root> osgi:list -t 0|grep JAAS

              29 Active     Created        30 Apache Karaf :: JAAS :: Modules (2.2.0.fuse-00-39)

              34 Active     Created        30 Apache Karaf :: JAAS :: Config (2.2.0.fuse-00-39)

            karaf@root> packages:exports 29

            ID Packages

            29 org.apache.karaf.jaas.modules.properties; version=2.2.0.fuse-00-39

            29 org.apache.karaf.jaas.modules.jdbc; version=2.2.0.fuse-00-39

            29 org.apache.karaf.jaas.modules.encryption; version=2.2.0.fuse-00-39

            29 org.apache.karaf.jaas.modules; version=2.2.0.fuse-00-39

            29 org.apache.karaf.jaas.modules.osgi; version=2.2.0.fuse-00-39

            29 org.apache.karaf.jaas.modules.ldap; version=2.2.0.fuse-00-39

            karaf@root>

            -


            in the POM:

            <Import-Package>*,org.apache.karaf.jaas.modules

             

            kind regards

            Michael

            • 3. Re: jetty with LDAP JAAS - class not found: org.apache.karaf.jaas.modules.RoleP
              Michael Grom Newbie

              Hello,

              I probably got closer. The configured class org.apache.karaf.jaas.modules.RolePrincipal will be instantiated by a class org.eclipse.jetty.plus.jaas.JAASLoginService, which probably resides in the Jetty Plus bundle, which does not import the org.apache.karaf.jaas.modules package.

               

              -


              15:41:20,510 | INFO  | rint Extender: 1 | BlueprintCamelContext            | 76

              • org.apache.camel.camel-core - 2.7.1.fuse-00-39 | Apache Camel 2.7.1-fuse-00-39

              (CamelContext: 250-camel-21) started in 0.282 seconds

              15:41:25,494 | WARN  | qtp13238995-2164 | log                              | 114

              - org.eclipse.jetty.util - 7.4.1.v20110513 | /myservice?grok

              java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.karaf.j

              aas.modules.RolePrincipal

              at org.eclipse.jetty.plus.jaas.JAASLoginService.getGroups(JAASLoginServi

              ce.java:279)115:org.eclipse.jetty.plus:7.4.1.v20110513

              at org.eclipse.jetty.plus.jaas.JAASLoginService.login(JAASLoginService.j

              ava:209)115:org.eclipse.jetty.plus:7.4.1.v20110513

              at org.eclipse.jetty.security.authentication.BasicAuthenticator.validate

              Request(BasicAuthenticator.java:77)[112:org.eclipse.jetty.security:7.4.1.v201105

              13]

              at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.jav

              a:439)112:org.eclipse.jetty.security:7.4.1.v20110513

              at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper

              .java:110)109:org.eclipse.jetty.server:7.4.1.v20110513

              at org.eclipse.jetty.server.Server.handle(Server.java:346)[109:org.eclip

              se.jetty.server:7.4.1.v20110513]

              at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.

              java:589)109:org.eclipse.jetty.server:7.4.1.v20110513

              at org.eclipse.jetty.server.HttpConnection$RequestHandler.headerComplete

              (HttpConnection.java:1048)109:org.eclipse.jetty.server:7.4.1.v20110513

              at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:601)[107:

              org.eclipse.jetty.http:7.4.1.v20110513]

              at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:214)

              107:org.eclipse.jetty.http:7.4.1.v20110513

              at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:41

              1)109:org.eclipse.jetty.server:7.4.1.v20110513

              at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEn

              dPoint.java:531)111:org.eclipse.jetty.io:7.4.1.v20110513

              at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEnd

              Point.java:40)111:org.eclipse.jetty.io:7.4.1.v20110513

              at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool

              .java:529)114:org.eclipse.jetty.util:7.4.1.v20110513

              at java.lang.Thread.run(Thread.java:662):1.6.0_26

              Caused by: java.lang.ClassNotFoundException: org.apache.karaf.jaas.modules.RoleP

              rincipal

              at java.net.URLClassLoader$1.run(URLClassLoader.java:202):1.6.0_26

              at java.security.AccessController.doPrivileged(Native Method):1.6.0_26

               

              at java.net.URLClassLoader.findClass(URLClassLoader.java:190):1.6.0_26

               

              at java.lang.ClassLoader.loadClass(ClassLoader.java:306):1.6.0_26

              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)[:1.6.0_

              26]

              at java.lang.ClassLoader.loadClass(ClassLoader.java:247):1.6.0_26

              at org.eclipse.jetty.plus.jaas.JAASLoginService.getGroups(JAASLoginServi

              ce.java:267)115:org.eclipse.jetty.plus:7.4.1.v20110513

              ... 14 more

              -


               

              -


              karaf@root> packages:exports 115

                  ID Packages

                 115 org.eclipse.jetty.plus.annotation; version=7.4.1.v20110513

                 115 org.eclipse.jetty.plus.jaas; version=7.4.1.v20110513

                 115 org.eclipse.jetty.plus.jaas.callback; version=7.4.1.v20110513

                 115 org.eclipse.jetty.plus.jaas.spi; version=7.4.1.v20110513

                 115 org.eclipse.jetty.plus.jndi; version=7.4.1.v20110513

                 115 org.eclipse.jetty.plus.security; version=7.4.1.v20110513

                 115 org.eclipse.jetty.plus.servlet; version=7.4.1.v20110513

                 115 org.eclipse.jetty.plus.webapp; version=7.4.1.v20110513

              karaf@root> packages:imports 115

              System Bundle (0): javax.naming; version=0.0.0

              System Bundle (0): javax.naming.directory; version=0.0.0

              System Bundle (0): javax.security.auth; version=0.0.0

              System Bundle (0): javax.security.auth.callback; version=0.0.0

              System Bundle (0): javax.security.auth.login; version=0.0.0

              System Bundle (0): javax.security.auth.spi; version=0.0.0

              System Bundle (0): javax.sql; version=0.0.0

              Apache Aries Transaction Manager (48): javax.transaction; version=1.1.0

              Jetty :: JNDI Naming (105): org.eclipse.jetty.jndi; version=7.4.1.v20110513

              Jetty :: JNDI Naming (105): org.eclipse.jetty.jndi.local; version=7.4.1.v20110513

              Jetty :: Http Utility (107): org.eclipse.jetty.http.security; version=7.4.1.v20110513

              Jetty :: Server Core (109): org.eclipse.jetty.server; version=7.4.1.v20110513

              Jetty :: Servlet Handling (110): org.eclipse.jetty.servlet; version=7.4.1.v20110513

              Jetty :: Servlet Handling (110): org.eclipse.jetty.servlet.api; version=7.4.1.v20110513

              Jetty :: Security (112): org.eclipse.jetty.security; version=7.4.1.v20110513

              Jetty :: XML utilities (113): org.eclipse.jetty.xml; version=7.4.1.v20110513

              Jetty :: Utilities (114): org.eclipse.jetty.util; version=7.4.1.v20110513

              Jetty :: Utilities (114): org.eclipse.jetty.util.component; version=7.4.1.v20110513

              Jetty :: Utilities (114): org.eclipse.jetty.util.log; version=7.4.1.v20110513

              Jetty :: Utilities (114): org.eclipse.jetty.util.resource; version=7.4.1.v20110513

              Jetty :: Webapp Application Support (118): org.eclipse.jetty.webapp; version=7.4.1.v20110513

              Servlet 3.0 (169): javax.servlet; version=2.6.0

              Servlet 3.0 (169): javax.servlet; version=3.0.0

              karaf@root>

              -


              dyn:dynamic-import on the Jetty Plus bundle did not help either ..

               

              Kind regards

              Michael