ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
MIT License
545 stars 129 forks source link

Crash when starting a springboot application with a YAML env file #225

Open BaraBaltico opened 10 months ago

BaraBaltico commented 10 months ago

When attempting to run a springboot app with the envfile pointing to a yaml file I have the crash below.Putting the same properties into a .properties file works fine. Runtime is Java 17 on windows

  Failed to execute java run configuration async

  java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class java.lang.String (java.util.LinkedHashMap and java.lang.String are in module java.base of loader 'bootstrap')
at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
at net.ashald.envfile.platform.EnvFileEnvironmentVariables.render(EnvFileEnvironmentVariables.java:68)
at net.ashald.envfile.products.idea.IdeaRunConfigurationExtension.updateJavaParameters(IdeaRunConfigurationExtension.java:71)
at com.intellij.execution.RunConfigurationExtension.updateJavaParameters(RunConfigurationExtension.java:27)
at com.intellij.execution.JavaRunConfigurationExtensionManager.updateJavaParameters(JavaRunConfigurationExtensionManager.kt:42)
at com.intellij.execution.application.BaseJavaApplicationCommandLineState.lambda$setupJavaParameters$0(BaseJavaApplicationCommandLineState.java:37)
at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:64)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:923)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:76)
at com.intellij.openapi.application.ReadAction.run(ReadAction.java:63)
at com.intellij.execution.application.BaseJavaApplicationCommandLineState.setupJavaParameters(BaseJavaApplicationCommandLineState.java:36)
at com.intellij.execution.application.ApplicationCommandLineState.createJavaParameters(ApplicationCommandLineState.java:62)
at com.intellij.spring.boot.run.SpringBootCommandLineState.createJavaParameters(SpringBootCommandLineState.java:46)
at com.intellij.execution.configurations.JavaCommandLineState.getJavaParameters(JavaCommandLineState.java:41)
at com.intellij.execution.impl.DefaultJavaProgramRunner.patchJavaCommandLineParams(DefaultJavaProgramRunner.java:132)
at com.intellij.execution.impl.DefaultJavaProgramRunner.lambda$doExecuteAsync$4(DefaultJavaProgramRunner.java:158)
at com.intellij.execution.target.TargetEnvironmentAwareRunProfileState$1.run(TargetEnvironmentAwareRunProfileState.java:58)
at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:428)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:115)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:478)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:251)
at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:71)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173)
at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:71)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:251)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:465)
at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$19(ProgressRunner.java:477)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699)
at java.base/java.lang.Thread.run(Thread.java:833)

immagine