I found the problem. It is sufficient to create a new
jar archive with only the changed META-INF directory.
It didn't work the first time I tried because I tried
quickly to test this idea and I used the windows context menu to create a zip from the META-INF directory (the jar), the problem is that the descriptors were in the jar file but not the META-INF directory therefore no deployment.
I only needed a new jar file containing a META-INF
directory. In the jboss.xml I changed the jndi-names
and in the jboss-cmp.xml, I changed the datasource
What has also to be made is to assign a local-jndi-name
in the jboss.xml file to all beans which don't have one.
Actually it seems that when no local-jndi-name, and certainly the same thing with jndi-name, is assigned to a bean, jboss assign a default one (local/<bean name>). Which results in a conflict when trying to deploy the second set of beans.
So basically one has to ensure that both jndi-names and local-jndi-names that are associated to the beans are unique.