intellij-quarkus
intellij-quarkus copied to clipboard
NumberFormatException while using env var for `quarkus.http.port` in application.properties
application.properties:
quarkus.http.port=${PORT:8080}
Exception:
Error while converting '${PORT:8080}' as Integer for key 'quarkus.http.port'
java.lang.NumberFormatException: For input string: "${PORT:8080}"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.base/java.lang.Integer.parseInt(Integer.java:638)
at java.base/java.lang.Integer.parseInt(Integer.java:770)
at com.redhat.devtools.intellij.lsp4mp4ij.psi.core.project.AbstractConfigSource.getPropertyAsInt(AbstractConfigSource.java:188)
at com.redhat.devtools.intellij.lsp4mp4ij.psi.core.project.PsiMicroProfileProject.getPropertyAsInteger(PsiMicroProfileProject.java:77)
at com.redhat.microprofile.psi.internal.quarkus.jaxrs.java.QuarkusJaxRsCodeLensParticipant.beginCodeLens(QuarkusJaxRsCodeLensParticipant.java:46)
at com.redhat.devtools.intellij.lsp4mp4ij.psi.core.PropertiesManagerForJava.lambda$collectCodeLens$3(PropertiesManagerForJava.java:145)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
at com.redhat.devtools.intellij.lsp4mp4ij.psi.core.PropertiesManagerForJava.collectCodeLens(PropertiesManagerForJava.java:145)
at com.redhat.devtools.intellij.lsp4mp4ij.psi.core.PropertiesManagerForJava.lambda$codeLens$1(PropertiesManagerForJava.java:123)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:920)
at com.redhat.devtools.intellij.lsp4mp4ij.psi.core.PropertiesManagerForJava.codeLens(PropertiesManagerForJava.java:116)
at com.redhat.devtools.intellij.quarkus.lsp.QuarkusLanguageClient.lambda$getJavaCodelens$12(QuarkusLanguageClient.java:171)
at com.redhat.devtools.intellij.quarkus.lsp.QuarkusLanguageClient.lambda$runAsBackground$2(QuarkusLanguageClient.java:120)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:189)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$12(CoreProgressManager.java:608)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:683)
at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:639)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:607)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:60)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:176)
at com.redhat.devtools.intellij.quarkus.lsp.QuarkusLanguageClient.lambda$runAsBackground$3(QuarkusLanguageClient.java:118)
at com.redhat.devtools.intellij.quarkus.lsp.QuarkusLanguageClient.lambda$runAsBackground$4(QuarkusLanguageClient.java:128)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1728)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
I am facing the same issue. It's a common requirement for cloud env. to allow dynamic port assignments. The exception will be also thrown, if I remove the default value: quarkus.http.port=${PORT}
This issue is the same than #472
We are working on this issue for JDT with https://github.com/eclipse/lsp4mp/pull/283
Once this PR will merged, quarkus IJ will align her code with JDT
Please install last version of IJ Quarkus, it should be fixed:
