Hi there

I use the cxf spring boot starter for jaxrs in version 3.3.5: 
cxf-spring-boot-starter-jaxrs

My REST service expects a java.time.LocalDate as a query parameter. When 
testing the API I get the error:
"Parameter Class java.time.LocalDate has no constructor with single String 
parameter, static valueOf(String) or fromString(String) methods"

I've implemented a custom ParamConverterProvider and annotated as a @Component:

@Component
public class DateParameterConverterProvider implements ParamConverterProvider {

    @Override
    public <T> ParamConverter<T> getConverter(Class<T> type, Type type1, 
Annotation[] antns) {
        if (LocalDate.class.equals(type)) {
            @SuppressWarnings("unchecked")
            ParamConverter<T> paramConverter = (ParamConverter<T>) new 
DateParameterConverter();
            return paramConverter;
        }
        return null;
    }
}

Nevertheless, the InjectionUtils class gets an Optional.empty converter here:
final Optional<ParamConverter<T>> converter = getParamConverter(pClass, 
genericType, paramAnns, message);


What am I missing to register my custom ParamConverterProvider.

Thanks
Oli




Reply via email to