Which problem are you referring to? a2jmidi should work fine as long as you have access to the device. But in any case that should not be necessary anymore if you use pipewire, which should be able to manage all the devices at once.
Also there was the night spent recompiling the right version of bison in the middle of Qsampler's dependency hell, so that I could have a piano sound. That was all in 2017.
- Auto restart any important services (with systemd or similar)
- Use JACK/Pipewire session management
- Report the crash to the developers (of a2jmidi in this case, but it could be anything)
I honestly have never used LinuxSampler so I can't comment on that, I believe they have some strange licensing thing going on.
By contrast, JACK1 contains a2jmidid as a builtin client, no extra work is needed. You just start JACK, all your MIDI devices are listed.