You know, I tried that. I've gotten myself unblocked by figuring out how to avoid the service locator.
On Sat, Nov 7, 2015 at 3:00 PM, James Carman <[email protected]> wrote: > I usually do not try to work with hibernate validator that way. I expose > OSGi services. When I am at a computer later, I can show you an example. > > On Sat, Nov 7, 2015 at 2:29 PM Benson Margulies <[email protected]> > wrote: >> >> I created a simple pax-exam test of the hibernate-validator feature, and I >> get: >> >> javax.validation.ValidationException: Unable to create a >> Configuration, because no Bean Validation provider could be found. Add >> a provider like Hibernate Validator (RI) to your classpath. >> >> Any suggestions? >> >> @ProbeBuilder >> public TestProbeBuilder probeConfiguration(TestProbeBuilder probe) { >> probe.setHeader(Constants.DYNAMICIMPORT_PACKAGE, "*"); >> return probe; >> } >> >> @Configuration >> public Option[] configure() throws Exception { >> loadProps(); >> karafDebug = false; >> >> return options(karafDistributionConfiguration() >> .frameworkUrl( >> maven() >> .groupId("org.apache.karaf") >> .artifactId("apache-karaf") >> .type("zip") >> .version(karafVersion)) >> .karafVersion(karafVersion).name("Apache Karaf") >> .unpackDirectory(new File("target/pax")) >> .useDeployFolder(false), >> keepRuntimeFolder(), >> configureConsole().ignoreLocalConsole(), >> logLevel(LogLevelOption.LogLevel.INFO), >> features(maven().groupId("org.apache.karaf.features") >> .artifactId("enterprise") >> .version(karafVersion) >> .classifier("features") >> .type("xml"), >> "hibernate-validator"), >> when(karafDebug).useOptions(debugConfiguration()), >> junitBundles(), >> systemProperty("pax.exam.osgi.unresolved.fail").value("true"), >> >> systemProperty("org.ops4j.pax.exam.rbc.rmi.host").value("localhost") >> ); >> }
