This is because your ears share one loader repository. Therefore only the first resource in this classpath is passed to both applications.
Read more about ClassLoader, LoaderRepository and their configuration for deployment units:
Thank you Frito!
That did the trick.
OK the solution you mentioned worked, but I have another question...
Is it possible to use the MANIFEST file of the EJB JAR file to specify the classpath to the required utility JARs, but yet retain the isolated classloader behaviour that happens when you use application.xml? When I've done this (using JBOSS 3.2.3; JDK 1.4.1), the files specified in the MANIFEST file's Class-Path entry all seem to get loaded into the container's common classloader - which is not the behaviour I'm looking for.
I'm fairly content to use the application.xml approach (specifying each utility JAR in there), but it means whenever I add a new utility JAR to my application, I need to add to application.xml AND my Build.properties file (Ant). Using the MANIFEST approach, this can be specified in the build script and keeps things a bit more maintainable.
So does anyone know if what I'm trying to do is possible perhaps under a newer JBoss?