• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

different Class objects for one type, jboss 5.1, jpa/toplink, classloader?

Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

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:

<?xml version="1.0" encoding="UTF-8" ?>
<class-loading java2ClassLoadingCompliance="false">

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:

<?xml version="1.0" encoding="UTF-8"?>
<classloading xmlns="urn:jboss:classloading:1.0"

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 ...

Can anyone help? I am totally lost.


Daniel Winz
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:


Summerized, to fullfill the two threads, I added two toplink properties to my persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0"
<persistence-unit name="Employee-Details">
<property name="toplink.weaving" value="false"/>
<property name="toplink.logging.level" value="OFF" />

Deployment without errors then !
Everyone is a villain in someone else's story. Especially this devious tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic