I developed a Java application using a DLL library for serial COM communication. (FYI: DLL file is used for a card encoder device – ref). My application works fine in development environment and some client machines. But sometime, the application cannot connect to COM port event it still works before.
-
How my application works: It simply communicates with the encoder device via a serial COM port, and all logic communicates with the device is packed in the DLL library. Thus, when the error occurs, it only returns the error connect fail without any other detail. Some efforts I’ve tried:
- Restarting the application cannot resolve the problem. For now, the only temporary way to resolve this is to restart the client’s machine
- In the beginning, restarting the customer’s machine temporarily resolved the issue immediately. However, after a while, restarting no longer solved the problem, and I had to restart 2-3 times for the issue to temporarily disappear
-
What have I done: because the library does not return any clue about the error, I have to check the COM connection via Windows tools
- Checking port connection in Windows Device Manager: The device is connected without any error
- I read in some reference that I can check serial COM via Window Registry Editor, in the path
ComputerHKEY_LOCAL_MACHINEHARDWAREDEVICEMAPSERIALCOMM
. When the application works, the COM port record is displayed in the Registry, but when the error occurs, it disappears.
-
What do I need:
- For now, I still cannot isolate the problem where it comes from, is it caused by logic in the application or this is the OS problem (conflicted between the DLL library with OS)? Is there any technique that detects this error?
- I want to debug more about this error when the COM port does not appear in Registry Editor, I think I can find out the root of the error from this, but I don’t have any clue about this. So, I need some help here to find out the error.
This error has occurred for months, I’ve searched cause in my code since then but I still have not any clue about this error. Can someone help, please?
Thanks