I get the following error when I deploy a war to jboss 5.1 server:
the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, oracle/toplink/essentials/internal/ejb/cmp3/EntityManagerSetupImpl, and the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) for resolved class, javax/persistence/spi/PersistenceUnitInfo, have different Class objects for the type javax/sql/DataSource used in the signature
I tried to isolate the war classes from the server classes by defining a loader-repository at jboss-web.xml:
The setting BaseClassLoader=jsfsample.war seams not to be correct to me. I mean, restricting the BaseClassLoader cannot lead to something good I assume. But I am new to JBoss and go out from the error message. Anyway the configuration does not take any effect. The error message still appears. Then I tried to proceed with the jboss-classloader.xml:
Again, the same error appears when I deploy the war. As I assumed that the initial error was thrown because the javax/sql/DataSource is already loaded by BaseClassLoader I removed the jdbc2_0-stdext.jar from my war. But then I got the following exeption:
Starting persistence unit persistence.unit:unitName=#Employee-Details
Warning]: 2010.08.19 07:53:57.542--java.lang.NullPointerException: null was thrown on attempt of PersistenceLoadProcessor to load class ...
I see! I don't have to remove the jdbc2_0-stdext.jar but the javax/persistence folder from the toplink-essentials.jar.
Then I still get the NullPointerException warning. But it seams to be caused by the "temporary UCL3" classloader, not by missing classes. I don't have a clue what this "temporary" classloader is for, but following threads indicate to switch it off: