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

CLI module missing Jetbrains @Nullable annotation dependency needed in runtime #270

Closed
mplescano opened this issue May 21, 2020 · 2 comments

Comments

@mplescano
Copy link

command: ./bin/sjm --help
version: cli-module-6.0.4-standalone-cli.zip
java version: openjdk version "1.8.0_252"
OpenJDK Runtime Environment (build 1.8.0_252-8u252-b09-1~18.04-b09)
OpenJDK 64-Bit Server VM (build 25.252-b09, mixed mode)

root@mosip-sandbox-v1:/home/mplescano/bin# cd ..
root@mosip-sandbox-v1:/home/mplescano# ./bin/sjm --help
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.NoClassDefFoundError: org/jetbrains/annotations/Nullable
        at org.simplejavamail.internal.clisupport.BuilderApiToPicocliCommandsMapper.getArgumentsForCliOption(BuilderApiToPicocliCommandsMapper.java:237)
        at org.simplejavamail.internal.clisupport.BuilderApiToPicocliCommandsMapper.generateOptionsFromBuilderApi(BuilderApiToPicocliCommandsMapper.java:170)
        at org.simplejavamail.internal.clisupport.BuilderApiToPicocliCommandsMapper.generateOptionsFromBuilderApiChain(BuilderApiToPicocliCommandsMapper.java:135)
        at org.simplejavamail.internal.clisupport.BuilderApiToPicocliCommandsMapper.generateOptionsFromBuilderApi(BuilderApiToPicocliCommandsMapper.java:175)
        at org.simplejavamail.internal.clisupport.BuilderApiToPicocliCommandsMapper.generateOptionsFromBuilderApiChain(BuilderApiToPicocliCommandsMapper.java:135)
        at org.simplejavamail.internal.clisupport.BuilderApiToPicocliCommandsMapper.generateOptionsFromBuilderApi(BuilderApiToPicocliCommandsMapper.java:123)
        at org.simplejavamail.internal.clisupport.CliSupport.<clinit>(CliSupport.java:37)
        at org.simplejavamail.cli.SimpleJavaMail.main(SimpleJavaMail.java:31)
Caused by: java.lang.ClassNotFoundException: org.jetbrains.annotations.Nullable
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        ... 8 more
bbottema added a commit that referenced this issue Jun 13, 2020
… Java Mail actually uses reflection to lookup classes from this dependency
@bbottema
Copy link
Owner

I found that the dependency was misconfigured for Jetbrains nullability annotations. Normally it would be correct like this, but Simple Java Mail actually uses the classes in runtime using reflection.

I'll release a fix in some time, but in the meantime you can easily fix this by dropping the appropriate jar in the lib folder.

@bbottema bbottema added this to the 6.0.5 milestone Jun 13, 2020
@bbottema bbottema changed the title cli sjm failed when showing --help param CLI module missing Jetbrains @Nullable annotation dependency needed in runtime Jun 13, 2020
@bbottema
Copy link
Owner

I just released 6.0.5 which should fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants