Anyone run into class not found org/springframework/aot/AotDetector ?

90 views
Skip to first unread message

Rick Reumann

unread,
Jan 14, 2025, 3:37:12 PMJan 14
to mybatis-user
In this SpringBoot webapp, where I have a MyBatis services layer (jar) being used as a dependency, when the app starts up in Tomcat (9.0.71) the app is now failing to start with:

Application run failed
java.lang.NoClassDefFoundError: org/springframework/aot/AotDetector
at org.mybatis.spring.mapper.ClassPathMapperScanner.<init>(ClassPathMapperScanner.java:91)
   . . .
Caused by: java.lang.ClassNotFoundException: org.springframework.aot.AotDetector
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1412) 
... 41 common frames omitted

Just wondering if you have some ideas what could be triggering this?
I'm not using any sort of special maven compiling (no explicit AOT stuff ) 
Thanks for any help


Iwao AVE!

unread,
Jan 14, 2025, 5:31:35 PMJan 14
to mybati...@googlegroups.com
Hello Rick,

I'm not sure...version mismatch, maybe?
You seem to be using mybatis-spring-boot-starter 3.0.3.
Please try the latest: 3.0.4.

And check the version compatibility matrixes.

Regards,
Iwao

--
You received this message because you are subscribed to the Google Groups "mybatis-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mybatis-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/mybatis-user/785c03fa-934d-4c8b-a796-72f0fa3c73b1n%40googlegroups.com.

Tim

unread,
Jan 14, 2025, 8:34:23 PMJan 14
to mybati...@googlegroups.com
Is the spring aot jar in WEB-INF/lib or are you bundling it as an uber jar?

Do you have an example repo?

Rick Reumann

unread,
Jan 15, 2025, 10:55:47 AMJan 15
to mybatis-user
Hey Tim, that's the the thing, the aot jar shouldn't be required at all so it's not bundled. I did manage to get past this issue when I upgraded the spring parent version in the web app relying on the mybatis project, so that's good, however it *did* seem to be working without having to do that, so not sure what changed. Forcing that upgrade to the webapp using the newer mybatis project, seems is going to force a lot more upgrades to the project, which is ok just curious what happened to all of a sudden have the project complaining about not finding AotDetector.

My mybatis services jar (not an uber jar) is a mybatis project using spring-boot-starter-parent 3.4.1and mybatis spring boot starter 3.0.4. 
The webapp using this jar is using spring-boot-starter-parent 2.7.9, which I believe "used" to be working - but something I added/changed caused the error I initially posted about. If I upgrade the web app to a newer version of Spring (3.x versions) which requires changing to jakarta packages etc, I could get things working so I can end up managing. Still would be curious what caused things to start throwing the error about mybatis' mapper scanner needing to find AotDetector:

Caused by: java.lang.NoClassDefFoundError: org/springframework/aot/AotDetector
at org.mybatis.spring.mapper.ClassPathMapperScanner.<init>(ClassPathMapperScanner.java:95)
Reply all
Reply to author
Forward
0 new messages