Hi, Sorry about the delay in replying. I was able to resolve the issue. I had made two mistakes:
1. another file in the same location as the UMListenerComponent (i.e. UserManagementDSComponent) has an activate method. So those two create a conflict. 2. I had left the unimplemented methods of the UserOperationEventListener in my custom listener as default, which always return 'false'. This causes the flow to break at doPreAuthenticate as this returns false. I resolved by setting the default return values of irrelevant methods to true, and by registering this in the UserManagementDSComponent. Thanks for the help.. On Tue, May 26, 2015 at 11:13 AM, Damith Senanayake <[email protected]> wrote: > This is my 'activate' method. > > protected void activate(ComponentContext context) { > > UserRenameEventListener renameEventListener=new > UserRenameEventListener(); > > if(userOperationEventListeners==null){ > userOperationEventListeners=new TreeMap<Integer, > UserOperationEventListener>(); > > } > > userOperationEventListeners.put(renameEventListener.hashCode(),renameEventListener); > > > } > > > > On Tue, May 26, 2015 at 11:09 AM, Damith Senanayake <[email protected]> > wrote: > >> I tried writing an activate method. And it gets called. However, I think >> it breaks the normal procedure, because now I cannot login even under valid >> credentials. Any idea why this occurs? >> >> On Tue, May 26, 2015 at 10:44 AM, Tharik Kanaka <[email protected]> wrote: >> >>> Didn't you try by adding an activate method register inside? Because >>> usually in osgi you need ComponentContext to register services which is >>> available in activate method. >>> >>> Regards, >>> >>> On Tue, May 26, 2015 at 10:36 AM, Damith Senanayake <[email protected]> >>> wrote: >>> >>>> Hi, >>>> >>>> I am trying to make a custom UserOperationEventListener, and want to >>>> register it as an OSGI service in the carbon.user.core component. >>>> >>>> I referred to carbon.identity.mgt component to see how the Identity >>>> management listener is registered. I saw that it was instantiated and >>>> registered in the IdentityMgtServiceComponent.activate() method. >>>> >>>> However, the UMListenerComponent in carbon.user.core.internal doesn't >>>> have an activate method written or defined. >>>> >>>> In this case how can I register the custom listener as a service? >>>> >>>> >>>> Thanks >>>> >>>> -- >>>> *-Damith Senanayake-* >>>> +94712205272 >>>> >>>> _______________________________________________ >>>> Dev mailing list >>>> [email protected] >>>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>>> >>>> >>> >>> >>> -- >>> >>> *Tharik Kanaka* | Associate Software Engineer >>> >>> WSO2, Inc |#20, Palm Grove, Colombo 03, Sri Lanka >>> >>> Email: [email protected] | Web: www.wso2.com >>> >> >> >> >> -- >> *-Damith Senanayake-* >> +94712205272 >> > > > > -- > *-Damith Senanayake-* > +94712205272 > -- *-Damith Senanayake-* +94712205272
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
