Today I transfererred my code from Sony Ericsson and everything works great except of sound.

I use simply tone sequences like this:
Tone tc;
Player screw;

screw = Manager.createPlayer(Manager.TONE_DEVICE_LOCATOR);
screw.realize();
tc = (ToneControl)screw.getControl("javax.microedition.media.control.ToneControl");
tc.setSequence(NSEQ_SCREW);
screw.setLoopCount(1);
screw.start();


On realize() method, emulator throws exception:

java.lang.IllegalStateException: Can't invoke the method at the closed state

I have not real device, but only may start on emulator. The same exception throws example application MediaSampler from Nokia developers suite package. MediaSampler also don/t play tone using Manager.playTone() method, nothing happens, but no exception is thrown.

Please help me: what happens? That's impossible, that Player can't play simply tone sequences on Nokia phones.

Whole exception text looks like this:
<this is place, when createPlayer() is called>
MMA : Exception during remote invocation
java.lang.RuntimeException: java.lang.NullPointerException:
<this is place, when realize() is called>
MMA : Exception during remote invocation
java.lang.RuntimeException: java.lang.NullPointerException:
MMA : Exception during remote invocation
java.lang.RuntimeException: java.lang.NullPointerException:
java.lang.IllegalStateException: Can't invoke the method at the closed state


I'm sure, that after createPlayer(...) screw is not null.

Lukasz Stela