I am getting the following exception when i try to exec the code given below

javax.microedition.media.MediaException: Can not acquire device
at com.sun.mmedia.DirectPlayer.acquireDevice(), bci=52
at com.sun.mmedia.DirectPlayer.doPrefetch(), bci=5
at com.sun.mmedia.BasicPlayer.prefetch(), bci=26
at com.sun.mmedia.PlayerImpl.prefetch(), bci=52
at com.sun.mmedia.PlayerImpl.start(), bci=37
at audioMidlet.OpenConnection(audioMidlet.java:116)
at audioMidlet.startApp(audioMidlet.java:30)
at javax.microedition.midlet.MIDletTunnelImpl.callStartApp(), bci=1
at com.sun.midp.midlet.MIDletPeer.startApp(), bci=7
at com.sun.midp.midlet.MIDletStateHandler.startSuite(), bci=269
at com.sun.midp.main.AbstractMIDletSuiteLoader.startSuite(), bci=52
at com.sun.midp.main.CldcMIDletSuiteLoader.startSuite(), bci=8
at com.sun.midp.main.AbstractMIDletSuiteLoader.runMIDletSuite(), bci=161
at com.sun.midp.main.AppIsolateMIDletSuiteLoader.main(), bci=26
/=============================================================================

try{
connection = (StreamConnection) Connector.open("http://172.17.14.67:8080/Nokia/res/obesity.amr");
in= connection.openInputStream();
String str=in.toString();
byte[] b3=str.getBytes();
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(b3);
in = new ByteArrayInputStream(b3);
int ch;
while((byteArrayInputStream.read())!= -1)
{
mediaplayer = Manager.createPlayer(in,"audio/amr");
// mediaplayer.start();
System.out.println(byteArrayInputStream.read());
}
if((byteArrayInputStream.read())== -1){
mediaplayer = Manager.createPlayer(in,"audio/amr");
if(mediaplayer!=null)
mediaplayer.start();

System.out.println("inside of read check");
}