OK, my non-cached services have the payloads validated now, but one annotated
with @CacheResult is throwing a NPE if accountId is null. I'm using a
parameter annotation instead of a instance variable annotation.
DTO:
@ConstructorProperties({"customerGuid", "masIp", "maxAgeMs", "transId",
"accountId"})
public CustStbDto(final String customerGuid, final String masIp,
final Long maxAgeMs, final Long transId,
@NotNull final String accountId) {
Service:
@Path("/someurl")
@POST
@ValidateOnExecution
@Valid
public Response getCustomerSTBData(@Valid final CustStbDto custStbDto) {
CustStbDto retCustStbDto = masBean.getCustomerSTBData(custStbDto.
getGetCustomerSTBData().getAccountId(), custStbDto);
Bean:
@CacheResult(cacheName = "customerStbData")
public CustStbDto getCustomerSTBData(@CacheKey final String accountId,
final CustStbDto custStbDto) {
log.debug("Not in cache");
GeneratedCacheKey:
public StringGeneratedCacheKey(final String val) {
this.value = val;
this.cachedHash = val.hashCode();
}
It's NPE on this.cachedHash = val.hashCode();
--
View this message in context:
http://tomee-openejb.979440.n4.nabble.com/Bean-validation-with-JCache-tp4677284.html
Sent from the TomEE Users mailing list archive at Nabble.com.