#5 Classloader not loading classes in WebApp deployed in EAR

closed
None
5
2014-08-12
2005-08-18
m_wells
No

WinXP
Weblogic Server 8.1

THE PROBLEM
-----------------------
Classes inside a WAR deployed in my EAR are failing
to load when the Dozer Mapper.map() method is called.

I have tried every permutation of classpath locations for
placing Dozer jar and config files (i.e. inside the WAR +
EAR) but without success.

WORKAROUND
------------------------
Extract the classes that need to be mapped by Dozer
from the WAR into a seperate JAR file and place this jar
file in the APP-INF/lib folder inside the EAR.

OTHER INFO THAT MAY BE HELPFUL
----------------------------------------------------------

I am able to load these classes using Class.forname()
in the same class that is calling Mapper.map() so it
appears that the issue is in Dozer.

Further investigation revealed that
MappingFileReader.read() throws a MarshalException
when attempting to unmarshal these particular objects.

The classes classes exist in the
package "com\nr\dm\sm\pres\ui\ws\model\wlgenerated\s
ession\" which is located inside a WAR deployed in the
EAR.

Discussion

  • m_wells

    m_wells - 2005-08-18

    Stack Trace from WeblogicServer

     
  • Ben Sullins

    Ben Sullins - 2005-08-18
    • assigned_to: nobody --> fgarsombke
     
  • m_wells

    m_wells - 2005-08-19

    Logged In: YES
    user_id=1330585

    Hi Franz, I'm afraid this fix does not work for me, the original
    problem persists :-(

    Test 1)
    dozer jar in the APP-INF/lib, the classes to be mapped in the
    WebApp are not loaded.

    Test 2)
    dozer jar in the WEB-INF/lib, the classes to be mapped in
    the WebApp are not loaded.

    NOTES

    The classloader associated with the current thread contains
    the CORRECT classes. However, it seems the unmarshaller
    is using the parent classloader of the current thread which
    does not contain the required classes (see code snippet
    below).

    Thread.currentThread().getContextClassLoader().getParent()
    ==unmarshaller.getClass().getClassLoader()
    {TRUE}

    CLASS LOADER DEBUG INFO

    Thread.currentThread().getContextClassLoader()
    ----------------------------------------------
    weblogic.utils.classloaders.ChangeAwareClassLoader@8509
    7d finder:
    weblogic.utils.classloaders.MultiClassFinder@1f42679
    annotation: DebtManagementEAR@smwebservice

    unmarshaller.getClass().getClassLoader()
    ----------------------------------------
    weblogic.utils.classloaders.GenericClassLoader@9133f6
    finder:
    weblogic.utils.classloaders.MultiClassFinder@154b574
    annotation: DebtManagementEAR@

    castorMapping.getClass().getClassLoader()
    -----------------------------------------
    weblogic.utils.classloaders.GenericClassLoader@f49ac3
    finder: weblogic.utils.classloaders.MultiClassFinder@ea9cf1
    annotation: DebtManagementEAR@

     
  • Franz Garsombke

    Franz Garsombke - 2005-08-19

    Logged In: YES
    user_id=550744

    I have successfully reproduced this. Fix will be in today.

     
  • Franz Garsombke

    Franz Garsombke - 2005-08-19

    Logged In: YES
    user_id=550744

    Here are the scenarios that I have tested:

    Scenario1 : Does not work - Dozer classloader can not see
    classes in webapp.

    EAR
    -- APP/INF-LIB
    dozer-full.jar
    -- APP/INF-CLASSES

    WAR 1
    --WEB-INF/LIB
    mymappedclasses.jar
    -- WEB-INF/CLASSES
    dozerMappingFile.xml

    WAR 2
    --WEB-INF/LIB
    mymappedclasses2.jar
    -- WEB-INF/CLASSES
    dozerMappingFile2.xml

    Scenario2 : Does work - Fixed Castor classloader..

    EAR
    -- APP/INF-LIB
    -- APP/INF-CLASSES

    WAR 1
    --WEB-INF/LIB
    mymappedclasses.jar
    dozer-full.jar

    -- WEB-INF/CLASSES
    dozerMappingFile.xml

    WAR 2
    --WEB-INF/LIB
    mymappedclasses2.jar
    dozer-full.jar

    -- WEB-INF/CLASSES
    dozerMappingFile2.xml

    Scenario3 : Always Worked -

    EAR
    -- APP/INF-LIB
    dozer-full.jar
    mymappedclasses.jar
    mymappedclasses2.jar
    -- APP/INF-CLASSES
    oneDozerMappingFileForEverything.xml

    WAR 1
    --WEB-INF/LIB
    -- WEB-INF/CLASSES

    WAR 2
    --WEB-INF/LIB
    -- WEB-INF/CLASSES

    Is this adequate? I will check these changes in today...

     
  • Franz Garsombke

    Franz Garsombke - 2005-08-22
    • status: open --> closed
     
  • Franz Garsombke

    Franz Garsombke - 2005-08-22

    Logged In: YES
    user_id=550744

    I am closing this bug. I think the classloading issues have
    been resolved for now.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks