I have never tried it but you can scope the classes for your ear.
to do it you would need to create jboss-app.xml and put it in META-INF of your ear with the following (quoted from "Jboss Administration & Development" book):
if the syntax does not work (which it might not) take a look at the dtd for details.
i've got the docs and i've already tried this but it didn't solve the problem. It permits to have different versions of the same libraries in different j2ee apps. But, the parent classloader is still under jboss... which use his own log4j classes. Because of this you cannot load a different version of this classes in your own ear with this option... or i misunderstood something. Any other ideas ?