Skip to content

Missing org.springframework.data.util.LazyStreamable #38

@galderz

Description

@galderz

There appears to be a broken classpath in the quarkus-spring-commons-api-3.4.jar. org.springframework.data.util.Streamable is there but org.springframework.data.util.LazyStreamable is not. Streamable depends on LazyStreamable for:

	static <T> Streamable<T> of(Supplier<? extends Stream<T>> supplier) {
		return LazyStreamable.of(supplier);
	}

You can probably reproduce this in Java if someone calls Streamable.of(...). Class resolution in Java is lazy so someone needs to invoke that to trigger it. However, in the current Quarkus native image configuration, link at build time is enabled so class resolution is eager which highlights this issue.

We've found this during our experiments with upcoming --future-defaults=all where more of runtime reflection is required as a result of more runtime initialization (see GraalVM 25 release notes):

2025-10-09 10:22:29,387 ERROR [io.qua.ver.htt.run.QuarkusErrorHandler] (executor-thread-1) HTTP Request to /book/paged?size=2&page=1 failed, error id: d552e4f7-67c8-413a-a428-3b3930cc400d-1: org.graalvm.nativeimage.MissingReflectionRegistrationError: Cannot reflectively invoke method 'public default boolean org.springframework.data.util.Streamable.isEmpty()'. To allow this operation, add the following to the 'reflection' section of 'reachability-metadata.json' and rebuild the native image:

  {
    "type": "org.springframework.data.util.Streamable",
    "methods": [
      {
        "name": "isEmpty",
        "parameterTypes": []
      }
    ]
  }

The 'reachability-metadata.json' file should be located in 'META-INF/native-image/<group-id>/<artifact-id>/' of your project. For further help, see https://www.graalvm.org/latest/reference-manual/native-image/metadata/#reflection
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.reflect.MissingReflectionRegistrationUtils.reportInvokedExecutable(MissingReflectionRegistrationUtils.java:110)
	at java.base@25/java.lang.reflect.Method.acquireMethodAccessor(Method.java:144)
	at java.base@25/java.lang.reflect.Method.invoke(Method.java:562)
	at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:688)
	at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:760)
	at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:183)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:503)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:423)
	at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1583)
	at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:1061)
	at org.jboss.resteasy.plugins.providers.jackson.ResteasyJackson2Provider.writeTo(ResteasyJackson2Provider.java:337)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions