The issue you are facing is likely because the Sonoff binding JAR file from OH4.1 is not fully compatible with OpenHAB 5. The internal APIs and framework have changed in OH5 so trying to install an older JAR can throw that BundleException error.
Here is what you can do:
Don’t reuse the OH4 JAR instead, check if there is an updated version of the Sonoff binding for OH5. You can try looking in the community or GitHub for a 5.x-compatible build or request an updated JAR from the developer.
Alternatively, consider using MQTT with Tasmota or ESPHome on your Sonoff devices. That is a very stable and well-supported method in OH5 and you won’t need a separate binding.
If you still want to try the JAR manually, make sure:
It is not corrupted re-download it if needed.
You place it in the addons folder, not via bundle:install
You remove any old cached version (userdata/cache and userdata/tmp)
Let me know how you are flashing or configuring your Sonoff devices, I might be able to help you set them up with MQTT if needed.
I tried installing the add-ons, but I got some errors.
Copying different versions of the Sonnof Binding doesn’t work either.
I’ll see if they can update the add-ons, as flashing is more complicated if the devices are installed at home.
I understand that removing installed equipment to flash is not ideal, but you only have to do it once. After that you don’t have to worry about add-ons not being compatible with the next OH version, MQTT will work for every OH version.
I look up the recommended procedure in the tasmota website and follow it to the letter. Before removing any installed equipment look it up in the tasmota database to make sure it can be flashed.
Then maybe start here?
I am not an expert, I have just followed the directions to flash maybe 5 -6 modules.