You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Ubaldo Taladríz <ut...@exe.cl> on 2015/02/13 20:41:42 UTC

Unable to find LoginModuleImpl class in Apache Karaf 3.0.3

Hi, i'm trying to use jackrabbit oak 1.0.11 in Apache Karaf 3.0.3 (JDK 1.8)

I implemented a little Service to test the installation but i'm getting
this error when i try to invoke repository.login() to get the jcr session.
I tried with simple and guest credentials.

unable to find LoginModule class:
org.apache.jackrabbit.oak.security.authentication.LoginModuleImpl

This is part of the blueprint

     <bean id="serviceBean" class="cl.exe.oak.OakServiceImpl"
init-method="init" destroy-method="destroy">

         <property name="repository" ref="repository"/>

    </bean>

    <service ref="serviceBean" interface="cl.exe.oak.OakService" >

    </service>

    <reference id="repository" interface="javax.jcr.Repository"/>

This is the java method used invoked in the test

 public String test() {

    try {

//Session session = repository.login( new SimpleCredentials("admin",
"admin".toCharArray()));

Session session = repository.login(new GuestCredentials() );

Node hello = session.getRootNode().addNode("hello");

hello.setProperty("message", message);

session.save();

session.getProperty("/hello/message").getString();

} catch (Exception e){

e.printStackTrace();

}

}

This is the bundle list

230 | Active   |  80 | 15.0.0                             | Guava: Google
Core Libraries for Java

231 | Active   |  80 | 2.0                                | Content
Repository for JavaTM Technology API

232 | Active   |  80 | 2.4.0                              | Commons IO


233 | Active   |  80 | 2.8.0                              | Apache
Jackrabbit API

234 | Active   |  80 | 2.8.0                              | Jackrabbit JCR
Commons

235 | Active   |  80 | 1.0.11                             | Oak MicroKernel
API

236 | Active   |  80 | 1.0.11                             | Oak Commons


237 | Active   |  80 | 1.0.11                             | Oak Blob Store


238 | Active   |  80 | 1.0.11                             | Oak Core


239 | Active   |  80 | 1.0.11                             | Oak MicroKernel


240 | Active   |  80 | 1.0.11                             | Oak JCR Binding



This is the component list

karaf@root()>    scr:list

ID | State       | Component Name


-------------------------------------------------------------------------------------------------------

5  | UNSATISFIED | org.apache.jackrabbit.oak.spi.blob.FileBlobStore


6  | ACTIVE      |
org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider

7  | ACTIVE      |
org.apache.jackrabbit.oak.security.authorization.restriction.RestrictionProviderImpl

8  | ACTIVE      |
org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider


9  | UNSATISFIED |
org.apache.jackrabbit.oak.plugins.blob.datastore.S3DataStore


10 | ACTIVE      |
org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl


11 | ACTIVE      |
org.apache.jackrabbit.oak.security.user.UserConfigurationImpl


12 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.name.NamespaceEditorProvider


13 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.index.reference.ReferenceIndexProvider


14 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexEditorProvider

15 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexProvider


16 | ACTIVE      |
org.apache.jackrabbit.oak.security.principal.PrincipalConfigurationImpl


17 | ACTIVE      | org.apache.jackrabbit.oak.cache.ConsolidatedCacheStats


18 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexProvider


19 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.index.nodetype.NodeTypeIndexProvider


20 | ACTIVE      |
org.apache.jackrabbit.oak.security.privilege.PrivilegeConfigurationImpl


21 | ACTIVE      |
org.apache.jackrabbit.oak.security.authentication.AuthenticationConfigurationImpl


22 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService


23 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.version.VersionEditorProvider


24 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider


25 | UNSATISFIED |
org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService


26 | ACTIVE      | org.apache.jackrabbit.oak.security.SecurityProviderImpl


27 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider


28 | UNSATISFIED |
org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore


29 | UNSATISFIED |
org.apache.jackrabbit.oak.plugins.blob.datastore.DbDataStore


30 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.name.NameValidatorProvider


31 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider


32 | ACTIVE      |
org.apache.jackrabbit.oak.plugins.itemsave.ItemSaveValidatorProvider


33 | ACTIVE      |
org.apache.jackrabbit.oak.security.authentication.token.TokenConfigurationImpl


34 | UNSATISFIED | org.apache.jackrabbit.mk.osgi.MicroKernelService


35 | ACTIVE      | org.apache.jackrabbit.oak.jcr.osgi.RepositoryManager

Any suggestion or helo will be appreciated

Thans and regards

-- 
------------------------------
Ubaldo Taladriz Truan
EXE
-------------------------------
Huérfanos 1052, Piso 8, Santiago, Chile
Twitter: @utaladriz
http://www.exe.cl   http://www.eltestacido.cl http://u
<http://cochimin.bligoo.cl>baldo.cl
Skype: utaladriz
Fono:   (+56 2) 27581801
Central:(+56 2) 27581800
Fax:     (+56 2) 2234 4476
Movil:   (+56 9) 988 57259
Código Postal : 8320214

Re: Unable to find LoginModuleImpl class in Apache Karaf 3.0.3

Posted by Ubaldo Taladríz <ut...@exe.cl>.
Finally it works.

For Apache Karaf 3.0.3 these are the bundles installed:

bundle:install -s mvn:com.google.guava/guava/15.0
bundle:install -s mvn:javax.jcr/jcr/2.0
bundle:install -s mvn:commons-io/commons-io/2.4
bundle:install -s mvn:org.apache.jackrabbit/jackrabbit-api/2.8.0
bundle:install -s mvn:org.apache.jackrabbit/jackrabbit-jcr-commons/2.8.0
bundle:install -s mvn:org.apache.jackrabbit/oak-mk-api/1.0.11
bundle:install -s mvn:org.apache.jackrabbit/oak-commons/1.0.11
bundle:install -s mvn:org.apache.jackrabbit/oak-blob/1.0.11
bundle:install -s mvn:org.apache.jackrabbit/oak-core/1.0.11
bundle:install -s mvn:org.apache.jackrabbit/oak-mk/1.0.11
bundle:install -s mvn:org.apache.jackrabbit/oak-jcr/1.0.11


The repository is a reference in the blueprint xml.

 <reference id="repository" interface="javax.jcr.Repository"/>

The solution (I thougth  this issue was solved), but the trick is to change
the classloader

Session session;

    try {

            Thread thread = Thread.currentThread();

            ClassLoader loader = thread.getContextClassLoader();

            try {

                thread.setContextClassLoader(Oak.class.getClassLoader());

                session= repository.login(new SimpleCredentials("admin",
"admin".toCharArray()));

            } finally {

                thread.setContextClassLoader(loader);

            }



            Node hello = null;

            try {

            hello = session.getRootNode().getNode("hello");

            hello.remove();

            session.save();

            }

            catch (Exception ex){

            //Ignore

            }

 hello = session.getRootNode().addNode("hello");

 hello.setProperty("message", message);

 session.save();

 session.getProperty("/hello/message").getString();


 // Update

 session.getNode("/hello").setProperty("message", "Hello, World!");

 session.save();

 } catch (Exception e){

 e.printStackTrace();

 }


Thanks and regards




2015-02-13 16:41 GMT-03:00 Ubaldo Taladríz <ut...@exe.cl>:

> Hi, i'm trying to use jackrabbit oak 1.0.11 in Apache Karaf 3.0.3 (JDK 1.8)
>
> I implemented a little Service to test the installation but i'm getting
> this error when i try to invoke repository.login() to get the jcr session.
> I tried with simple and guest credentials.
>
> unable to find LoginModule class:
> org.apache.jackrabbit.oak.security.authentication.LoginModuleImpl
>
> This is part of the blueprint
>
>      <bean id="serviceBean" class="cl.exe.oak.OakServiceImpl"
> init-method="init" destroy-method="destroy">
>
>          <property name="repository" ref="repository"/>
>
>     </bean>
>
>     <service ref="serviceBean" interface="cl.exe.oak.OakService" >
>
>     </service>
>
>     <reference id="repository" interface="javax.jcr.Repository"/>
>
> This is the java method used invoked in the test
>
>  public String test() {
>
>     try {
>
> //Session session = repository.login( new SimpleCredentials("admin",
> "admin".toCharArray()));
>
> Session session = repository.login(new GuestCredentials() );
>
> Node hello = session.getRootNode().addNode("hello");
>
> hello.setProperty("message", message);
>
> session.save();
>
> session.getProperty("/hello/message").getString();
>
> } catch (Exception e){
>
> e.printStackTrace();
>
> }
>
> }
>
> This is the bundle list
>
> 230 | Active   |  80 | 15.0.0                             | Guava: Google
> Core Libraries for Java
>
> 231 | Active   |  80 | 2.0                                | Content
> Repository for JavaTM Technology API
>
> 232 | Active   |  80 | 2.4.0                              | Commons IO
>
>
> 233 | Active   |  80 | 2.8.0                              | Apache
> Jackrabbit API
>
> 234 | Active   |  80 | 2.8.0                              | Jackrabbit JCR
> Commons
>
> 235 | Active   |  80 | 1.0.11                             | Oak
> MicroKernel API
>
> 236 | Active   |  80 | 1.0.11                             | Oak Commons
>
>
> 237 | Active   |  80 | 1.0.11                             | Oak Blob Store
>
>
> 238 | Active   |  80 | 1.0.11                             | Oak Core
>
>
> 239 | Active   |  80 | 1.0.11                             | Oak
> MicroKernel
>
> 240 | Active   |  80 | 1.0.11                             | Oak JCR
> Binding
>
>
> This is the component list
>
> karaf@root()>    scr:list
>
> ID | State       | Component Name
>
>
>
> -------------------------------------------------------------------------------------------------------
>
> 5  | UNSATISFIED | org.apache.jackrabbit.oak.spi.blob.FileBlobStore
>
>
> 6  | ACTIVE      |
> org.apache.jackrabbit.oak.spi.security.user.action.DefaultAuthorizableActionProvider
>
> 7  | ACTIVE      |
> org.apache.jackrabbit.oak.security.authorization.restriction.RestrictionProviderImpl
>
> 8  | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.index.reference.ReferenceEditorProvider
>
>
> 9  | UNSATISFIED |
> org.apache.jackrabbit.oak.plugins.blob.datastore.S3DataStore
>
>
> 10 | ACTIVE      |
> org.apache.jackrabbit.oak.security.authorization.AuthorizationConfigurationImpl
>
>
> 11 | ACTIVE      |
> org.apache.jackrabbit.oak.security.user.UserConfigurationImpl
>
>
> 12 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.name.NamespaceEditorProvider
>
>
> 13 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.index.reference.ReferenceIndexProvider
>
>
> 14 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexEditorProvider
>
> 15 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexProvider
>
>
> 16 | ACTIVE      |
> org.apache.jackrabbit.oak.security.principal.PrincipalConfigurationImpl
>
>
> 17 | ACTIVE      | org.apache.jackrabbit.oak.cache.ConsolidatedCacheStats
>
>
> 18 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.index.property.OrderedPropertyIndexProvider
>
>
> 19 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.index.nodetype.NodeTypeIndexProvider
>
>
> 20 | ACTIVE      |
> org.apache.jackrabbit.oak.security.privilege.PrivilegeConfigurationImpl
>
>
> 21 | ACTIVE      |
> org.apache.jackrabbit.oak.security.authentication.AuthenticationConfigurationImpl
>
>
> 22 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService
>
>
> 23 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.version.VersionEditorProvider
>
>
> 24 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider
>
>
> 25 | UNSATISFIED |
> org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService
>
>
> 26 | ACTIVE      | org.apache.jackrabbit.oak.security.SecurityProviderImpl
>
>
> 27 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.index.property.PropertyIndexEditorProvider
>
>
> 28 | UNSATISFIED |
> org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore
>
>
> 29 | UNSATISFIED |
> org.apache.jackrabbit.oak.plugins.blob.datastore.DbDataStore
>
>
> 30 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.name.NameValidatorProvider
>
>
> 31 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.nodetype.TypeEditorProvider
>
>
> 32 | ACTIVE      |
> org.apache.jackrabbit.oak.plugins.itemsave.ItemSaveValidatorProvider
>
>
> 33 | ACTIVE      |
> org.apache.jackrabbit.oak.security.authentication.token.TokenConfigurationImpl
>
>
> 34 | UNSATISFIED | org.apache.jackrabbit.mk.osgi.MicroKernelService
>
>
> 35 | ACTIVE      | org.apache.jackrabbit.oak.jcr.osgi.RepositoryManager
>
> Any suggestion or helo will be appreciated
>
> Thans and regards
>
> --
> ------------------------------
> Ubaldo Taladriz Truan
> EXE
> -------------------------------
> Huérfanos 1052, Piso 8, Santiago, Chile
> Twitter: @utaladriz
> http://www.exe.cl   http://www.eltestacido.cl http://u
> <http://cochimin.bligoo.cl>baldo.cl
> Skype: utaladriz
> Fono:   (+56 2) 27581801
> Central:(+56 2) 27581800
> Fax:     (+56 2) 2234 4476
> Movil:   (+56 9) 988 57259
> Código Postal : 8320214
>



-- 
------------------------------
Ubaldo Taladriz Truan
Gerente General
EXE
-------------------------------
Huérfanos 1052, Piso 8, Santiago, Chile
Twitter: @utaladriz
http://www.exe.cl   http://www.eltestacido.cl http://u
<http://cochimin.bligoo.cl>baldo.cl
Skype: utaladriz
Fono:   (+56 2) 27581801
Central:(+56 2) 27581800
Fax:     (+56 2) 2234 4476
Movil:   (+56 9) 988 57259
Código Postal : 8320214