org.springframework.boot.env.EnvironmentPostProcessor is still used

Aberta
#116 2 comentários 1 reação 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
Meio dia
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Ativa
Stack de tecnologia
java, spring-boot
Domínio
backend

Direção de pesquisa

The failure is raised from org.springframework.cloud.bindings.boot.BindingFlattenedEnvironmentPostProcessor, which the stack trace shows being instantiated through SpringFactoriesLoader as an ApplicationListener. Start by finding where this class and its factory registration live in the repository, and check how it references the deprecated org.springframework.boot.env.EnvironmentPostProcessor. Done means the class loads and the binding tests pass against Spring Boot 4.2.0-M1, which is the version the reporter says is failing.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

org.springframework.boot.env.EnvironmentPostProcessor is deprecated as of Spring Boot 4.0 but Spring Cloud bindings still use it. We're working on Spring Boot 4.2.0-M1 where this is scheduled for removal and our tests are now failing:


Calculating JVM memory based on 11610600K available memory |  
-- | --
For more information on this calculation, see https://paketo.io/docs/reference/java-reference/#memory-calculator |  
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -Xmx11227395K -XX:MaxMetaspaceSize=76004K -XX:ReservedCodeCacheSize=240M -Xss1M (Total Memory: 11610600K, Thread Count: 50, Loaded Class Count: 11005, Headroom: 0%) |  
Enabling Java Native Memory Tracking |  
Adding 121 container CA certificates to JVM truststore |  
Spring Cloud Bindings Enabled |  
Picked up JAVA_TOOL_OPTIONS: -Djava.security.properties=/layers/paketo-buildpacks_bellsoft-liberica/java-security-properties/java-security.properties -XX:+ExitOnOutOfMemoryError -XX:MaxDirectMemorySize=10M -Xmx11227395K -XX:MaxMetaspaceSize=76004K -XX:ReservedCodeCacheSize=240M -Xss1M -XX:+UnlockDiagnosticVMOptions -XX:NativeMemoryTracking=summary -XX:+PrintNMTStatistics -Dorg.springframework.cloud.bindings.boot.enable=true |  
Exception in thread "main" java.lang.reflect.InvocationTargetException |  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) |  
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) |  
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) |  
at java.base/java.lang.reflect.Method.invoke(Unknown Source) |  
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:106) |  
at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:64) |  
at org.springframework.boot.loader.launch.WarLauncher.main(WarLauncher.java:53) |  
Caused by: java.lang.IllegalArgumentException: Unable to instantiate factory class [org.springframework.cloud.bindings.boot.BindingFlattenedEnvironmentPostProcessor] for factory type [org.springframework.context.ApplicationListener] |  
at org.springframework.core.io.support.SpringFactoriesLoader$FailureHandler.lambda$throwing$0(SpringFactoriesLoader.java:632) |  
at org.springframework.core.io.support.SpringFactoriesLoader$FailureHandler.lambda$handleMessage$0(SpringFactoriesLoader.java:656) |  
at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:225) |  
at org.springframework.core.io.support.SpringFactoriesLoader.load(SpringFactoriesLoader.java:201) |  
at org.springframework.core.io.support.SpringFactoriesLoader.load(SpringFactoriesLoader.java:157) |  
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:472) |  
at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:468) |  
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:282) |  
at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:260) |  
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1365) |  
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354) |  
at example.ExampleApplication.main(ExampleApplication.java:13) |  
... 7 more |  
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/env/EnvironmentPostProcessor |  
at java.base/java.lang.ClassLoader.defineClass1(Native Method) |  
at java.base/java.lang.ClassLoader.defineClass(Unknown Source) |  
at java.base/java.security.SecureClassLoader.defineClass(Unknown Source) |  
at java.base/java.net.URLClassLoader.defineClass(Unknown Source) |  
at java.base/java.net.URLClassLoader$1.run(Unknown Source) |  
at java.base/java.net.URLClassLoader$1.run(Unknown Source) |  
at java.base/java.security.AccessController.doPrivileged(Unknown Source) |  
at java.base/java.net.URLClassLoader.findClass(Unknown Source) |  
at java.base/java.lang.ClassLoader.loadClass(Unknown Source) |  
at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.loadClass(JarUrlClassLoader.java:97) |  
at org.springframework.boot.loader.launch.LaunchedClassLoader.loadClass(LaunchedClassLoader.java:91) |  
at java.base/java.lang.ClassLoader.loadClass(Unknown Source) |  
at java.base/java.lang.Class.forName0(Native Method) |  
at java.base/java.lang.Class.forName(Unknown Source) |  
at org.springframework.util.ClassUtils.forName(ClassUtils.java:308) |  
at org.springframework.core.io.support.SpringFactoriesLoader.instantiateFactory(SpringFactoriesLoader.java:218) |  
... 16 more |  
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.env.EnvironmentPostProcessor |  
at java.base/java.net.URLClassLoader.findClass(Unknown Source) |  
at java.base/java.lang.ClassLoader.loadClass(Unknown Source) |  
at org.springframework.boot.loader.net.protocol.jar.JarUrlClassLoader.loadClass(JarUrlClassLoader.java:97) |  
at org.springframework.boot.loader.launch.LaunchedClassLoader.loadClass(LaunchedClassLoader.java:91) |  
at java.base/java.lang.ClassLoader.loadClass(Unknown Source) |  
... 32 more |  

Linguagem predominante
Java
Estrelas
50
Forks
33
Merge médio
6d 2h
PRs com merge (30d)
2

Preparar o ambiente

Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de spring-cloud/spring-cloud-bindings

Todas as issues de spring-cloud/spring-cloud-bindings

Issues semelhantes

Mais issues de Java

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.