]
Hardy Ferentschik resolved HV-562.
----------------------------------
Resolution: Won't Fix
Fix Version/s: (was: 4.3.0.CR1)
Incorrect use of TCL to check visibility to JPA classes
-------------------------------------------------------
Key: HV-562
URL:
https://hibernate.onjira.com/browse/HV-562
Project: Hibernate Validator
Issue Type: Bug
Components: engine
Affects Versions: 4.1.0.Final
Reporter: Sanjeeb Sahoo
Priority: Critical
_org.hibernate.validator.engine.resolver.DefaultTraversableResolver_ uses Thread's
context class loader to check existence of _PERSISTENCE_UTIL_CLASS_NAME_ as shown in the
code below:
The following code:
{code}
private void detectJPA() {
try {
loadClass( PERSISTENCE_UTIL_CLASS_NAME, this.getClass() );
log.debug( "Found {} on classpath.", PERSISTENCE_UTIL_CLASS_NAME );
}
{code}
_loadClass()_ first tries to use TCL to load the class. If TCL can't load, then it
uses the class loader of the second argument to load the class. This is incorrect. It does
not matter whether TCL can load _PERSISTENCE_UTIL_CLASS_NAME_, what matters is whether the
class loader which is going to be used to load _JPA_AWARE_TRAVERSABLE_RESOLVER_CLASS_NAME_
can load _PERSISTENCE_UTIL_CLASS_NAME_ or not.
Since HV-363 has now been fixed to use current class loader to load
_JPA_AWARE_TRAVERSABLE_RESOLVER_CLASS_NAME_, the same class loader should also be used to
detect existence of _PERSISTENCE_UTIL_CLASS_NAME_.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: