Hi,

Using Safeguard with OWB under TomEE fails the Fault Tolerance TCK.

This is due to the fact that current Safeguard uses a different OWB lifecycle event to register deployment problems.

The old version uses a different lifecycle event to declare the errors:

public void throwExceptions(@Observes AfterBeanDiscovery afterBeanDiscovery) { microProfileValidator.forThrowable(afterBeanDiscovery::addDefinitionError); }

The new one:
void addDefinitionErrors(@Observes AfterDeploymentValidation validation) { this.beansToValidate.stream().map(this::validate).filter(Objects::nonNull).forEach(validation::addDeploymentProblem); this.beansToValidate.clear(); }

/AfterBeanDiscovery/ happens before /AfterDeploymentValidation/ leading to a different exception being thrown from OWB.

My guess is that /AfterDeploymentValidation/ should not be used to declare actual deployment problems.

This can be verified using the code in this TomEE PR: https://github.com/apache/tomee/pull/365

Executing this test: mvn clean install -Dtest=InvalidRetryDelayTest

What would be the right approach to solve this problem?

Cheers.

--
Bruno Baptista
https://twitter.com/brunobat_


Reply via email to