VM randomly crashes whilst using bluecove

Ok, I'm using the latest version of bluecove, and java 1.5 (v6). The following code seems to randomly cause the following error. It's very strange, sometimes the code will run for 40 loops with no problems, sometimes it will crash on the first one... it's really starting to bug me, and it sorting out asap...

Anyway

<a href="http://www.pvba13764.pwp.blueyonder.co.uk/hs_err_pid2004.log">Log file of crash</a>

Code:

import javax.bluetooth.LocalDevice;
import javax.bluetooth.*;
import java.util.Vector;
import java.io.*; /**

 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class BTH extends Thread{
  public static void main(String[] args) {
  BTH phas = new BTH();


}


  Vector<RemoteDevice> devices = new Vector();

  private
      LocalDevice BTAdapter;
  DiscoveryAgent BTDA;

  public BTH() {
    try {
      BTAdapter = LocalDevice.getLocalDevice();
      start();
    }
    catch (BluetoothStateException ex) {
      ex.printStackTrace();
    }

  }

  public void run()
  {
          int counter=0;
    while(true)
    {

      Search();
      counter++;
      System.out.println(counter + " Successful Searches");
      try {
        this.currentThread().sleep(60000);
      }
      catch (InterruptedException ex) {
      }
    }
  }
  public void Search() {
    devices.clear();

    System.out.println("Searching for devices...");
    BTDA = BTAdapter.getDiscoveryAgent();
    try {
      BTDA.startInquiry(DiscoveryAgent.GIAC, new Listener());
    }
    catch (BluetoothStateException ex) {
    }

  }




  class Listener
      implements DiscoveryListener {

    public void deviceDiscovered(RemoteDevice btDevice, DeviceClass cod) {

      try {
        System.out.println("Device discovered:" + btDevice.getFriendlyName(false));
        devices.add(btDevice);
      }
      catch (IOException ex) {
      }

    }

    public void servicesDiscovered(int transID, ServiceRecord[] servRecord) {
    }

    public void serviceSearchCompleted(int transID, int respCode) {

    }

    public void inquiryCompleted(int discType) {
      System.out.println("\nFound " + devices.size() + " devices");

      for (RemoteDevice aDevice : devices) {
        try {
          System.out.println(aDevice.getBluetoothAddress() + "\t" +
                             aDevice.getFriendlyName(false));
        }
        catch(IOException ex)
        {

        }
      }

    }

  }
}


Any thoughts? What does the error code actually mean? and is there any way that I can simply ignore the error, reboot the affected bit and carry on, in real time?
PaulVintenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PaulVintenAuthor Commented:
D'oh, it doesn't support html tags. Never mind lol
0
CEHJCommented:
Try another version of bluecove - it's probably an internal error
0
PaulVintenAuthor Commented:
Tried that, the only other version I could find just crashed it full stop
0
PaulVintenAuthor Commented:
This turns out to be a semi-known bug with the deviceDiscovered function, it is buggy when used with the friendly name function. I've got conflicting information whether or not it's the bluecove or an inherrant problem with bluetooth itself. The solution is just to use the inquiryCompleted function.
0
GranModCommented:
PAQed with points refunded (125)

GranMod
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.