receive file from mobile to pc its work fine.but one time only its work, its came BlueCove stack shutdown completed and close application . its j2se based.
i want multi time run that application whats my wrong please help me


my code is belove:

package univercellfileresiver;


import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.microedition.io.*;
import java.io.*;
//import net.benhui.bluecove.spp_bt;
//import javax.bluetooth.*;
//import javax.obex.*;

//import javax.bluetooth.*;
//import javax.obex.*;


import de.avetana.javax.obex.HeaderSet;
import de.avetana.javax.obex.Operation;
import de.avetana.javax.obex.PasswordAuthentication;
import de.avetana.javax.obex.ResponseCodes;
import de.avetana.javax.obex.ServerRequestHandler;

import de.avetana.javax.obex.SessionNotifier;
import java.util.UUID;
import javax.bluetooth.DiscoveryAgent;
import javax.bluetooth.LocalDevice;
public class FileResiver {
DiscoveryAgent agent;
static int count = 0;
public static UUID fileUUid=null;
public static void main(String[] args) throws IOException {
String uuid="9106";
LocalDevice.getLocalDevice().setDiscoverable(DiscoveryAgent.GIAC);// obtain reference to singleton
// device.setDiscoverable(DiscoveryAgent.GIAC); // set Discover mode to LIAC
String url = "btgoep://localhost:" + uuid + ";name=HTBP";
SessionNotifier sn = (SessionNotifier)OBEXConnector.open(url);
while(true)
{
RequestHandler handler = new RequestHandler();
sn.acceptAndOpen(handler);
fileUUid = UUID.randomUUID();
count++;
System.out.println("Received OBEX connection " + (count));
}
}

private static class RequestHandler extends ServerRequestHandler {
// @Override
public int onConnect(HeaderSet request, HeaderSet reply){
try
{
System.out.println("Hola");
return ResponseCodes.OBEX_HTTP_OK;
}catch(Exception e)
{
return 0;
}
}


public int onPut(Operation op) {
try {
fileUUid = UUID.randomUUID();
//String applicationDir="D:/WorkArea/Ramprasad/ram/NetBeansProjects/receiveapp/build/classes/Revc/";
String applicationDir="C:/Program Files/UniverCell/UniverCellCatLog/Recv/";
//C:\Program Files\UniverCell\UniverCellCatLog\Recv
/* String applicationDir = getClass().getProtectionDomain().getCodeSource().getLocation().getPath();
int lastApp=applicationDir.indexOf("/receiveapp.jar");
applicationDir=applicationDir.substring(0,lastApp);
//Program%20Files
applicationDir=applicationDir+"/Recv/";
// System.out.println("Path="+applicationDir);
applicationDir=applicationDir.replaceAll("Program%20Files","Program Files");*/
// System.out.println("Path="+applicationDir);
java.io.InputStream is = op.openInputStream();
HeaderSet hs = op.getReceivedHeaders();
//HeaderSet response = hs.connect(hs);
// HeaderSet hs = op.getType();
String name = (String) hs.getHeader(HeaderSet.NAME);
Long stringLength = (Long) hs.getHeader(HeaderSet.LENGTH);
System.out.println("[client:] Path= " +name);
File f = new File(applicationDir+fileUUid+".txt");
FileOutputStream fos = new FileOutputStream (f);
// byte b[] = new byte[1000];
byte b[]= new byte[ (int)stringLength.longValue() ];
int len=0;
while ((len = is.read(b)) > 0) {
fos.write (b, 0, len);
}
fos.close();
System.out.println("AbsolutePath " + f.getAbsolutePath());
op.close();
return ResponseCodes.OBEX_HTTP_OK;
} catch (IOException e) {
e.printStackTrace();
// System.out.println("Insert BlurtoothDevice");
return ResponseCodes.OBEX_HTTP_UNAVAILABLE;
}
}
}

}