Gunnar Morling commented on New Feature HV-582

I think the following would make sense:

  • Load internal classes (org.hibernate.validator.*) and resources (XSDs etc.) always via HV's own class loader.
  • Provide a way for the user to specify a class loader which is used to load any user provided types/resources. Simplest probably would be to add something like HibernateValidatorConfiguration#userClassLoader(ClassLoader userClassLoader). Use this CL if set, otherwise use the current approach (first try TCCL, then via some class).

I've experimented with this for some tests with OSGi on my BVAL-251 branch (see e.g. c65036408) and it worked out quite well. Instead of directly passing the CL to the configuration, we could also define a SPI interface such as ClassLoaderService, but I'm not sure whether that provides any benefits.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira