Taack opened a new issue, #14825:
URL: https://github.com/apache/grails-core/issues/14825
### Expected Behavior
Running native docker image should work correctly like non-native image.
### Actual Behaviour
When activating native image via the `bootBuildImage` closure as such:
```groovy
bootBuildImage {
verboseLogging = true
environment = [
"BP_NATIVE_IMAGE": "true",
"BP_JVM_VERSION": "24",
]
}
```
Docker run always fails:
```bash
❯ docker run --rm --network="host" test:0.1
java.io.IOException: Stream closed
at
[email protected]/java.io.BufferedInputStream.getInIfOpen(BufferedInputStream.java:170)
at
[email protected]/java.io.BufferedInputStream.fill(BufferedInputStream.java:289)
at
[email protected]/java.io.BufferedInputStream.read1(BufferedInputStream.java:330)
at
[email protected]/java.io.BufferedInputStream.read(BufferedInputStream.java:388)
at
[email protected]/java.io.DataInputStream.readFully(DataInputStream.java:213)
at
[email protected]/java.io.DataInputStream.readUnsignedShort(DataInputStream.java:346)
at
[email protected]/java.io.DataInputStream.readUTF(DataInputStream.java:580)
at
[email protected]/java.io.DataInputStream.readUTF(DataInputStream.java:555)
at
org.codehaus.groovy.reflection.GeneratedMetaMethod$DgmMethodRecord.loadDgmInfo(GeneratedMetaMethod.java:200)
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:207)
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:116)
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:94)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:37)
at
org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:71)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.createMap(ScriptBytecodeAdapter.java:641)
at grails.util.BuildSettings.<clinit>(BuildSettings.groovy)
at test.Application.<clinit>(Application.groovy)
at
[email protected]/java.lang.invoke.DirectMethodHandle.ensureInitialized(DirectMethodHandle.java:328)
at
[email protected]/java.lang.invoke.DirectMethodHandle.internalMemberNameEnsureInit(DirectMethodHandle.java:341)
Exception in thread "main" java.lang.ExceptionInInitializerError
at
org.codehaus.groovy.runtime.InvokerHelper.<clinit>(InvokerHelper.java:71)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.createMap(ScriptBytecodeAdapter.java:641)
at grails.util.BuildSettings.<clinit>(BuildSettings.groovy)
at test.Application.<clinit>(Application.groovy)
at
[email protected]/java.lang.invoke.DirectMethodHandle.ensureInitialized(DirectMethodHandle.java:328)
at
[email protected]/java.lang.invoke.DirectMethodHandle.internalMemberNameEnsureInit(DirectMethodHandle.java:341)
Caused by: java.lang.NullPointerException
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:122)
at
org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:94)
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:37)
... 6 more
```
Note: I could compile the native image to fails later, but the process is
complex.
### Steps To Reproduce
1. Start docker: `sudo systemctl restart docker`
2. Build the native image: `./gradlew bootBuildImage`
3. run the native image: `docker run --rm --network="host" test:0.1`
Things fails with a IOException...
[test.zip](https://github.com/user-attachments/files/20873044/test.zip)
### Environment Information
````bash
❯ uname -a
Linux cachyos-x8664 6.15.3-2-cachyos #1 SMP PREEMPT_DYNAMIC Thu, 19 Jun 2025
15:58:12 +0000 x86_64 GNU/Linux
❯ ~/.jdks/openjdk-24.0.1/bin/java -fullversion
openjdk full version "24.0.1+9-30"
```
### Example Application
_No response_
### Version
7.0.0-SNAPSHOT
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]