use of org.apache.cxf.jaxrs.validation.ValidationExceptionMapper in project cxf by apache.
the class BookStoreCustomApplication method getSingletons.
@Override
public Set<Object> getSingletons() {
Set<Object> singletons = new HashSet<>();
singletons.add(new JacksonJsonProvider());
singletons.add(new ValidationExceptionMapper());
singletons.add(new JAXRSBeanValidationFeature());
singletons.add(new LoggingFilter());
return singletons;
}
use of org.apache.cxf.jaxrs.validation.ValidationExceptionMapper in project tomee by apache.
the class CxfRsHttpListener method addMandatoryProviders.
private void addMandatoryProviders(final Collection<Object> instances, final ServiceConfiguration serviceConfiguration) {
if (SystemInstance.get().getProperty("openejb.jaxrs.jsonProviders") == null) {
if (!shouldSkipProvider(WadlDocumentMessageBodyWriter.class.getName())) {
instances.add(new WadlDocumentMessageBodyWriter());
}
}
if (!shouldSkipProvider(EJBExceptionMapper.class.getName())) {
instances.add(new EJBExceptionMapper());
}
if (!shouldSkipProvider(ValidationExceptionMapper.class.getName())) {
instances.add(new ValidationExceptionMapper());
final String level = SystemInstance.get().getProperty("openejb.cxf.rs.bval.log.level", serviceConfiguration.getProperties().getProperty(CXF_JAXRS_PREFIX + "bval.log.level"));
if (level != null) {
try {
LogUtils.getL7dLogger(ValidationExceptionMapper.class).setLevel(Level.parse(level));
} catch (final UnsupportedOperationException uoe) {
LOGGER.warning("Can't set level " + level + " on " + "org.apache.cxf.jaxrs.validation.ValidationExceptionMapper logger, " + "please configure it in your logging framework.");
}
}
}
}
Aggregations