Hello,

I am trying to create a custom JDBC user store by extending the
org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager. For the moment, I just
implemented the doListUsers method to display them in the IS. But I can't
even list my users because I have two problems:

- The first one concerns the method to count the retrieved users. I noticed
the default used class
is org.wso2.carbon.identity.user.store.count.jdbc.JDBCUserStoreCountRetriever
but it seems to use the SQL request defined in the properties to execute
the count. So I configured my user-store configuration file to use my
custom JDBCUserStoreManager as "UserStoreCountRetriever". But now, the
error appearing is it want to execute the "countUsers" method that I can't
even see in the source code in [1]. Which interface/class should I
implement/extend to allow my custom JDBCUserStoreManager to use itself as
"UserStoreCountRetriever". I ask that because I have not found the source
code of this class :(
- The second one is the content of the list of users itself. So the call of
the doListUsers. My SQL request is executed but I have a problem because a
stacktrace appears tellming me that a NPE occured in the class
UserRealmProxy and I don't know what to do:

[2017-07-27 11:03:45,555] ERROR {org.wso2.carbon.user.mgt.UserRealmProxy} -
> java.lang.NullPointerException
>         at
> org.wso2.carbon.user.mgt.UserRealmProxy.listAllUsers(UserRealmProxy.java:180)
>         at
> org.wso2.carbon.user.mgt.UserAdmin.listAllUsers(UserAdmin.java:82)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>         at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:498)
>         ...


In addition, I followed the documentation [1] but it is not complete
because the part to register the OSGi bundle is missing. So I followed the
end of the tuto [2] to do so (the part "Register Custom User Store Manager
in OSGI framework"). And if I can make a comment, most of the tuto does not
display which packages to use which is very wrong (hopefully, there was a
sample :)) because there is a big difference between importing
org.wso2.carbon.user.api.UserStoreManager and importing
org.wso2.carbon.user.core.UserStoreManager. There is no way to know which
one to use.

Can you help me, please?

Regards,

Thomas

[1]
https://docs.wso2.com/display/IS530/Writing+a+Custom+User+Store+Manager#WritingaCustomUserStoreManager-Deployingandconfiguringthecustomuserstoremanager
[2]
http://pushpalankajaya.blogspot.fr/2013/09/how-to-write-custom-user-store-manager.html
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to