jmix-framework / jmix

Jmix framework
https://www.jmix.io
Apache License 2.0
696 stars 125 forks source link

IllegalArgumentException when Superset URL is not defined #3755

Closed rusiaikinat closed 3 weeks ago

rusiaikinat commented 2 months ago

Environment

Jmix version: 2.3.4

Steps To Reproduce

  1. Install the superset addon
  2. Do not make any settings
  3. Run the project

Current Behavior

Look the IDE terminal

2024-10-04T11:52:27.532+04:00 ERROR 27180 --- [okenScheduler-1] i.j.s.impl.SupersetTokenManagerImpl      : Cannot log in to superset. Dashboard functionality may work incorrectly

java.lang.IllegalArgumentException: URI with undefined scheme
    at java.net.http/jdk.internal.net.http.common.Utils.newIAE(Utils.java:326) ~[java.net.http:na]
    at java.net.http/jdk.internal.net.http.HttpRequestBuilderImpl.checkURI(HttpRequestBuilderImpl.java:79) ~[java.net.http:na]
    at java.net.http/jdk.internal.net.http.HttpRequestBuilderImpl.uri(HttpRequestBuilderImpl.java:71) ~[java.net.http:na]
    at java.net.http/jdk.internal.net.http.HttpRequestBuilderImpl.uri(HttpRequestBuilderImpl.java:43) ~[java.net.http:na]
    at io.jmix.superset.client.impl.SupersetClientImpl.login(SupersetClientImpl.java:85) ~[jmix-superset-2.3.4.jar:na]
    at io.jmix.superset.client.impl.SupersetClientImpl.login(SupersetClientImpl.java:64) ~[jmix-superset-2.3.4.jar:na]
    at io.jmix.superset.impl.SupersetTokenManagerImpl.performLogin(SupersetTokenManagerImpl.java:104) ~[jmix-superset-2.3.4.jar:na]
    at io.jmix.superset.impl.SupersetTokenManagerImpl.refreshAccessToken(SupersetTokenManagerImpl.java:67) ~[jmix-superset-2.3.4.jar:na]
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-6.1.13.jar:6.1.13]
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572) ~[na:na]
    at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358) ~[na:na]
    at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:1583) ~[na:na]

2024-10-04T11:52:27.545+04:00 ERROR 27180 --- [okenScheduler-1] i.j.s.impl.SupersetTokenManagerImpl      : Cannot get CSRF token from Superset. Access token is null or empty
2024-10-04T11:53:27.543+04:00 ERROR 27180 --- [okenScheduler-1] i.j.s.impl.SupersetTokenManagerImpl      : Cannot log in to superset. Dashboard functionality may work incorrectly

Expected Behavior

We shouldn't send requests at all if there is no URL

glebfox commented 1 month ago

Instead of exception, log WARN/ERROR to indicate that there is no settings defined