-
Notifications
You must be signed in to change notification settings - Fork 25
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
Spring Boot multiple context refreshes #410
Comments
Just confirmed the same error happens on JQM 2.2.4 |
The stacktrace tells us context refresh is called twice. JQM takes care never to call refresh twice with a simple lock mechanism so there is indeed something evil afoot. Cannot preproduce on my side, so could you please provide the following:
BTW, auto config should not be an issue - they are scanned as any other. If you look at the jqm-test-spring-1 demo/test in the source, you'll see that this is a fully-fledged Spring boot application with two @configuration classes. |
Thanks @marcanpilami - I now believe it's to do with how I'm [mis]using the CommandLineRunner interface - we have multiple of them, and spring runs all of them which isn't what I want, and may be triggering multiple refreshes. Is there a way to run a payload through JQM in my IDE? That way I could debug the refresh call directly. Many thanks, Simon |
Our payload now appears to be working correctly under 2.2.5 - whatever you did (I noticed Many thanks! Simon |
@marcanpilami curiously, if I switch to PostgreSQL back end the refresh issue reappears! I thought upgrading to 2.2.5 fixed it, but it is perhaps a side effect from using the H2 default. Could there be some kind of concurrency issue? |
We had made no change to the AnnotationSpringContextBootstrapHandler in 2.2.5. It seems indeed to be a concurrency issue - as if we tried to init twice despite the lock. The issue may actually be either in JQM or in Spring, as they may do some dark magic with class loaders. What version are you using? I'll try to reproduce with this version and pgsql. (and if you have a minimal job showing the issue it would help us a lot). Thanks! |
And I realise I've missed your testing question - currently the testers (https://jqm.readthedocs.io/en/jqm-all-2.2.5/jobs/testing_payloads.html) do not allow to specify runners and event interceptors as they are designed to handle only the most common cases. As Spring is widely used, it may be a good idea to add support - API to be determined. I've opened a new ticket for this (#414) |
@marcanpilami thanks for you attention on this. We're using Spring Boot 2.1.5.RELEASE. To note quickly, submitting job requests in quick succession appears to result in only one, or a small subset, of them reaching payload execution, which also feels like a concurrency issue. I'll put together a minimal example to reproduce this week. Kind regard, Simon |
@simonwibberley any chance on the reproduction? |
Hi there,
I'm having trouble running a spring boot payload in a shared context - jobs throw the error:
GenericApplicationContext does not support multiple refresh attempts: just call 'refresh' once
I had encountered this error before and thought it was the result of auto configuration classes being included under the component scan for in the job XML, which cause a refresh request when they configure (?). However, I've been careful to purge any such auto configurations from the component scan path, and the error persists.
Could anyone shed some light on what might really be happening?
Running JQM 2.2.1
Many thanks,
Simon
The text was updated successfully, but these errors were encountered: