... but, you can ejaculate and that's a good sign!
Since ejaculation can occur in your unconscious sleeping state, I'm thinking that you
may have underlying stress factors going on in your waking life, which could account for the inability to c u m. Achieving an orgasm can have as much to do with what's going on between the ears... as what's happening (or not happening)... between the legs.
As far as I understand it, it may be inorgasmia/anorgasmia. There are at least three types: primary (if a person has never had the ability to reach orgasm), secondary (the loss of the ability to reach o.) and situational anorgasmia.
According to medical science, primary anorgasmia is more common for women and quite rare in men, so there haven´t been much research into this condition.
Sometimes it can be related to side effects of some forms of medication, for example "a common cause of anorgasmia, in both men and women, is the use of anti-depressants, particularly selective serotonin reuptake inhibitors (SSRIs). Though reporting of anorgasmia as a side-effect of SSRIs is not precise, it is estimated that 15-50% of users of such medications are affected by this condition. The chemical amantadine has been shown to relieve SSRI-induced anorgasmia in some, but not all, people."
Do you have any other medical conditions which may be related to this problem? Or can it be caused by some psychological factors, such as something which might make you not let yourself to ejaculate (e.g.unconscious fear, anxiety etc)?
It is quite interesting that it happens to you during wet dreams. Are there any significant differences between the dream scenarious and the real life sex, e.g. different activities, different objects, different content of sexually arousing stimuli etc?