Is it okay to replace the jgroups 2.4.1.sp-4 inside jboss 4.2.2, with a newer version 2.5, or will jboss get into trouble if we use clustering?
We haven't done any testing with anything beyond 2.4.1.SPx, but it should work. But you'll need to test. If you want to upgrade, suggest going with JGroups 2.6.2.
You may get some WARN messages in the logs about deprecated configuration parameters; the messages tell you what the parameters are; you can just remove them from your configs.