Bug 793075 (JBEPP-157)

Summary: user name containing underscore breaks the UsersActivityStatsService
Product: [JBoss] JBoss Enterprise Portal Platform 4 Reporter: Gary Hu <garyhu2>
Component: unspecifiedAssignee: Gary Hu <garyhu2>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 4.3.0.GA_CP3   
Target Milestone: ---   
Target Release: 4.3.0.GA_CP5   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/JBEPP-157
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-02-08 23:08:54 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Gary Hu 2010-02-03 16:49:35 UTC
Help Desk Ticket Reference: https://enterprise.redhat.com/issue-tracker/474923
project_key: JBEPP

JBPORTAL-2470 user name containing underscore breaks the UsersActivityStatsService

Comment 1 Gary Hu 2010-02-03 16:50:04 UTC
Link: Added: This issue depends JBPORTAL-2470


Comment 2 Gary Hu 2010-02-08 21:32:44 UTC
There is no need to back port to any portal version.  The fix will go to EPP 4.3-CP03 branch only. There's no dependence on the JBPORTAL-2470.  And here is the description of this issue.

 If a user name contains underscore, for example "john_dow", it breaks the UsersActivityStatsService MBean sevice.

This is the code from UsersActivityStatsServiceImpl:

 public void registerActivity(final UserActivity userActivity)
   {
      try
      {
         Notification notification = new Notification(Integer.toString(userActivity.getType()), this.getServiceName(),
               userActivity.getTimestamp(), userActivity.getTimestamp(), userActivity.getId() + "_"
                     + userActivity.getSessionId());
     ....
  
And here is the code from UserActivity:

public UserActivity(Notification notification)
   {
      if (notification.getMessage() == null)
      {
         throw new IllegalArgumentException("Id (notification message) cannot be null");
      }
      this.id = notification.getMessage().substring(0, notification.getMessage().indexOf("_"));
      this.sessionId = notification.getMessage().substring(notification.getMessage().indexOf("_"));
      this.timestamp = notification.getTimeStamp();
      this.type = Integer.parseInt(notification.getType());
   }
 
 

Comment 3 Gary Hu 2010-02-08 21:33:02 UTC
Link: Removed: This issue depends JBPORTAL-2470 


Comment 4 Gary Hu 2010-02-08 23:08:54 UTC
issue has been resolved.

Comment 5 Martin Weiler 2010-04-23 08:06:58 UTC
Link: Added: This issue related JBEPP-159


Comment 6 Gary Hu 2010-04-23 14:51:17 UTC
This fix has been committed to EPP 4.3 branch that will be picked up by next CP release.