# BlinkStick java - open returns null

**URL:** <https://forums.blinkstick.com/t/blinkstick-java-open-returns-null/1567>\
**Category:** Support\
**Created:** [July 18, 2022, 11:55pm UTC](https://forums.blinkstick.com/t/blinkstick-java-open-returns-null/1567 "2022-07-18T23:55:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lewing.jung](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lewing.jung](https://forums.blinkstick.com/u/lewing.jung)\
**Post date:** [July 18, 2022, 11:55pm UTC](https://forums.blinkstick.com/t/blinkstick-java-open-returns-null/1567/1 "2022-07-18T23:55:53Z")

</div>

I have a simple ledTest.java program that reproduces the problem:

```
public static void main(String[] args) {
    BlinkStick[] bsDevices = BlinkStick.findAll();
    for (BlinkStick bs:bsDevices) {
        System.out.println("\n"+bs.getProduct()+" - "+bs.getManufacturer());
        System.out.println("Serial:"+bs.getSerial());
        System.out.println("Mode:"+bs.getMode());
        System.out.println("info-block-1:"+bs.getInfoBlock1());
    }
}

```

BlinkStick.java:  
public static BlinkStick[] findAll() {  
List blinkstickList = new ArrayList();

```
	HIDDeviceInfo[] infos = findAllDescriptors();

	for (HIDDeviceInfo info : infos) {
		BlinkStick blinkstick = new BlinkStick();
		try {
		    blinkstick.setDevice(info.open());
		    blinkstickList.add(blinkstick);
		} catch (Exception e) {
		}
	}
	return blinkstickList.toArray(new BlinkStick[blinkstickList.size()]);
}

```

Test steps:

1. Run ledTest and output shows:  
BlinkStick - Agile Innovative Ltd  
Serial:BS042431-2.3  
Mode:2  
info-block-1:

2. Reboot PC

3. Run ledTest and output shows:  
Serial:  
Mode:-1  
info-block-1:

Note: The info.open() returned null - why?

1. One of the following actions take place  
a. Unplug and replug blinkstick device  
b. Plug in USB drive  
c. Eject USB drive

2. Run ledTest and output shows:  
BlinkStick - Agile Innovative Ltd  
Serial:BS042431-2.3  
Mode:2  
info-block-1:

How can I resolve this after a reboot when info.open() is returning null?  
Don’t want to rely on a physical plug/unplug action.

Also, info is a HIDDevice object and has a getRelease\_number() method.  
What is this release number? Is it reliable to use this to distinguish  
between two different led devices?

---

<div class="post-metadata">

**Author:** ![lewing.jung](https://forums.blinkstick.com/letter_avatar_proxy/v4/letter/l/ecc23a/32.png) [@lewing.jung](https://forums.blinkstick.com/u/lewing.jung)\
**Post date:** [July 18, 2022, 11:58pm UTC](https://forums.blinkstick.com/t/blinkstick-java-open-returns-null/1567/2 "2022-07-18T23:58:12Z")

</div>

BTW, this is under Windows 10 Pro
