mconf / bigbluebutton

BigBlueButton is an open source web conferencing system for distance education
www.bigbluebutton.org
40 stars 33 forks source link

NPE in the register_user_request #198

Closed mconf-daileon closed 8 years ago

mconf-daileon commented 8 years ago

Author Name: Felipe Cecagno (Felipe Cecagno) Original Redmine Issue: 1462, http://dev.mconf.org/redmine/issues/1462 Original Date: 2015-02-12 Original Assignee: Mateus Dalepiane


Currently, when bbb-apps receives a register_user_request message, it raises a NPE because it tries to retrieve from the message the guest attribute, but the problem is that there's no guest information in this message.

The message captured from redis: 1423749868.150153 [0 127.0.0.1:38408] "PUBLISH" "bigbluebutton:to-bbb-apps:meeting" "{\"payload\":{\"name\":\"User 3422099\",\"userid\":\"lemebfmbmdqp\",\"role\":\"MODERATOR\",\"auth_token\":\"1oqjfc79fni8\",\"meeting_id\":\"ccf587c77d3c946812e21674ed3b95cb47ab0d6d-1423749867514\",\"external_user_id\":\"lemebfmbmdqp\"},\"header\":{\"timestamp\":9034844,\"name\":\"register_user_request\",\"version\":\"0.0.1\"}}"

The exception: Exception in thread "pool-26-thread-2" java.lang.NullPointerException at org.bigbluebutton.conference.service.messaging.RegisterUserMessage.fromJson(RegisterUserMessage.java:66) at org.bigbluebutton.conference.service.messaging.MessageFromJsonConverter.convert(MessageFromJsonConverter.java:29) at org.bigbluebutton.conference.meeting.messaging.redis.MeetingMessageHandler.handleMessage(MeetingMessageHandler.java:34) at org.bigbluebutton.conference.service.messaging.redis.MessageDistributor.notifyListeners(MessageDistributor.java:22) at org.bigbluebutton.conference.service.messaging.redis.ReceivedMessageHandler$2.run(ReceivedMessageHandler.java:55) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745)

Path to the exception: https://github.com/mconf/bigbluebutton/blob/mconf-live0.6.2/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/RegisterUserMessage.java#L66

See that here (https://github.com/mconf/bigbluebutton/blob/mconf-live0.6.2/bigbluebutton-apps/src/main/java/org/bigbluebutton/conference/service/messaging/RegisterUserMessage.java#L55) it checks if all needed attributes are in the message, but the guest attribute isn't checked.

Check if the guest field should be there or not - if it should, then add this information on bbb-web to be sent to red5; if it shouldn't, then clean up.

Implement the fix in the 090-guest-role branch.

mconf-daileon commented 8 years ago

Original Redmine Comment Author Name: Mateus Dalepiane (Mateus Dalepiane) Original Date: 2015-02-12T17:44:12Z


Included guest information in the message sent from bbb-web to bbb-apps. Also included a verification in bbb-apps to avoid further NPEs.

Pull request sent to: https://github.com/mconf/bigbluebutton/pull/8

Please close this issue once the fix is merged.