I have also encountered the similar program and somewhere in the jboss code it checks whether its a single phase or two phase commit and if its two phase commit then it set some STATUS on prepare and commit.
I believe may be the reason for this is JBOSS is not able to handle the 2PC due to -
a) MySQL version of j-connector which do not support 2PC. Anything earlier than 5.0 would not be have 2PC commit capabilities.
I will be performing tests runs to cross check if this is the case. If anyone has any other view or explaination of this error, please let me know.