[
https://issues.apache.org/jira/browse/CXF-6706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15062263#comment-15062263
]
Benson Margulies commented on CXF-6706:
---------------------------------------
[~gunnar.morling]
I have a small test case for you. It fails. It fails _differently_ than the CXF
failure, but I think it's reasonably possible that they stem from the same
problem. However, you may not feel that this meets your entry conditions.
[email protected]:benson-basis/hibernate-karaf-tc.git, branch not-karaf
If you run the test in here, the log messages will include:
null[com.basistech.hibernateitest.ms.MockService] : Validation ran but didn't
complain
That is, I don't get any class-not-found errors, but instead the validator
doesn't complain about an object that should fail validation.
This is, of course, different from the original problem, which is below. I'm
going to do some debugging in CXF to see if I can get some idea about how the
Karaf+CXF+Pax-Web combo comes up with a different classloading environment than
my test case.
{noformat}
Caused by: javax.el.ELException: Provider com.sun.el.ExpressionFactoryImpl not
found
at
javax.el.FactoryFinder.newInstance(FactoryFinder.java:101)[51:javax.el-api:3.0.0]
at
javax.el.FactoryFinder.find(FactoryFinder.java:197)[51:javax.el-api:3.0.0]
at
javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:197)[51:javax.el-api:3.0.0]
at
javax.el.ExpressionFactory.newInstance(ExpressionFactory.java:168)[51:javax.el-api:3.0.0]
at
org.hibernate.validator.internal.engine.messageinterpolation.InterpolationTerm.<clinit>(InterpolationTerm.java:60)
... 65 more
Caused by: java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl
not found by org.apache.cxf.cxf-rt-transports-http [90]
at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_60]
at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)
at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)
at
org.ops4j.pax.swissbox.core.BundleClassLoader.findClass(BundleClassLoader.java:176)[80:org.ops4j.pax.swissbox.core:1.7.0]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)[:1.8.0_60]
at
org.ops4j.pax.swissbox.core.BundleClassLoader.loadClass(BundleClassLoader.java:192)[80:org.ops4j.pax.swissbox.core:1.7.0]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_60]
at
javax.el.FactoryFinder.newInstance(FactoryFinder.java:87)[51:javax.el-api:3.0.0]
... 69 more
{noformat}
> Bean validation seems to not be working in OSGi
> -----------------------------------------------
>
> Key: CXF-6706
> URL: https://issues.apache.org/jira/browse/CXF-6706
> Project: CXF
> Issue Type: Bug
> Affects Versions: 3.1.4, 3.2.0
> Reporter: Benson Margulies
> Assignee: Benson Margulies
> Fix For: 3.1.5, 3.2.0
>
>
> Using Karaf 4.0.2,
> if you take this repo:
> [email protected]:benson-basis/cxf-karaf-validation-tc.git
> and checkout the use-cxf-support branch, it will build you a Karaf assembly
> that, when you poke the service (http://localhost:8181/cxf/validate)
> will yield the following backtrace. This assumes that you are up to date with
> my fix to cxf-6705 which is on master and the 3.1.x branch.
> {noformat}
> javax.validation.ValidationException: Unable to find a default provider
> at
> javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:264)
> at
> javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:111)
> at
> org.apache.cxf.validation.BeanValidationProvider.<init>(BeanValidationProvider.java:45)
> at com.basistech.ts.impl.TrivialService.validate(TrivialService.java:50)
> {noformat}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)