quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.79k stars 2.68k forks source link

Vaadin @Push does not work - always DISABLED #41602

Closed JasonTheDynamite closed 4 months ago

JasonTheDynamite commented 4 months ago

Describe the bug

I am getting this error on the frontend using vaadin with quarkus: https://192.168.1.100/VAADIN/static/push/vaadinPush.js could not be loaded. Push will not work. Looks like this: image Push does not work at all.

Logs show this: io.package.website.configuration.VaadinAppShell' is not a CDI bean. Falling back to default instantiation.

Currently push works only when there is a user interaction with the frontend - for example a usern needs to click a button to force changes to the frontend.

Gradle properties

quarkusPluginId=io.quarkus quarkusPluginVersion=3.12.0 quarkusPlatformGroupId=io.quarkus.platform quarkusPlatformArtifactId=quarkus-bom quarkusPlatformVersion=3.12.0 vaadinVersion=24.4.4 vaadinPluginVersion=24.4.4 kotlinVersion=2.0.0

build.gradle: `plugins { id "java" id "application" id 'org.jetbrains.kotlin.jvm' version "${kotlinVersion}" id 'org.jetbrains.kotlin.kapt' version "${kotlinVersion}" id "org.jetbrains.kotlin.plugin.allopen" version "${kotlinVersion}" id 'org.jetbrains.kotlin.plugin.jpa' version "${kotlinVersion}" id 'com.github.gmazzo.buildconfig' version '5.3.5' id "com.vaadin" version "${vaadinPluginVersion}" id 'io.quarkus' }

apply plugin: 'kotlin'

repositories { mavenCentral() maven { url = uri("https://plugins.gradle.org/m2/") } maven { url "https://maven.vaadin.com/vaadin-addons" } google() gradlePluginPortal() }

dependencies { implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}")

implementation "com.vaadin:vaadin-bom:${vaadinVersion}"
implementation "com.vaadin:vaadin-jandex:${vaadinVersion}"

// implementation "com.vaadin:vaadin-core:${vaadinVersion}" implementation "com.vaadin:vaadin-quarkus-extension:${vaadinVersion}"

implementation "io.quarkus:quarkus-hibernate-orm"
implementation "io.quarkus:quarkus-jdbc-h2"
implementation "io.quarkus:quarkus-hibernate-validator"

implementation "io.quarkus:quarkus-kotlin"

implementation "io.quarkiverse.bucket4j:quarkus-bucket4j:1.0.3"
implementation "io.quarkus:quarkus-jdbc-postgresql"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "io.quarkus:quarkus-arc"
implementation "io.quarkus:quarkus-rest"
implementation "io.quarkus:quarkus-rest-jackson"

implementation("io.quarkus:quarkus-smallrye-jwt")
implementation("io.quarkus:quarkus-smallrye-jwt-build")
implementation "io.quarkus:quarkus-mutiny:3.11.2"
implementation "io.smallrye.reactive:mutiny-kotlin:2.6.0"
implementation("io.quarkus:quarkus-undertow")
implementation("io.quarkus:quarkus-websockets")

implementation "org.apache.tika:tika-core:2.9.2"
implementation("org.apache.commons:commons-text:1.11.0")
implementation("org.apache.syncope.common:syncope-common-lib:2.1.14")
implementation "org.apache.commons:commons-lang3:3.14.0"
implementation "commons-codec:commons-codec:1.17.0"
implementation "commons-io:commons-io:2.16.1"
implementation("com.google.guava:guava:33.2.1-jre")

implementation "net.java.dev.jna:jna:5.14.0"

runtimeOnly "com.h2database:h2:2.2.224"

implementation "org.bouncycastle:bcprov-jdk15to18:1.78"
implementation "org.bouncycastle:bcjmail-lts8on:2.73.6"

implementation "org.jboss.logmanager:jboss-logmanager:3.0.6.Final"

testImplementation "io.quarkus:quarkus-junit5"
testImplementation "io.rest-assured:rest-assured"
testImplementation "io.quarkus:quarkus-jdbc-postgresql"
testImplementation "io.quarkus:quarkus-jdbc-h2"
testImplementation "org.jboss.logmanager:jboss-logmanager:3.0.6.Final"

}

def props = new Properties() props.load(new FileInputStream(new File("src/main/resources/application.properties")))

group 'io.package' version '1.0.0-SNAPSHOT'

java { sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21 }

test { systemProperty "java.util.logging.manager", "org.jboss.logmanager.LogManager" } allOpen { annotation("jakarta.ws.rs.Path") annotation("jakarta.enterprise.context.ApplicationScoped") annotation("jakarta.persistence.Entity") annotation("io.quarkus.test.junit.QuarkusTest") }

compileKotlin { kotlinOptions.jvmTarget = JavaVersion.VERSION_21 kotlinOptions.javaParameters = true kotlinOptions { freeCompilerArgs += "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi" freeCompilerArgs += "-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi" freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" freeCompilerArgs += "-opt-in=kotlin.ExperimentalStdlibApi" } }

compileTestKotlin { kotlinOptions.jvmTarget = JavaVersion.VERSION_21 kotlinOptions.javaParameters = true kotlinOptions { freeCompilerArgs += "-opt-in=kotlinx.coroutines.ExperimentalCoroutinesApi" freeCompilerArgs += "-opt-in=kotlinx.coroutines.ObsoleteCoroutinesApi" freeCompilerArgs += "-opt-in=kotlin.RequiresOptIn" freeCompilerArgs += "-opt-in=kotlin.ExperimentalStdlibApi" } }

application { mainClass.set("io.minifyimage.website.App") }

jar { zip64 = true exclude 'META-INF/.RSA', 'META-INF/.SF', 'META-INF/*.DSA' duplicatesStrategy(DuplicatesStrategy.EXCLUDE) from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }

} `

Expected behavior

Push should work.

Actual behavior

Push does not work which means that the website contents does not change.

How to Reproduce?

Steps:

  1. Create project with vaadin + quarkus using examples (gradle)
  2. Add class which extends: AppShellConfigurator with annotation: "@Push(PushMode.AUTOMATIC,transport = Transport.WEBSOCKET)" or just @Push
  3. Create class for website page with annotation @UIScoped
  4. Make a viewModel for the page with which repeats sending same update to the page every X seconds.

Output of uname -a or ver

Darwin MacBook-Air.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:14:59 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8122 arm64

Output of java -version

OpenJDK Runtime Environment Zulu22.30+13-CA (build 22.0.1+8) OpenJDK 64-Bit Server VM Zulu22.30+13-CA (build 22.0.1+8, mixed mode, sharing)

Quarkus version or git rev

3.12.0

Build tool (ie. output of mvnw --version or gradlew --version)

8.7

Additional information

No response

quarkus-bot[bot] commented 4 months ago

/cc @geoand (kotlin)

geoand commented 4 months ago

Please report this to Quarkus Vaadin.