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

Julia template generation error after changing jdk #41

Closed
agerlach opened this issue Jun 14, 2024 · 6 comments · Fixed by #43
Closed

Julia template generation error after changing jdk #41

agerlach opened this issue Jun 14, 2024 · 6 comments · Fixed by #43
Assignees

Comments

@agerlach
Copy link

When moving to a new computer I started to get

java -Xmx2048m -jar LmcpGen.jar -mdmdir ~/MDMs/ -jl -dir ./output
Exception in thread "main" java.lang.IllegalArgumentException: java.lang.Exception: Method calling exception.  Trying to access method name: root_module_includes for file: LMCP.jl
        at avtas.lmcp.lmcpgen.LmcpGen.main(LmcpGen.java:378)
        at avtas.lmcp.lmcpgen.LmcpGenGUI.main(LmcpGenGUI.java:222)
Caused by: java.lang.Exception: Method calling exception.  Trying to access method name: root_module_includes for file: LMCP.jl
        at avtas.lmcp.lmcpgen.LmcpGen.replaceTags(LmcpGen.java:221)
        at avtas.lmcp.lmcpgen.LmcpGen.makePackage(LmcpGen.java:72)
        at avtas.lmcp.lmcpgen.LmcpGen.main(LmcpGen.java:375)
        ... 1 more
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at avtas.lmcp.lmcpgen.LmcpGen.replaceTags(LmcpGen.java:217)
        ... 3 more
Caused by: java.lang.NoSuchMethodError: java.lang.String.isBlank()Z
        at avtas.lmcp.lmcpgen.JuliaMethods.BuildDependencyGraph(JuliaMethods.java:63)
        at avtas.lmcp.lmcpgen.JuliaMethods.root_module_includes(JuliaMethods.java:369)
        ... 8 more

On the new computer I have

❯ java -version
openjdk version "1.8.0_412"
OpenJDK Runtime Environment Corretto-8.412.08.1 (build 1.8.0_412-b08)
OpenJDK 64-Bit Server VM Corretto-8.412.08.1 (build 25.412-b08, mixed mode)

vs the following for the old

❯ java -version
openjdk version "1.8.0.2.1" 2022-08-18
OpenJDK Runtime Environment (build 1.8.0.2.1+1-1)
OpenJDK 64-Bit Server VM (build 18.0.2.1+1-1, mixed mode, sharing)

Generation works fine for all other template flags. According to @ctaylor80 seems to be related to this https://stackoverflow.com/questions/55312387/why-my-stringutils-class-doesnt-have-isblank

@agerlach
Copy link
Author

We plan on putting a PR together, but I wanted to make sure it was documented first.

@VVCAS-Sean
Copy link
Contributor

@agerlach Can you provide a little more detail, as I am unable to replicate the error. What OS and command are you using to get this error?

@agerlach
Copy link
Author

The command is in the first line of code in the OP. This is MacOS 14.5 on an Apple ARM chip. This issue only cropped up after migrating machines. As posted above the JDK version is slightly different but I don't have the freedom to change that.

After more testing, I can confirm that this issue only happens with the -jl template flag. All others run without issue.

@ctaylor80
Copy link

I'll add I highly suspect this bug is related to using the OpenJDK vs the Oracle provided JDK.

@VVCAS-Sean
Copy link
Contributor

Understood. Neither myself or @DocEast have a MacOS development environment, so don't think we can be of any help. Will be on the lookout for a fix in a PR. Will you need a new release after the fix PR is pulled in?

@agerlach
Copy link
Author

yes

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

Successfully merging a pull request may close this issue.

4 participants