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

dbm-gorm-diff test.groovy fails with no jansi in java.library.path #13980

Open
madsj opened this issue Jan 22, 2025 · 0 comments
Open

dbm-gorm-diff test.groovy fails with no jansi in java.library.path #13980

madsj opened this issue Jan 22, 2025 · 0 comments

Comments

@madsj
Copy link

madsj commented Jan 22, 2025

Expected Behavior

When I am trying to run > ./gradlew runCommand "-Pargs=dbm-gorm-diff test.groovy"

I am getting this output

Exception in thread "main" java.lang.ExceptionInInitializerError
at grails.ui.command.GrailsApplicationContextCommandRunner.run(GrailsApplicationContextCommandRunner.groovy:45)
at grails.ui.command.GrailsApplicationContextCommandRunner.main(GrailsApplicationContextCommandRunner.groovy:102)
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException: java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path: /Users/user/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:., /private/var/folders/dl/tyh5fnpj3vvdyd2ng2lcqsqw0000gn/T/libjansi-64-3530738537611309095.jnilib: dlopen(/private/var/folders/dl/tyh5fnpj3vvdyd2ng2lcqsqw0000gn/T/libjansi-64-3530738537611309095.jnilib, 0x0001): tried: '/private/var/folders/dl/tyh5fnpj3vvdyd2ng2lcqsqw0000gn/T/libjansi-64-3530738537611309095.jnilib' (fat file, but missing compatible architecture (have 'x86_64,i386', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/dl/tyh5fnpj3vvdyd2ng2lcqsqw0000gn/T/libjansi-64-3530738537611309095.jnilib' (no such file), '/private/var/folders/dl/tyh5fnpj3vvdyd2ng2lcqsqw0000gn/T/libjansi-64-3530738537611309095.jnilib' (fat file, but missing compatible architecture (have 'x86_64,i386', need 'arm64e' or 'arm64'))]
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:74)
at org.codehaus.groovy.reflection.CachedConstructor.doConstructorInvoke(CachedConstructor.java:59)
at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1812)
at groovy.lang.MetaClassImpl.invokeConstructor(MetaClassImpl.java:1601)
at org.codehaus.groovy.runtime.InvokerHelper.invokeConstructorOf(InvokerHelper.java:1090)
at org.codehaus.groovy.runtime.DefaultGroovyMethods.newInstance(DefaultGroovyMethods.java:18111)
at org.grails.core.io.support.GrailsFactoriesLoader.loadFactoriesWithArguments(GrailsFactoriesLoader.groovy:65)
at org.grails.core.io.support.GrailsFactoriesLoader.loadFactories(GrailsFactoriesLoader.groovy:47)
at grails.dev.commands.ApplicationContextCommandRegistry.(ApplicationContextCommandRegistry.groovy:33)
... 2 more

Caused by: java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path: /Users/user/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:., /private/var/folders/dl/tyh5fnpj3vvdyd2ng2lcqsqw0000gn/T/libjansi-64-3530738537611309095.jnilib: dlopen(/private/var/folders/dl/tyh5fnpj3vvdyd2ng2lcqsqw0000gn/T/libjansi-64-3530738537611309095.jnilib, 0x0001): tried: '/private/var/folders/dl/tyh5fnpj3vvdyd2ng2lcqsqw0000gn/T/libjansi-64-3530738537611309095.jnilib' (fat file, but missing compatible architecture (have 'x86_64,i386', need 'arm64e' or 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/private/var/folders/dl/tyh5fnpj3vvdyd2ng2lcqsqw0000gn/T/libjansi-64-3530738537611309095.jnilib' (no such file), '/private/var/folders/dl/tyh5fnpj3vvdyd2ng2lcqsqw0000gn/T/libjansi-64-3530738537611309095.jnilib' (fat file, but missing compatible architecture (have 'x86_64,i386', need 'arm64e' or 'arm64'))]
at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:182)
at org.fusesource.hawtjni.runtime.Library.load(Library.java:140)
at org.fusesource.jansi.internal.CLibrary.(CLibrary.java:42)
at org.fusesource.jansi.AnsiConsole.wrapOutputStream(AnsiConsole.java:48)
at org.fusesource.jansi.AnsiConsole.(AnsiConsole.java:38)
at grails.build.logging.GrailsConsole.ansiWrap(GrailsConsole.java:319)
at grails.build.logging.GrailsConsole.wrapInPrintStream(GrailsConsole.java:220)
at grails.build.logging.GrailsConsole.bindSystemOutAndErr(GrailsConsole.java:204)
at grails.build.logging.GrailsConsole.initialize(GrailsConsole.java:178)
at grails.build.logging.GrailsConsole.(GrailsConsole.java:159)
at grails.build.logging.GrailsConsole.createInstance(GrailsConsole.java:407)
at grails.build.logging.GrailsConsole.getInstance(GrailsConsole.java:329)
at scaffolding.CreateScaffoldControllerCommand.(CreateScaffoldControllerCommand.groovy:40)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:72)
... 10 more

I am using an Apple M1 Max hence the requirement for arm. I seems as fair as i know to be an issue regarding a very old version of jansi.version=1.18 in the GrailsConsole.

Are there any way to apply a workaround?

Actual Behaviour

GrailsConsole works and dbm-gorm-diff runs

Steps To Reproduce

Run ./gradlew runCommand "-Pargs=dbm-gorm-diff test.groovy"

Environment Information

macos 15.1.1 (M1 Max)

openjdk version "17.0.8.1" 2023-08-24

Example Application

No response

Version

6.2.3

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

1 participant