-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Application not starting with @EnableTransactionManagement(mode = AdviceMode.ASPECTJ) #32882
Comments
This is unfortunately yet another regression following up on #32793 and #32838. We need another defensive catch block there, this time in These problems come from mixed AspectJ weaving and proxying. In your scenario, you seem to be using |
The fix will be available in the upcoming 6.1.8, 6.0.22 and 5.3.37 snapshots, allowing for such mixed weaving/proxying usage with the AspectJ transaction and caching aspects. Please give it an early try if you have the chance, ideally with your original application. That said, I still recommend revising your application setup towards exclusive weaving usage (no proxy setup at all). |
Thanks @jhoeller I'll try that. |
…s/spring-framework#32882 (comment) "These problems come from mixed AspectJ weaving and proxying. In your scenario, you seem to be using @EnableTransactionManagement in AspectJ mode but @EnableCaching in proxy mode. For the time being, you could try to switch @EnableCaching and any other aspect-related functionality to AspectJ mode as well and remove any variant of@EnableAspectJAutoProxy completely, if that is feasible for your application."
@jhoeller you mean |
@xtermi2 indeed, 6.1.9 of course (as per the assigned milestone of this issue). |
* Switch back to Mojo aspectj plugin for Java 21 support * Update AspectJ * Update Jacoco plugin to support Java 21 * Update to Mockito 5 for Java 21 support * update dependencies * feat: use java 21 image * Update spring framework dependency * Explicitly enable annotation processing during compilation. [INFO] Annotation processing is enabled because one or more processors were found on the class path. A future release of javac may disable annotation processing unless at least one processor is specified by name (-processor), or a search path is specified (--processor-path, --processor-module-path), or annotation processing is enabled explicitly (-proc:only, -proc:full). Use -Xlint:-options to suppress this message. Use -proc:none to disable annotation processing. * Mock and Spy integration test components * Rename duplicate classes * Fix Tag import * Use MockFactoryBean everywhere * Upgraded shedlock to latest "If you are using JDK >17 and up-to-date libraries like Spring 6, use version 5.1.0 (Release Notes)" according to https://github.com/lukas-krecan/ShedLock * Shedlock breaks with latest Spring * Specify aspectj mode for cache configuration * Specify aspectj mode for scheduler config * Updated Spring by applying AOP workaround suggested in spring-projects/spring-framework#32882 (comment) "These problems come from mixed AspectJ weaving and proxying. In your scenario, you seem to be using @EnableTransactionManagement in AspectJ mode but @EnableCaching in proxy mode. For the time being, you could try to switch @EnableCaching and any other aspect-related functionality to AspectJ mode as well and remove any variant of@EnableAspectJAutoProxy completely, if that is feasible for your application." * Replace deprecated thread.getId() with threadId(). * use whois-build:v0.0.5 - java21, amazoncorretto, node18, firefox114 --------- Co-authored-by: mherran <[email protected]>
Any ideas on other annotations to check? I've updated:
to match I also had to add edit: I think it is @Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@EnableAspectJAutoProxy(proxyTargetClass = false)
@Import(RetryConfiguration.class)
@Documented
public @interface EnableRetry { ... } |
When upgrading spring framework from 5.3.34 to 5.3.35 and 5.3.36 or from 6.1.6 to 6.1.7 or 6.1.8 the application context can't be initialised. When changing to @EnableTransactionManagement the application starts but we got other transaction related problems instead.
Here is the stack trace when run with spring framework 6.1.8:
The text was updated successfully, but these errors were encountered: