java - Loading eclipselink domain model with custom classloader under weblogic -
i have written custom classloader able dynamically load domain models each step of update process. in each step of update new thread created insure not contextclassloader current classloader pointing own classloader.
this sounds bit complicated, works well.
the latest domain model added project static dependency , previous domain models added jar resource folder. custom classloader loads domain classes these jar files.
all domain classes , eclipselink classes loaded classloader. still following exception , not understand, why?
exception [eclipselink-59] (eclipse persistence services - 2.1.3.v20110304-r9073): org.eclipse.persistence.exceptions.descriptorexception exception description: instance variable [hospitalization] not defined in domain class [example.role.patient], or not accessible. internal exception: java.lang.nosuchfieldexception: hospitalization mapping: org.eclipse.persistence.mappings.directtofieldmapping[hospitalization-->patient.hospitalization] descriptor: relationaldescriptor(example.role.patient --> [databasetable(role), databasetable(patient)]) the domain classes loaded classloader , not have missing hospitalization field. okay, how supposed work somehow eclipselink loads incorrect domain version statically linked project , loads field names that.
i have started digging through eclipselink code mapping part not straightforward.
eclipselink builds metadata directly byte representation of classes asm. loads classes via getresourceasstream(classname). classloader has delegated these calls parent classloader , why statically linked domain used.
Comments
Post a Comment