• 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Greenhorn
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" ?>
<jboss-web>
<class-loading java2ClassLoadingCompliance="false">
<loader-repository>
org.jboss.classloader.spi.base:BaseClassLoader=jsfsample.war
<loader-repository-config>java2ParentDelegation=false</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>


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"
name="jsfsample.war"
domain="jsfsample"
export-all="NON_EMPTY"
import-all="true">
</classloading>


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



 
Daniel Winz
Greenhorn
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:

http://forums.oracle.com/forums/thread.jspa?threadID=584031
https://glassfish.dev.java.net/issues/show_bug.cgi?id=3721

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"
xmlns="http://java.sun.com/xml/ns/persistence">;
<persistence-unit name="Employee-Details">
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
<jta-data-source>java:/jdbc/employee</jta-data-source>
<properties>
<property name="toplink.weaving" value="false"/>
<property name="toplink.logging.level" value="OFF" />
</properties>
</persistence-unit>
</persistence>


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