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

SerialComManager.setRTS() causes exception #26

Closed akuhtz closed 6 years ago

akuhtz commented 7 years ago

Hi Rishi,

I'm running Test23 under Win7 64bit and it causes an exception when setRTS() is called (scm.setRTS(DTE, true); )

com.serialpundit.core.SerialComException: The data area passed to a system call is too small.

    at com.serialpundit.serial.internal.SerialComPortJNIBridge.setRTS(Native Method)
    at com.serialpundit.serial.SerialComManager.setRTS(SerialComManager.java:1505)
    at test23.Test23.main(Test23.java:65)
ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2
JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [util.c:840]
RishiGupta12 commented 7 years ago

Looks like it is JVM side thing not serialpundit. Are you debugging something using a debugger.

http://bugs.java.com/view_bug.do?bug_id=6476706 https://stackoverflow.com/questions/27500398/debugging-java-in-eclipse-error https://www.eclipse.org/forums/index.php/t/1069715/

akuhtz commented 7 years ago

Hi Rishi,

Even from commandline it throws the same error:

D:\github\serial-communication-manager\prebuilt-release>java -classpath sp-core.jar;sp-tty.jar;. test23.Test23
com.serialpundit.core.SerialComException: The parameter is incorrect.

        at com.serialpundit.serial.internal.SerialComPortJNIBridge.setRTS(Native Method)
        at com.serialpundit.serial.SerialComManager.setRTS(SerialComManager.java:1505)
        at test23.Test23.main(Test23.java:65)
RishiGupta12 commented 7 years ago

Any change in driver or hardware.

RishiGupta12 commented 6 years ago

Seems like a windows problem https://superuser.com/questions/84977/error-0x8007007a-when-trying-to-schedule-a-task/131310#131310 I saw answers like:

akuhtz commented 6 years ago

Hi Rishi, Will check on linux.

akuhtz commented 6 years ago

Hi Rishi, I tested on a raspi 3 and it worked without an exception.

RishiGupta12 commented 6 years ago

Found one more info https://stackoverflow.com/questions/2225737/error-jdwp-unable-to-get-jni-1-2-environment

Seems like it should have been fixed already by JVM/Windows/IDE etc. Should we close it.

akuhtz commented 6 years ago

I see a similar exception with SPSW under Windows. Lets close it.