Benson, there are different ways to handle that, one would be to use the Aries spi-fly to take care of that. Pax-Web uses a specialized Classloader to take care of such use-cases. Or you make sure your TCCL is set correctly. Again maybe some Pax Tools [1] can be of help here. For example you can use the org.ops4j.pax.swissbox.core.ContextClassLoaderUtils
regards, Achim [1] - https://github.com/ops4j/org.ops4j.pax.web/blob/master/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerImpl.java#L329-L339 2015-12-23 8:15 GMT+01:00 Jean-Baptiste Onofré <j...@nanthrax.net>: > I would say it's a job for Hibernate Validator. > > > On 12/20/2015 11:04 PM, Benson Margulies wrote: > >> I've just spent a day tracking down an issue with the Hibernate >> Validator in OSGi. >> >> The problem is as follows: for some constraint violations, HV uses >> javax.el to format the message. In order to do this, it needs to call >> ExpressionFactory.newInstance(). This is a typical old-fashioned SPI >> API; it uses the context classloader and provides no alternative >> method to pass in a class loader or otherwise avoid problems. A >> wrinkle is that the call to ExpressionFactory.newInstance() is very >> lazy in HV, so the relevant TCCL is that at the time of the call to >> 'validate'. >> >> Is this a job for SM? If so, would it be a 'specs' (for el-api)? >> >> > -- > Jean-Baptiste Onofré > jbono...@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com > -- Apache Member Apache Karaf <http://karaf.apache.org/> Committer & PMC OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead blog <http://notizblog.nierbeck.de/> Co-Author of Apache Karaf Cookbook <http://bit.ly/1ps9rkS> Software Architect / Project Manager / Scrum Master