The MUC spec does not allow non-occupants to get the history of the room. From your final comment it seems to me that you want to get the complete chat transcript (which is different than the room history). The room history may contain only a certain number of messages while the transcript contains the complete log.
To get the complete chat transcript you will need to rely on server extensions which is something that may vary between servers since this is not a standard requirement defined by the MUC spec. In summary, you will need to find a server that lets you get the chat transcript and then extend Smack to get that info.