Closed Vishal0802 closed 1 year ago
Why not try the latest version?
Have you checked https://github.com/Fazecast/jSerialComm#troubleshooting or https://github.com/Fazecast/jSerialComm/wiki/Troubleshooting item 11?
some systems may block execution of libraries from the system temp folder. ... Optionally, the same result can be achieved by running your Java application from the command line and specifying the java.io.tmpdir directory as an additional parameter, e.g.: java -Djava.io.tmpdir=/folder/of/your/choice -jar yourApplication.jar ... On Windows, you may be able to achieve the same result by setting the TMP environment variable ...
Optionally, the same result can be achieved by running your Java application from the command line and specifying the java.io.tmpdir directory as an additional parameter, e.g.: java -Djava.io.tmpdir=/folder/of/your/choice -jar yourApplication.jar ...
@NorbertSandor Thank you for your prompt response. When I am using jSerialComm 2.4.2, I just placed this in my lib folder and provided in class path to my command line script and it was working fine.
Now as per your suggestion, I created one tmp folder under my application and provided the same path but still facing the same issue.
Any step I am missing or need to change or add?
consider %YESPAY_HOME% = C:\YESEFT
My command -- call "C:\YESEFT"\JavaFinder.bat set classpath= set PATH=%JAVA_HOME%bin;%INSTALL_DIR%;%INSTALL_DIR%bin;%PATH%; java -Djava.io.tmpdir="%YESPAY_HOME%\tmp" -DYESPAY_HOME="%YESPAY_HOME%" -classpath "%YESPAY_HOME%\lib\jSerialComm-2.5.3.jar";"%YESPAY_HOME%\lib\bcprov-jdk14-138.jar";"%YESPAY_HOME%\YESEFTConfig.jar";"%YESPAY_HOME%\properties"; config.YESEFTConfig pause
Error -
Thanks.
Does it fail with jSerialComm 2.9.2 as well?
@NorbertSandor Thank you for your reply. Yes, Now I tried with 2.9.2 and getting below exception:
I have created "tmp" folder under baseDir/lib/tmp and the jSerialComm-2.9.2.jar placed under lib dir.
consider baseDir/YESPAY_HOME = C:/YESEFT
call "C:\YESEFT"\JavaFinder.bat set classpath= set PATH=%JAVA_HOME%bin;%INSTALL_DIR%;%INSTALL_DIR%bin;%PATH%; java -Djava.io.tmpdir="%YESPAY_HOME%\lib\tmp" -DYESPAY_HOME="%YESPAY_HOME%" -classpath "%YESPAY_HOME%\lib\jSerialComm-2.9.2.jar";"%YESPAY_HOME%\lib\bcprov-jdk14-138.jar";"%YESPAY_HOME%\YESEFTConfig.jar";"%YESPAY_HOME%\properties"; config.YESEFTConfig pause
error :
Sorry, I don't have more idea... But it seems that the problem is not with the temporary directory. There is some problem regarding your IA 32-bit architecture and the native DLL part of jSerialComm.
I'm afraid you have to wait for @hedgecrw , he is the real expert... :(
@NorbertSandor Thank you for your quick support and help.
@hedgecrw I would require your guidance and support here.
@NorbertSandor Thank you for your quick support and help.
@hedgecrw I would require your guidance and support here.
@hedgecrw I would require your guidance and support here.
@Vishal0802, I'm not totally sure what the issue is since jSerialComm does support 32-bit Windows without problem. I am downloading a copy of the exact Windows version you are using "POSReady 2009 32-bit" and will see if I can figure out what's going on.
Update, I can't even get Java to work on the version of Windows you are using due to it being so out-of-date. I was able to get a 32-bit version of Windows 8 installed, and jSerialComm seems to work fine on that. I will keep trying to get the POSReady Embedded Windows version working so I can test further.
In the meantime, could you try testing the following test program which uses jSerialComm under the hood:
https://www.dropbox.com/t/Yc2pyOH28puLtuyw
This is just the test suite that jSerialComm is put through before each release, so I'm not concerned with whether it actually works as a test suite on your computer, rather I want to see if it is able to load the jSerialComm library. Please post back if you are seeing the same error with this app. Thanks!
Update, I can't even get Java to work on the version of Windows you are using due to it being so out-of-date. I was able to get a 32-bit version of Windows 8 installed, and jSerialComm seems to work fine on that. I will keep trying to get the POSReady Embedded Windows version working so I can test further.
In the meantime, could you try testing the following test program which uses jSerialComm under the hood:
https://www.dropbox.com/t/Yc2pyOH28puLtuyw
This is just the test suite that jSerialComm is put through before each release, so I'm not concerned with whether it actually works as a test suite on your computer, rather I want to see if it is able to load the jSerialComm library. Please post back if you are seeing the same error with this app. Thanks!
@hedgecrw Thank you so much for your response. I did below steps but getting the same exception -
Existing Code- import com.fazecast.jSerialComm.SerialPort;
public String[] getIdentifierWindowsComm() { int n = 0;
SerialPort ports[] = SerialPort.getCommPorts();
String portNameArray[] = new String[ports.length];
for (SerialPort port : ports) {
String portName = port.getSystemPortName();
portNameArray[n] = portName;
n++;
}
return portNameArray;
}
call "C:\YESEFT"\JavaFinder.bat set classpath= set PATH=%JAVA_HOME%bin;%INSTALL_DIR%;%INSTALL_DIR%bin;%PATH%; java -Djava.io.tmpdir="%YESPAY_HOME%\lib\tmp" -DYESPAY_HOME="%YESPAY_HOME%" -classpath "%YESPAY_HOME%\lib\jSerialComm-2.9.3-beta1.jar";"%YESPAY_HOME%\lib\bcprov-jdk14-138.jar";"%YESPAY_HOME%\YESEFTConfig.jar";"%YESPAY_HOME%\properties"; config.YESEFTConfig pause
Please let me know any further steps or need to share more Information. Thanks again for your time, response and help.
FYI - If I use the jSerialComm-2.4.2.jar with the same above configuration, it works, and I am able to see some files gets created under tmp folder while running the application without any error. However, with 2.4.2 version generally we do not create the tmp folder and even not set the tmp path but still it works.
FINALLY figured out the problem. The library was updated a long time ago to use Windows features that are not supported on versions older than Vista. Since you are using a non-supported version of Windows, I'm not going to try to find workarounds to include newer functionality with older Windows versions, but I'm including a manually compiled version of the library here for you to use:
https://www.dropbox.com/t/YnnoD3mROF41IV42
This should include all modern library functionality except for the ability to retrieve bus-reported device descriptions. Please let me know if this works for you. You also shouldn't need to worry about any of the temporary directory stuff...just use it like you were using the old library version.
Actually went ahead and updated this properly so that WinXP can be supported in the official release. Please test the following and see if it works for you:
Actually went ahead and updated this properly so that WinXP can be supported in the official release. Please test the following and see if it works for you:
@hedgecrw Thank you so much for your quick help & prompt response & change. I am not doing well Today. So will try the same by next week and will share the result with you.
Fixed with new release v2.9.3
We are using jSerialComm 2.4.2 version to communicate with Verfione Device (Attached with USB Port) on Embedded windows Pos Ready 2009 (32 bit).
We are facing connection closing issues intermediately. I started application and then I am able to connect with Verifone over USB and able to send and receive data. Now intermediately or any point of time when I send the data over USB port then I did not receive anything. So, I tried to close the serial port and connection with USB (eg. - COM9) and try to reconnect & open through USB port again but sometimes I could be able to connect (I got the serial object / input/output stream) and sometimes not (input and output stream object null while getting from serial port object) but in both the cases I could not be able to send and receive the data to Verifone terminal Over USB.
Now any how I would have to sometimes restart my device or application and whole system then only I could be able to connect with my device over usb and able to send & receive the data. I can only suspect that PORT is not closed correctly even calling the right serial port method.
I tried to add and integrate with higher version library - jSerialComm 2.5.3 but I am getting below issue -
Log: NFO|3216/0|22-10-13 09:15:07|java.lang.UnsatisfiedLinkError:C:\Windows\Temp\jSerialComm\1665648907093-jSerialComm.dll: The specified procedure could not be found INFO|3216/0|22-10-13 09:15:07|java.lang.UnsatisfiedLinkError: C:\Windows\Temp\jSerialComm\1665648907093-jSerialComm.dll: The specified procedure could not be found INFO|3216/0|22-10-13 09:15:07| at java.lang.ClassLoader$NativeLibrary.load(Native Method) INFO|3216/0|22-10-13 09:15:07| at java.lang.ClassLoader.loadLibrary0(Unknown Source) INFO|3216/0|22-10-13 09:15:07| at java.lang.ClassLoader.loadLibrary(Unknown Source) INFO|3216/0|22-10-13 09:15:07| at java.lang.Runtime.load0(Unknown Source) INFO|3216/0|22-10-13 09:15:07| at java.lang.System.load(Unknown Source) INFO|3216/0|22-10-13 09:15:07| at com.fazecast.jSerialComm.SerialPort.(SerialPort.java:243)
@hedgecrw @hedgecrw Would require your suggestion. Please help me here. Even port was closed, or any error occur while running the application. But If I am closing that port and trying to open it again so I should be able to communicate further without restarting the system OS or application or device.
Please guide if I would need to change any code with existing code or should I need to use any newer library that can work with this old OS and could be able to solve this issue and way to incorporate into application.