You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Bruno Baptista <br...@gmail.com> on 2019/01/09 17:09:40 UTC
Safegard handling of deployment problems
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_
Re: Safegard handling of deployment problems
Posted by Bruno Baptista <br...@gmail.com>.
Thanks Romain,
That seems to fix the issue.
Bruno Baptista
https://twitter.com/brunobat_
On 09/01/19 19:38, Romain Manni-Bucau wrote:
> Hello Bruno
>
> Upgrade either tck or owb in tomee.
>
> Le mer. 9 janv. 2019 18:09, Bruno Baptista <brunobat@gmail.com
> <ma...@gmail.com>> a écrit :
>
> 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_
>
>
Re: Safegard handling of deployment problems
Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hello Bruno
Upgrade either tck or owb in tomee.
Le mer. 9 janv. 2019 18:09, Bruno Baptista <br...@gmail.com> a écrit :
> 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_
>
>
>