-
Re: User name is null in user creation event
britchie Feb 15, 2008 11:22 AM (in response to chandu2708)Bala,
This sounds like a bug. Can you do me a favour and add a "new Exception().printStackTrace();" line to your event listener and post the top 15 or so lines from that stack trace? It'll help me isolate where the problem lies and correct it.
Regards,
Bruce Ritchie
-
Re: User name is null in user creation event
ajohnson1200 Feb 15, 2008 2:01 PM (in response to chandu2708)hi Bala,
Following up on what Bruce said, can you also post the details of your user configuration? Specifically, are you using LDAP, a custom authentication provider or the standard database authentication provider?
Cheers,
AJ
-
Re: User name is null in user creation event
chandu2708 Feb 15, 2008 9:06 PM (in response to ajohnson1200)Hi Bruce and AJ,
First thing is im not using LDAP or custom authentication. my objective is to capture User related events so i added a listener to capture those
here is the result after adding "new Exception().printStackTrace();"
java.lang.Exception at com.satmetrix.clearspace.plugin.example.widget.UserEventHandler.userCreated(UserEventHandler.java:28) at com.jivesoftware.base.event.UserEventDispatcher.dispatchEvent(UserEventDispatcher.java:74) at com.jivesoftware.base.profile.UserManagerImpl$UserEventHandler.fireUserCreatedEvent(UserManagerImpl.java:513) at com.jivesoftware.base.profile.UserManagerImpl$UserEventHandler.receive(UserManagerImpl.java:541) at com.jivesoftware.spi.ServiceEventDispatcher.dispatchEvent(ServiceEventDispatcher.java:50) at com.jivesoftware.spi.user.impl.db.UserProviderImpl.create(UserProviderImpl.java:121) at com.jivesoftware.base.profile.UserManagerImpl.createExternalUserIfNeeded(UserManagerImpl.java:179) at com.jivesoftware.base.profile.UserManagerImpl.createUser(UserManagerImpl.java:109) at com.jivesoftware.base.profile.UserManagerImpl.createUser(UserManagerImpl.java:94) at com.jivesoftware.base.proxy.UserManagerProxy.createUser(UserManagerProxy.java:66) at org.apache.jsp.admin.user_002dcreate_jsp._jspService(user_002dcreate_jsp.java:551) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.jivesoftware.community.action.JiveAdminActionFilter.doFilter(JiveAdminActionFilter.java:36) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
In the original post i said "when i debug" im using eclipse to build the plug ins and placed the breakpoints to debug. when i examine the USER object from captured user registration event all the values i given in the form are present except the user name value it gives the null value
but when i query the JIVEUSER table manually it has the user name stored in it not sure why its not present in the user object from user registration event
here is the custom listener code i used
public class UserEventHandler implements UserListener, Plugin {..................... ......................................... public void userCreated(UserEvent event) { Log.debug("User creation event is captured"); //Retriving user details from the event User user = event.getUser(); new Exception().printStackTrace(); }
Thank you,
Bala.
-
Re: User name is null in user creation event
chandu2708 Feb 15, 2008 11:06 PM (in response to chandu2708)Hi,
There is some additional information i noticed the name property of user object is persisting into database only after the user creation is completed
Thank you,
Bala.
-
Re: User name is null in user creation event
britchie Feb 18, 2008 9:42 AM (in response to chandu2708)Bala,
Thanks for that information - I'll see if I can reproduce the username issue. As for the other information in the database such as name, nameVisible, emailVisible and properties it's true that those are currently persisted to the database only after the user created event is sent. The user system was overhauled in 2.0 to simply things significantly which should resolve that issue.
Regards,
Bruce Ritchie
-
Re: User name is null in user creation event
Mamatha Jul 2, 2009 6:14 AM (in response to chandu2708)chandu2708 wrote:
Hi,
There is some additional information i noticed the name property of user object is persisting into database only after the user creation is completed
Thank you,
Bala.
-
-
Re: User name is null in user creation event
britchie Feb 18, 2008 10:49 AM (in response to chandu2708)1 person found this helpfulBala,
I just tried to reproduce this issue and was unable to:
UserEventDispatcher.getInstance().addListener(new UserListener() { public void userCreated(UserEvent event) { User user = event.getUser(); System.err.println(user); System.err.println("user.getUserName() " + user.getUsername()); } public void userDeleted(UserEvent event) { } public void userModified(UserEvent event) { } public void userLoggedIn(UserEvent event) { } });
The output of that when I created a user included the username of the new user I just created.
Regards,
Bruce Ritchie
-
Re: User name is null in user creation event
chandu2708 Feb 18, 2008 7:33 PM (in response to britchie)Hi Bruce,
Sorry! it's my mistake, its not the user name its name property which is null i think the other posting explains why its is like this i.e. some of the properties fetch in to database only after user creation event is completed. i think that explains everything.
thx for the support.
bala.
-
-
-
-
Re: User name is null in user creation event
chandu2708 Feb 18, 2008 7:34 PM (in response to chandu2708)thx for the support