Hi,
The PR to integrate the latest Safeguard into TomEE is ready for review
here: https://github.com/apache/tomee/pull/365/
The TCK now passes with TomEE.
[INFO] Results:
[INFO]
[INFO] Tests run: 213, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[INFO]
I'll run a full build tomorrow because this upgrades a few crosscutting
libraries.
Cheers
Bruno Baptista
https://twitter.com/brunobat_
On 08/01/19 18:06, Bruno Baptista wrote:
I think I found the problem.
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/.
My guess is that /AfterDeploymentValidation/ should not be used to
declare actual deployment problems.
This is probably a Safegard bug.
Cheers
Bruno Baptista
https://twitter.com/brunobat_
On 08/01/19 17:53, Roberto Cortez wrote:
Yes, it was using a DefinitionException, but it shouldn’t matter that much,
since the problem should happen anyway as you describe.
On 8 Jan 2019, at 17:27, Bruno Baptista<bruno...@gmail.com> wrote:
Correct, but on the TCK, the FaultToleranceDefinitionException has not been
released yet...
I was also wondering about the old version while I was going for some tea...
I'll run the same test on the old version and see want happens.
Bruno Baptista
https://twitter.com/brunobat_
On 08/01/19 17:24, Roberto Cortez wrote:
Hum, I wonder how was that working before with the old version?
Are the expected exceptions new in the TCK? Looking into the code, it seems
they are there since 2017, and actually you changed the expect from
DefinitionException to FaultToleranceDefinitionException.
Anyway, in the previous Safeguard version the TCK executed fine, and I guess
the exception assertion was being done correctly, right?
On 8 Jan 2019, at 17:05, Bruno Baptista<bruno...@gmail.com> wrote:
Hi folks,
This is a status update on the upgrade of Safeguard.
I was able to fix most issues, but a deeper problem remains.
When an app is being deployed, the /SafeguardExtension/ goes over it's
annotations and if something wrong is detected, a /DefinitionException/ is
thrown, as expected. This works perfectly in the standalone library.
The problem is that TomEE sees that exception through OpenWebBeans, where the
exception is swollen here:
https://github.com/apache/openwebbeans/blob/4c7ee3d192b56cc74e5218f99f7e7f5a78e60d56/webbeans-impl/src/main/java/org/apache/webbeans/util/WebBeansUtil.java#L1129
Thus, the Arquillian deployment doesn't receive /DefinitionException as
expected/ but a /DeploymentException/.
Any suggestion on how to tackle this?
There is a work in progress here:https://github.com/apache/tomee/pull/365
Cheers
--
Bruno Baptista
https://twitter.com/brunobat_