Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #475 Changed default error handling of HK2 #476

Merged

Conversation

dmatej
Copy link
Contributor

@dmatej dmatej commented Sep 25, 2019

  • originally the HK2 ignored all errors, so when the DynamicConfigurationService
    was not accessible because of classloading issues (on JDK11), it ended up
    with NPE without any usabe cause

  • now by default throws out any "reify" exception that can occur
    until it is configured to use another ErrorService implementation

  • original behavior can be reached by configuring the IgnoringErrorService,
    but only after successful serviceloader initialization (StaticModulesRegistry
    now does it)

  • initialization is successful and the service is configured
    OR you catch an exception, but you should not get unconfigured failing locator.

  • tests were reviewed and fixed, because sometimes they tested states that
    could not be reached without swallowing exceptions.

  • one more test for the new implementation has been added.

@dmatej dmatej force-pushed the fixed-475-initialization-error-handling branch 2 times, most recently from 18a5890 to 9b81765 Compare September 25, 2019 10:14
@smillidge
Copy link
Contributor

@dmatej you have some conflict in the PR can you resolve them

@dmatej dmatej force-pushed the fixed-475-initialization-error-handling branch from 9b81765 to 7b72bf7 Compare October 3, 2019 08:03
@dmatej dmatej force-pushed the fixed-475-initialization-error-handling branch from 7b72bf7 to c1d6470 Compare October 6, 2019 09:24
- originally the HK2 ignored all errors, so when the DynamicConfigurationService
  was not accessible because of classloading issues (on JDK11), it ended up
  with NPE without any usabe cause

- now by default throws out any "reify" exception that can occur
  until it is configured to use another ErrorService implementation
- original behavior can be reached by configuring the IgnoringErrorService,
  but only after successful serviceloader initialization (StaticModulesRegistry
  now does it)
- initialization is successful and the service is configured
  OR you catch an exception, but you should not get unconfigured failing locator.

- tests were reviewed and fixed, because sometimes they tested states that
  could not be reached without swallowing exceptions.
- one more test for the new implementation has been added.

Signed-off-by: David Matejcek <dmatej@seznam.cz>
@dmatej dmatej force-pushed the fixed-475-initialization-error-handling branch from c1d6470 to 0bab62c Compare October 6, 2019 09:27
@smillidge smillidge merged commit d03eed4 into eclipse-ee4j:master Oct 14, 2019
@dmatej dmatej deleted the fixed-475-initialization-error-handling branch October 14, 2019 18:01
am-houtkooper pushed a commit to am-houtkooper/glassfish-hk2 that referenced this pull request Oct 24, 2019
…ion-error-handling

Issue eclipse-ee4j#475 Changed default error handling of HK2
@Cousjava Cousjava added this to the 3.0.0 milestone Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants