-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vaadin + Quarkus @Push does not work - always DISABLED #164
Comments
I tried a similar setup based on the Vaadin Quarkus maven starter and cannot reproduce, neither in dev nor in production mode. @JasonTheDynamite could you please share a full project that reproduces the issue as a GitHub project or attach a zip file to this issue? Also, is the application behind some reverse-proxy that might block resources from being served to the client? |
@mcollovati |
This "https://192.168.1.100/VAADIN/static/push/vaadinPush.js could not be loaded. Push will not work." is visible when I use the websiite with ssl (https). Without SSL this message is not being displayed. Push stil is DISABLED |
@JasonTheDynamite I tried your application. I am not familiar with kotlin and gradle, but here are a couple of notes
In the logs below, you can see that push is in AUTOMATIC mode and two changes are sent to the client via PUSH, but then the block in
Given that, it looks like to me that the problem is not PUSH, but the callback not being invoked on changes applied to |
Maybe @mvysny can provide some advice here |
@mcollovati ok I will look into it. |
Can you please provide the steps to run your application with SSL enabled? |
Ok, I managed to start the application with SSL. What I can see is that with SSL enabled, the push script is downloaded as a binary file instead of a JavaScript resource. |
@mcollovati ok so how to use compression if using it crashes push ? |
Push script is added with a standard |
@mcollovati so it seems I did found a bug 🙂 |
I wonder if it is a problem of double compression. Flow already provides compressed version of several resources. |
It might be this way. I cant test this - javascript is something I am not familiar with |
I can confirm that the vaadinPush.js is compressed twice. It looks like a Quarkus issue |
Hmm so now I should be waiting for a fix ? 🙂 |
@mcollovati so I checked everything and it seems that disabling compression helps bu still the UI is not getting updated 😢 |
Unfortunately, I cannot help with Kotlin, but I tried to add the following to the
|
So, I suppose that there might be some issue in your code that prevents I hope @mvysny could take a look at your code and provide some suggestion. |
@mvysny |
@JasonTheDynamite regarding Kotlin Coroutines, it's very important to use the correct coroutine dispatcher which calls ui.access(). Please see https://github.com/mvysny/vaadin-coroutines-demo for an example. |
Describe the bug
I am getting this error on the frontend using vaadin with quarkus:
![image](https://private-user-images.githubusercontent.com/18309065/344902199-e0d7efad-5661-420a-b43a-9e19f4b874bf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxMjQyNTAsIm5iZiI6MTczOTEyMzk1MCwicGF0aCI6Ii8xODMwOTA2NS8zNDQ5MDIxOTktZTBkN2VmYWQtNTY2MS00MjBhLWI0M2EtOWUxOWY0Yjg3NGJmLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDE3NTkxMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTAwMzgxYTI0OTRlMmNhZjZhMGJlZDVjNDNjNDRlYjhhMGZmNDJjZjg0MTI1NWYzYTA1NjUwMTJhNWVjZDFiNDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.1q4z9mP1pQXlS8R_2kBTyXLOEA9nuNGtXmeBtzAU0yw)
https://192.168.1.100/VAADIN/static/push/vaadinPush.js could not be loaded. Push will not work.
Looks like this:
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-core:${vaadinVersion}"
implementation "com.vaadin:vaadin-quarkus-extension:${vaadinVersion}"
}
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:
Output of
uname -a
orver
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
orgradlew --version
)8.7
Additional information
No response
Expected-behavior
Push should work.
Reproduction
Steps:
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.
System Info
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
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: 3.12.0
Gradle wrapper: 8.7
The text was updated successfully, but these errors were encountered: