-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
java.desktop
module is no longer optional
#4078
Comments
This seems might be easy to fix by either by directly modifying IMO, the second option may be more verbose and might only be solution to only this specific problem, but does not affect the purpose of P.S: Though I am so sure about making certain module "optional" by catching and ignoring |
Catching IllegalAccessError in this special case and ignoring it seems best. |
@JooHyukKim Sorry, I did not find the time yet. I will test it over the weekend. |
Naw this should be specified as As the base version is for JDK8, clients should not be enforced to include a dependency that is only required for backwards compatibility. The error in the description is not related to the dependency from Jackson as well, the class is used in the main module,
The usage of the java.beans.x namespace in the main module is what is throwing this error is it not? In which case java.desktop must be imported into the module-info file as it is referenced directly in the code. |
Hmmmh. To me #4080 seems to make sense, at first glance. But... @GedMarc Moditect set up for
is this what you mean? |
The IllegalAccessError used to be thrown and caught and ignored. I then changed the code to rethrow if the throwable was a 'fatal' error and my 'fatal' error check regards IllegalAccessError as fatal. I think #4080 is a good idea or we could remove the rethrow change that I made in this class. |
@JooHyukKim I tested it, works as expected. Thx! @GedMarc The stack trace is a bit misleading since jackson is embedded in my module. But the call is definitely coming from @pjfanning That is exactly how I see it. |
java.desktop
module is no longer optional
Search before asking
Describe the bug
#2910/#2913 made the
java.desktop
module optional, which worked fine in 2.13.x.After an upgrade to 2.15.2, starting a modular application with Jackson that does not explicitly include
java.desktop
will throw an error:This seems to be caused by the changes introduced in #3827.
IncompatibleClassChangeError
, which is considered fatal and therefore rethrown, is the super class ofIllegalAccessError
, which is thrown when accessing a class from an absent optional module.Version Information
2.15.2
Reproduction
Start a modular application that does not explicitly include java.desktop and creates a new
ObjectMapper
.Expected behavior
The application starts without errors.
Additional context
As a workaround,
Java7Support
can be initialised before creating the firstObjectMapper
, which allows to catch and ignore the exception:The text was updated successfully, but these errors were encountered: