You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Christian Schneider (JIRA)" <ji...@apache.org> on 2015/12/14 13:53:46 UTC

[jira] [Comment Edited] (CXF-6706) Bean validation seems to not be working in OSGi

    [ https://issues.apache.org/jira/browse/CXF-6706?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15055941#comment-15055941 ] 

Christian Schneider edited comment on CXF-6706 at 12/14/15 12:52 PM:
---------------------------------------------------------------------

I am not so sure about the approach. Looks like too much classloader and proxy magic for my taste. If it is really the only way then it is ok of course.
Another issue is that I am not sure if CXF is the correct place to put the ValidationHelper. 

I would rather expect hibernate to provide a bundle that offers an OSGi ready ValidationProvider or ValidationFactory as a service. As we do not have direct influence on the hibernate project we also might put such a module in karaf in the mean time. 

I will also ask in the OSGi dev group if there is experience with correctly using bean validation in OSGi.

In any case CXF should rather simply refer to a ValidationProvider service and expect that it gets a valid one there.
WDYT?


was (Author: chris@die-schneider.net):
I am not so sure about the approach. Looks like too much classloader and proxy magic for my taste. If it is really the only way then it is ok of course.
Another issue is that I am not sure if CXF is the correct place to put the ValidationHelper. 

I would rather expect hibernate to provide a bundle that offers an OSGi ready ValidationProvider as a service. As we do not have direct influence on the hibernate project we also might put such a module in karaf in the mean time. 

In any case CXF should rather simply refer to a ValidationProvider service and expect that it gets a valid one there.
WDYT?

> 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
>
> Using Karaf 4.0.2, 
> if you take this repo:
> git@github.com: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)