Skip to content

Error when launching in kubernetes #149

Description

@nyanmark

Honestly tried to make sense of it by googling but couldn't understand what the error was I have other java spring containers running in the same cluster without problems.

It looks like it may be related to this:
oracle/graal#3096
spring-projects/spring-boot#34314

I have tried both latest and native latest

Exception in thread "main" java.lang.IllegalArgumentException: Unable to instantiate factory class [org.springframework.boot.autoconfigure.BackgroundPreinitializer] for factory type [org.springframework.context.ApplicationListener]
	at org.springframework.core.io.support.SpringFactoriesLoader$FailureHandler.lambda$throwing$0(SpringFactoriesLoader.java:650)
	at org.springframework.core.io.support.SpringFactoriesLoader$FailureHandler.lambda$handleMessage$3(SpringFactoriesLoader.java:674)
	at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:231)
	at org.springframework.core.io.support.SpringFactoriesLoader.load(SpringFactoriesLoader.java:206)
	at org.springframework.core.io.support.SpringFactoriesLoader.load(SpringFactoriesLoader.java:160)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:459)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:455)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:274)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:252)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1302)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1291)
	at org.observabilitystack.geoip.GeoIpApi.main(GeoIpApi.java:27)
Caused by: java.lang.InternalError: java.lang.reflect.InvocationTargetException
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.Metrics.systemMetrics(Metrics.java:67)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.Container.metrics(Container.java:44)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.ContainerInfo.<init>(ContainerInfo.java:34)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.Containers.activeProcessorCount(Containers.java:125)
	at java.base@17.0.5/java.lang.Runtime.availableProcessors(Runtime.java:247)
	at org.springframework.boot.autoconfigure.BackgroundPreinitializer.<clinit>(BackgroundPreinitializer.java:68)
	at java.base@17.0.5/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base@17.0.5/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at org.springframework.core.io.support.SpringFactoriesLoader$FactoryInstantiator.instantiate(SpringFactoriesLoader.java:381)
	at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:228)
	... 9 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.base@17.0.5/java.lang.reflect.Method.invoke(Method.java:568)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.Metrics.systemMetrics(Metrics.java:63)
	... 18 more
Caused by: java.lang.ExceptionInInitializerError
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupSubsystemFactory.create(CgroupSubsystemFactory.java:78)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupMetrics.getInstance(CgroupMetrics.java:164)
	... 20 more
Caused by: java.lang.NullPointerException
	at java.base@17.0.5/java.util.Objects.requireNonNull(Objects.java:208)
	at java.base@17.0.5/sun.nio.fs.UnixFileSystem.getPath(UnixFileSystem.java:263)
	at java.base@17.0.5/java.nio.file.Path.of(Path.java:147)
	at java.base@17.0.5/java.nio.file.Paths.get(Paths.java:69)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupUtil.lambda$readStringValue$0(CgroupUtil.java:57)
	at java.base@17.0.5/java.security.AccessController.executePrivileged(AccessController.java:144)
	at java.base@17.0.5/java.security.AccessController.doPrivileged(AccessController.java:569)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupUtil.readStringValue(CgroupUtil.java:59)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupSubsystemController.getStringValue(CgroupSubsystemController.java:66)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.CgroupSubsystemController.getLongValue(CgroupSubsystemController.java:125)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.cgroupv1.CgroupV1Subsystem.getLongValue(CgroupV1Subsystem.java:269)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.cgroupv1.CgroupV1Subsystem.getHierarchical(CgroupV1Subsystem.java:215)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.cgroupv1.CgroupV1Subsystem.setSubSystemControllerPath(CgroupV1Subsystem.java:203)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.cgroupv1.CgroupV1Subsystem.initSubSystem(CgroupV1Subsystem.java:111)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.containers.cgroupv1.CgroupV1Subsystem.<clinit>(CgroupV1Subsystem.java:47)
	... 22 more

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions