Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[osgi] Bean Validation not working properly in OSGi #125

Open
CrystalMethod opened this issue Jul 5, 2014 · 1 comment
Open

[osgi] Bean Validation not working properly in OSGi #125

CrystalMethod opened this issue Jul 5, 2014 · 1 comment

Comments

@CrystalMethod
Copy link
Contributor

implementation not compatible with osgi class loading:

private ValidatorFactory getValidatorFactory() {
    try {
        return Validation.buildDefaultValidatorFactory();
    } catch (ValidationException e) {
        LOGGER.debug("Cannot find validation provider.", e);
        LOGGER.info("No JSR 303 Bean Validation provider available.");
    }
    return null;
}
@CrystalMethod
Copy link
Contributor Author

I could provide an implementation of ValidationProviderResolver dedicated to OSGi. But the question is, how to inject it to XOManagerFactoryImpl:

ValidatorFactory validatorFactory = Validation.byDefaultProvider()
        .providerResolver( new OsgiServiceDiscoverer() )
        .configure()
        .buildValidatorFactory();

To overwrite XOManagerFactoryImpl with OsgiXOManagerFactoryImpl seems not the best solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant