| We have 2 different issues, both related to the latest changes done to the way we initialize the ExpressionFactory. I created only one JIRA as we have to find a global fix to both issues. WildFly When upgrading WF to 5.3.2.Final, we have exceptions in some of the tests (for instance the rts integration tests). I was unable to reproduce the error in our HV integration tests but it looks like the error is valid anyway: it is not possible to load the com.sun.el.ExpressionFactoryImpl. This is due to the fact that the javax.el FactoryFinder uses the TCCL to load the ExpressionFactoryImpl and this class is not visible to the TCCL used. We can solve this issue by overriding the TCCL with the class loader used to load an HV class as com.sun.el.ExpressionFactoryImpl is visible to the HV module. OSGi Our OSGi tests did work with pax-exam 4.8.0 but fails with pax-exam 4.9.2. The pax-exam bugtracker is not very usable to find the related fix but I suspect they fixed something wrong with their classloader as the new behavior seems to be sane and I'm surprised it worked before. We have 2 solutions to fix the issue:
- we authorize hibernate-validator to access com.sun.el in the OSGi part of the manifest and we use the ResourceBundleMessageInterpolator class loader (as we will do with the fix for the WF issue);
- we use the externalClassLoader provided to the configuration to load the ExpressionFactory: the users would have 2 possibilities in an OSGi environment: build the ExpressionFactory themselves or provide an external class loader having access to a javax.el implementation.
And... we can also do both to have a default behavior working with the default com.sun.el implementation and allow the users to provide their implementation using the external class loader option or a specific ExpressionFactory. Note that the solution proposed by Sanne in https://github.com/hibernate/hibernate-validator/pull/579/files does work with pax-exam 4.8.0 but does not work with pax-exam 4.9.2. And I must admit that I would expect it to fail as the FactoryFinder does not have access to the com.sun.el according to the javax.el-api manifest. |