-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
dev mode crashes when adding and removing scope producer #35381
Comments
This should already be happening IIRC.
This is curious because even without scope annotation on the method, Arc should pick up the producer and just automatically assign it dependent scope by default - which would mean the bean should be picked up at all times. |
I think that we only detect this kind of problems after the dependencies are validated.
And it does. @Postremus But the reproducer has the wrong annotation - |
@mkouba okay, sure, but why does dev mode crash when I remove the |
Ok sorry, I skipped the part about crashing ;-). So I can confirm that the app is stopped with no error message or anything. And TBH I have no idea why. But it does not look like a JVM crash as I don't see any dump file...
|
I don't think we can in general detect misuse of Re the "crash", that is indeed interesting. Even if I enable debug logging for
I'm relatively sure this has nothing to do with ArC. There's probably some internal logic that triggers shutdown based on a previous failure, and that logic could probably use some improvement... 🤷 |
Ladislav is right, the |
It seems that the problem only occurs if Quarkus fails to start the app initially, i.e. it works fine if you add I suspect that if the startup fails in the I will try to fix this locally and we'll see. |
- IsolatedDevModeMain - replace the default exit handler _before_ the app is created - previously, if there was a deployment problem then the default exit handler was used; as a result the dev mode exited after the subsequent build failure - run DevModeListener.afterFirstStart() during restart if the first run did not succeed - fix FixConfigOnErrorTest - add missing Test annotation - fix Qute and ArC optimizations to skip generation of certain classes - fixes quarkusio#35381
Describe the bug
I ran into following situation just a few minutes ago.
An internal lib of ours requires that I produce an instance of a configuration bean in my project. no problems here.
I added following producer:
I forced a a restart (by pressing "s"). Again "warning Unsatisfied dependency".
Strange.. I thought this was enough in quarkus. Lets add an
@ApplicationScoped
to be sure.Again restart.
No warning anymore.
Okay, just to be sure, why did this not work? Lets remove the scope again.
Again restart
And now my quarkus just crashed. I now have to start quarkus again using mvn quarkus:dev. not ideal.
Remember, the injects are normally folded in my idea configuration.
I see 2 problems here:
Expected behavior
Crashes are not cool
Actual behavior
How to Reproduce?
Reproducer:
cdi-crash-scope.zip
@ApplicationScoped
to the producer method in SomeBeanProducerOutput of
uname -a
orver
MINGW64_NT-10.0-19045 NANBCHL9NG3 3.3.6-341.x86_64 2022-09-05 20:28 UTC x86_64 Msys
Output of
java -version
openjdk 17.0.4 2022-07-19 OpenJDK Runtime Environment Temurin-17.0.4+8 (build 17.0.4+8) OpenJDK 64-Bit Server VM Temurin-17.0.4+8 (build 17.0.4+8, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
3.2.4.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537) Maven home: C:\eclipse\tools\java\maven Java version: 17.0.4, vendor: Eclipse Adoptium, runtime: C:\eclipse\tools\java\17 Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Additional information
No response
The text was updated successfully, but these errors were encountered: