The good news is, now I have a test case. https://github.com/benson-basis/cxf-karaf-validation-tc
This project demonstrates that Apache CXF 3.1.2 somehow causes Hibernate to go off the rails, failing to find it's EL provider, in Karaf. Without the full-started CXF service, it works fine. I did try something like the proposed workaround in that stackoverflow question, but I can't figure out what classloader is going to work. Karaf claims that no bundle exports the class that Hibernate claims to be looking for. On Fri, Dec 11, 2015 at 3:46 AM, Charlie Mordant <[email protected]> wrote: > Hi Benson, > > You should have a more advanced use case than me ^^. > I fell on this thread: > http://stackoverflow.com/questions/29678113/el-implementation-is-not-found-for-hibernate-validator-in-osgi-container > > So my guess is that: > * Either there's no el provider on the provisionned bundles ( but i doubt,) > * Either we should wrap the hibernate validator jar to be weaved by Aries > spi-fly (that allows to make that bundle's serviceloader working). > > You can also try to bump the HV version (I filled a Jira which seems to be > fixed: https://hibernate.atlassian.net/browse/HV-846). > > Regards, > Charlie > > 2015-12-10 19:10 GMT+01:00 Benson Margulies <[email protected]>: >> >> Next problem: >> >> using your stuff, I get a problem with EL. I think I ran into this >> before. Charlie, does this ring any bells for you? >> >> >> Caused by: java.lang.ExceptionInInitializerError >> at >> org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.interpolateExpression(ResourceBundleMessageInterpolator.java:227) >> at >> org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.interpolateMessage(ResourceBundleMessageInterpolator.java:187) >> at >> org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator.interpolate(ResourceBundleMessageInterpolator.java:115) >> at >> org.hibernate.validator.internal.engine.ValidationContext.interpolate(ValidationContext.java:370) >> at >> org.hibernate.validator.internal.engine.ValidationContext.createConstraintViolation(ValidationContext.java:284) >> at >> org.hibernate.validator.internal.engine.ValidationContext.createConstraintViolations(ValidationContext.java:246) >> at >> org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateSingleConstraint(ConstraintTree.java:289) >> at >> org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:133) >> at >> org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:91) >> at >> org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:85) >> at >> org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:478) >> at >> org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:424) >> at >> org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:388) >> at >> org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:340) >> at >> org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:158) >> at >> com.basistech.ws.common.api.options.OptionsValidator.validate(OptionsValidator.java:35) >> at >> com.basistech.ws.common.api.options.ProcessingOptions$Builder.setOptions(ProcessingOptions.java:112) >> at >> com.basistech.ws.frontend.service.AbstractRaasRsService.getProcessingOptions(AbstractRaasRsService.java:750) >> at >> com.basistech.ws.frontend.service.AbstractRaasRsService.processRequest(AbstractRaasRsService.java:582) >> at >> com.basistech.ws.frontend.service.AbstractRaasRsService.processHelper(AbstractRaasRsService.java:210) >> at >> com.basistech.ws.frontend.service.RaasRsLanguageService.runRli(RaasRsLanguageService.java:119) >> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> at >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) >> at >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) >> at java.lang.reflect.Method.invoke(Method.java:497) >> at >> org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) >> at >> org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) >> ... 36 more >> Caused by: javax.el.ELException: Provider >> com.sun.el.ExpressionFactoryImpl not found >> at javax.el.FactoryFinder.newInstance(FactoryFinder.java:101) >> at javax.el.FactoryFinder.find(FactoryFinder.java:197) >> at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:197) >> at javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:168) >> at >> org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm.<clinit>(InterpolationTerm.java:60) >> ... 63 more >> Caused by: java.lang.ClassNotFoundException: >> com.sun.el.ExpressionFactoryImpl not found by >> org.apache.cxf.cxf-rt-transports-http [110] >> at >> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1558) >> at >> org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79) >> at >> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) >> at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1919) >> at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:959) >> at >> org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:424) >> at >> org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:192) >> at java.lang.ClassLoader.loadClass(ClassLoader.java:357) >> at javax.el.FactoryFinder.newInstance(FactoryFinder.java:87) >> ... 67 more >> </pre> >> >> On Thu, Dec 10, 2015 at 11:21 AM, Benson Margulies <[email protected]> >> wrote: >> > I ran into a hitch. You're import won't accept guava 16. I guess I'll >> > load up two guavas. >> > >> > On Mon, Dec 7, 2015 at 10:46 AM, Charlie Mordant <[email protected]> >> > wrote: >> >> Hi Benson, >> >> >> >> I got it working making my own validation feature, you can find it >> >> here: >> >> >> >> https://github.com/OsgiliathEnterprise/net.osgiliath.parent/blob/master/net.osgiliath.framework/net.osgiliath.features/net.osgiliath.feature.validation/src/main/resources/net.osgiliath.feature.validation.xml >> >> >> >> Regards, >> >> >> >> 2015-12-07 16:10 GMT+01:00 Benson Margulies <[email protected]>: >> >>> >> >>> I could not get the Hibernate bean validation feature to work in >> >>> 4.0.x. For one thing, it's in the 'enterprise' feature set, which does >> >>> not work at all without extra <repository> elements which I can't >> >>> have. Even when I copied it out, I still couldn't get it to work. >> >>> >> >>> So I made a working feature with Apache Bval. However, the Bval >> >>> project seems to be perpetually asleep, and so I can't get a problem >> >>> with one of their bundles fixed. So, I'm hoping that someone has an >> >>> idea about how to rehab the hibernate solution. >> >> >> >> >> >> >> >> >> >> -- >> >> Charlie Mordant >> >> >> >> Full OSGI/EE stack made with Karaf: >> >> https://github.com/OsgiliathEnterprise/net.osgiliath.parent > > > > > -- > Charlie Mordant > > Full OSGI/EE stack made with Karaf: > https://github.com/OsgiliathEnterprise/net.osgiliath.parent
