there is nothing wrong. you are completely normal. this phenomenon is quite common and is often referred to as a "wet dream". in most cases you were having an erotic or sex-related dream (perhaps one you did not remember when you awoke) and your excited brain (which controls erections and ejaculation) went into full mode just like you are having sex for real. in a way this is among the safest sex of all. no risk of a sexually transmitted disease or unintended pregnancies. you may have to do some laundry however.
my sperm ejects unknowingly in the sleep time also what is the problem