RishiGupta12 / SerialPundit

Serial port communication in Java - FTDI D2XX, HID API, X/Y modem
GNU Affero General Public License v3.0
125 stars 56 forks source link

2018-03-25 20:40:59 JNI call ThrowNew failed to throw exception !, FormatMessageA(), error code : 15100 #36

Open makarna35 opened 6 years ago

makarna35 commented 6 years ago

Hi;

I'm try only this: `class HotPlugEventWatcher implements ISerialComUSBHotPlugListener {

@Override
public void onUSBHotPlugEvent(int event, int usbvid, int usbpid, String serialNumber) {

    if(event == SerialComUSB.DEV_ADDED) {
        System.out.println("DUT added, running automated tests for this device !");

    }else if(event == SerialComUSB.DEV_REMOVED) {
        System.out.println("DUT removed, running tests, if any, to be run after device removal !");
        System.out.println("usbvid : " + usbvid);
    }else {
    }

}

}`

If I'm unplug my usb Device from USB port netbeans show this message:

2018-03-25 20:40:59 JNI call ThrowNew failed to throw exception !, FormatMessageA(), error code : 15100

RishiGupta12 commented 6 years ago

I have seen this on a misconfigured Windows system. Did you formatted your computer. Did you tried this with eclipse IDE. On 25-Mar-2018 11:15 PM, "makarna35" notifications@github.com wrote:

Hi;

I'm try only this: `class HotPlugEventWatcher implements ISerialComUSBHotPlugListener {

@Override public void onUSBHotPlugEvent(int event, int usbvid, int usbpid, String serialNumber) {

if(event == SerialComUSB.DEV_ADDED) {
    System.out.println("DUT added, running automated tests for this device !");

}else if(event == SerialComUSB.DEV_REMOVED) {
    System.out.println("DUT removed, running tests, if any, to be run after device removal !");
    System.out.println("usbvid : " + usbvid);
}else {
}

}

}`

If I'm unplug my usb Device from USB port netbeans show this message:

2018-03-25 20:40:59 JNI call ThrowNew failed to throw exception !, FormatMessageA(), error code : 15100

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RishiGupta12/SerialPundit/issues/36, or mute the thread https://github.com/notifications/unsubscribe-auth/AJNSrPKm_cYl95KZSDSUqdlpR5CTsKqlks5th9fAgaJpZM4S6Oz- .

makarna35 commented 6 years ago

Windows not have any problem. I'm use only NETBEANS

makarna35 commented 6 years ago

NOTE: I use FT series usb-com converter. I'm plug and unplug for test.

makarna35 commented 6 years ago

And now I get this message:

JNI call CallVoidMethod() in usb_hotplug_event_handler() , failed !

makarna35 commented 6 years ago

JNI call CallVoidMethod() in usb_hotplug_event_handler() , failed ! error cause of me I'm fix it but

JNI call ThrowNew failed to throw exception !, FormatMessageA(), error code : 15100 problem still exist

makarna35 commented 6 years ago

I'm dedect problem but I not have a solition. If use this scenario you can see problem: start read with scm.readString(handle); in while (read nonstop) and try UNPLUG USB device after this you can see "JNI call ThrowNew failed to throw exception !, FormatMessageA(), error code : 15100" message You have any solition?

RishiGupta12 commented 6 years ago

May you check if same problem occurs with eclipse also.

makarna35 commented 6 years ago

I not have Eclipse

RishiGupta12 commented 6 years ago

Which language your windows system is using English or any other language. Try installing and activating english in windows computer and see if this still occurs. I tried to debug and found windows is not able to found correct english string.