Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application Crash when starting multiple instance of java file. #44

Open
umerdhamria1 opened this issue Jan 7, 2021 · 1 comment
Open

Comments

@umerdhamria1
Copy link

Thanks for the great library,
I am facing problem in running two instance on a single machine with different com port, application is generating error
com.serialpundit.core.SerialComException: C:\Windows\TEMP\sp_tuartx1\spcomwinx64.dll
at com.serialpundit.serial.internal.SerialComPortJNIBridge.loadNativeLibrary(SerialComPortJNIBridge.java:393)
at com.serialpundit.serial.SerialComManager.(SerialComManager.java:382)
at ecibautomatebs.ECIBFetchCNIC.Port(ECIBFetchCNIC.java:31)
at ecibautomatebs.ECIBFetchCNIC.FetchCNIC(ECIBFetchCNIC.java:98)
at ecibautomatebs.ECIBFetchCNIC.main(ECIBFetchCNIC.java:52)
Caused by: com.serialpundit.core.SerialComException: C:\Windows\TEMP\sp_tuartx1\spcomwinx64.dll
at com.serialpundit.serial.internal.SerialComPortJNIBridge.loadNativeLibrary(SerialComPortJNIBridge.java:355)
... 4 more
Caused by: java.io.FileNotFoundException: C:\Windows\TEMP\sp_tuartx1\spcomwinx64.dll (The process cannot access the file because it is being used by another process)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at java.io.FileOutputStream.(Unknown Source)
at com.serialpundit.serial.internal.SerialComPortJNIBridge.loadNativeLibrary(SerialComPortJNIBridge.java:335)

Please suggest how can i get off of this error. My limitation is to use single machine as send and receiver with continuous running service.

Thanks

@RishiGupta12
Copy link
Owner

Please use different names for native libraries when creating SerialComManager instance. Documentation (Javadocs) have all the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants