Hi Tharindu,

i been able to fix the mongodb user store intitalizing error now it working
successfully it will be registered as a secondary user store in IS and when
going to add a new users and roles it will show the domain of mongodb
userstore still i having small issues in my json query formats for mongodb
i fixing those issues at the moment all the progress so far i made updated
to my github repository[1] and i recently updated my blog[2] as well,can
you review my code and give me a feedback?

[1]https://github.com/asanthamax/mongodbuserstore
[2]http://asanthamax.blogspot.com/

Thanks,
Asantha

On Sun, May 22, 2016 at 3:38 PM, Asantha Thilina <[email protected]>
wrote:

> Hi Tharindu,
>
> I have override all the methods in AbstractUserStoreManager in my
> MongoDBUserStoreManager class after that when i try to add new secondary
> user store in management console i got following error i attached the
> screen shot of the error with this mail
> i have pushed all the progress upto now to my github repository[1]
> can you give me some tips to solve this issue?
> any suggestion would be grateful
> [1] https://github.com/asanthamax/mongodbuserstore
> Thanks,
> Asantha
>
> On Thu, May 19, 2016 at 11:47 PM, Asantha Thilina <
> [email protected]> wrote:
>
>> Hi Tharindu,
>>
>> sorry for the late reply ,as you advised i remove the scr reference and
>> its corresponding methods from user store now it's works fine but i having
>> another small issue if i wanted to run my mongodb user store as as my
>> primary user store how would i do that?
>> i added my user store configurations to user-mgt.xml file and comented
>> the ldap userstore properties and i added MongoDBUserStore to
>> tenant-mgt.xml as well but then i get error as datasource cannot be casted
>> to MongoDB db source while deploying thats mean its still referring to
>> Default Activator inside carbon core module how would i set it to my
>> activator to reffer?
>> any suggestion or help would be grateful
>> Thanks,
>> Asantha
>>
>> On Wed, May 18, 2016 at 10:29 PM, Tharindu Edirisinghe <
>> [email protected]> wrote:
>>
>>> Hi Asantha,
>>>
>>> Great progress so far !
>>>
>>> Since the reference is given to realm service in the bundle activator,
>>> you should be facing the issue. Can you remove the service reference from
>>> the bundle activator class. (You can delete the following from the class).
>>>
>>> * @scr.reference name="user.realmservice.default"
>>>  * interface="org.wso2.carbon.user.core.service.RealmService"
>>> cardinality="1..1"
>>>  * policy="dynamic" bind="setRealmService"
>>>  * unbind="unsetRealmService"
>>>
>>> Also delete the following methods where realm service is used.
>>>
>>> getRealmService()
>>> setRealmService(RealmService rlmService)
>>> unsetRealmService(RealmService rlmService)
>>>
>>> After that can you try if the userstore manager is working as expected.
>>> If you face any issues, please get back.
>>>
>>> Thank you,
>>> TharinduE
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Sun, May 15, 2016 at 7:48 PM, Asantha Thilina <
>>> [email protected]> wrote:
>>>
>>>> Hi Tharindu,
>>>>
>>>> I found the issue after debugging into my code ,my service bundle is
>>>> not get activated because i referring into mongodb-driver which is not osgi
>>>> comaptible and i just found another library in here[1] and it is worked for
>>>> me ,fixed project i pushed into my github repository [2].
>>>> i found out that *DefaultRealmService* which is used in Bundle
>>>> Activator of JDBCUserstoreManager cannot be used for MongoDB since it used
>>>> *java.sql.DataSource*.
>>>> Is their having any DataSource class like that for MongoDB? or would i
>>>> have to create a different logic to implement that scenario in MongoDB?
>>>> waiting for your suggestion
>>>>
>>>> [1].
>>>> http://central.maven.org/maven2/org/mongodb/mongo-java-driver/3.2.2/
>>>> [2]. https://github.com/asanthamax/mongodbuserstore
>>>> Thanks,
>>>> Asantha
>>>>
>>>> On Sat, May 14, 2016 at 10:53 AM, Asantha Thilina <
>>>> [email protected]> wrote:
>>>>
>>>>> Hi Tharindu,
>>>>>
>>>>> i faced following issue while i developing ,
>>>>> after adding my new json query support i didn't able to see My
>>>>> MongoDBUserStore in dropdown in create user store option.
>>>>> for json related activites i used an external json dependency from
>>>>> here[1] and i added it jar to lib folder in IS as well,i have enabled
>>>>> remote debugging and inspect my code and there i found in my 
>>>>> *MongoDBUserStoreDSComponent
>>>>> *class *activate *method triggered but execute 1st line of code only.
>>>>> it will not registered the service but in my osgi console window when
>>>>> i run *ss mongo* command i get monodb.userstore bundle and mongodb
>>>>> java driver bundle are activated successfully i attached my console output
>>>>> and identity server output for your consideration as well
>>>>> any suggestion would be grateful
>>>>>
>>>>> [1]. http://mvnrepository.com/artifact/org.json/json/20160212
>>>>> my github repository
>>>>>
>>>>> https://github.com/asanthamax/mongodbuserstore/tree/master/mongodb.userstoremanager
>>>>> Thanks,
>>>>> Asantha
>>>>>
>>>>>
>>>>> On Thu, May 12, 2016 at 2:01 AM, Asantha Thilina <
>>>>> [email protected]> wrote:
>>>>>
>>>>>> Hi Tharindu,
>>>>>>
>>>>>> since mongodb driver not having prepared statement support earlier i
>>>>>> developed a logic to support prepared statement but i realized that it 
>>>>>> has
>>>>>> a limitation such as parameters has to be pass as same order it exists in
>>>>>> prepared statement then as you suggested to use key value relationship
>>>>>> instead of order during our hangout conversation i created a new logic 
>>>>>> same
>>>>>> to prepared statement in sql and it will work according to key value
>>>>>> relationship and i created standard query format for mongodb with json to
>>>>>> support prepared statements and i rewrite the JDBCRealmConstants class 
>>>>>> with
>>>>>> those supporting json queries instead of sql queries
>>>>>>
>>>>>> All of my prepared statement methods contain in
>>>>>> MongoDBPreparedStatement interface and its implementation in
>>>>>> MongoDBPreparedStatementImpl class
>>>>>>
>>>>>> All the changes i have pushed to my repo in here[1]
>>>>>>
>>>>>> security of this prepared statements has to be improve
>>>>>>
>>>>>> I'll be grateful if you can provide me some suggestions to improve it
>>>>>> and also another small issue i having is can i write a DataSource for
>>>>>> MongoDB as in java.sql.DataSource ?
>>>>>>
>>>>>> [1]
>>>>>> https://github.com/asanthamax/mongodbuserstore/tree/master/mongodb.userstoremanager
>>>>>>
>>>>>> Thanks,
>>>>>> Asantha
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>> --
>>>
>>> Tharindu Edirisinghe
>>> Software Engineer | WSO2 Inc
>>> Platform Security Team
>>> Blog : tharindue.blogspot.com
>>> mobile : +94 775181586
>>>
>>
>>
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to