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

modules - java.desktop dependency? #13

Closed
ryanhamilton opened this issue Jan 24, 2023 · 6 comments
Closed

modules - java.desktop dependency? #13

ryanhamilton opened this issue Jan 24, 2023 · 6 comments

Comments

@ryanhamilton
Copy link

Hi,

I'm using your library in our product: https://www.timestored.com/pulse/

Currently I am trying to bundle our tool with a reduced JRE using java 9 modules. Two issues:

  1. Your library doesn't include a module-info.java (not breaking, just a warning)
  2. Your library seems to rely on snakeyaml which relied on java.desktop module. I get the below stack trace when I include your library. I only get this error if I remove the java.desktop module. The desktop module mostly includes swing/awt and is quite large. Since mine is not a graphical java program I would really like to remove that large depency to remove 10MB from the bundled JRE.

It's up to you, maybe most your users are not trying to bundle a reduced JRE.
Thanks again for a useful library,
Ryan

Exception in thread "main" java.lang.NoClassDefFoundError: java/beans/IntrospectionException
        at org.yaml.snakeyaml.representer.BaseRepresenter.getPropertyUtils(BaseRepresenter.java:202)
        at uk.org.webcompere.lightweightconfig.ConfigLoader.getYaml(ConfigLoader.java:205)
        at uk.org.webcompere.lightweightconfig.ConfigLoader.loadAs(ConfigLoader.java:117)
        at uk.org.webcompere.lightweightconfig.ConfigLoader.loadYmlConfigFromResource(ConfigLoader.java:43)
        at com.sqldashboards.webby.Application.forceConfigReload(Application.java:124)
        at com.sqldashboards.webby.Application.<clinit>(Application.java:45)
Caused by: java.lang.ClassNotFoundException: java.beans.IntrospectionException
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        ... 6 more
@ryanhamilton
Copy link
Author

Actually I investigated a little and it seems the problem is much much wider:
spring-projects/spring-framework#26884
I can't take advantage of your fix unless spring itself improves :(

@ashleyfrieze
Copy link
Member

I don't think snakeyml uses java.desktop - https://bitbucket.org/snakeyaml/snakeyaml/src/master/pom.xml - it seems to have no major dependencies.

If you're using Spring, why do you need this package? Spring has its own rich configuration system.

@ashleyfrieze
Copy link
Member

There is no dependency on java.desktop, though your IDE may include that in your project - this is what's pulled in by maven
image

@ashleyfrieze
Copy link
Member

In the interests of keeping this project viable, I'm releasing v1.2.1 - this has the latest snakeyml, which should hopefully be as compatible as possible with the latest JDKs etc. I've rebuilt the project against JDK17.

@ryanhamilton
Copy link
Author

Thank you.

@ashleyfrieze
Copy link
Member

#17 contains the latest snakeyaml upgrade

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

No branches or pull requests

2 participants