Open kazuki43zoo opened 2 years ago
@snicoll Sorry to late reply... I want to support to run on Spring Boot 3. Now, I need to your helping !!!!
同求
SpringBoot3 AOT startup and running error after native compilation
Hi, Is there any progress on this issue? I have also meet this problem
Is this project still relevant though? It seems for Spring Boot 2.x and the now retired project. Folks should use Spring Boot and it's GA version of native support. I believe Mybatis has an integration for Spring Boot 3 as well. Try on start.spring.io?
We have a plan to provide support components and meta-data for building native image using Spring Boot 3 on this project or mybatis-spring or mybatis-spring-boot project at late. Until then, please see the mybatis-spring-boot's wiki page.
Hello everyone, here is a demo that support Spring Boot 3 & GraalVM & Mybatis Plus.
Plugin native:compile
works, but spring-boot:build-image
doesn't.
https://github.com/lumine1996/lumine-starter
@kazuki43zoo @linghengqian
Hello everyone, here is a demo that support Spring Boot 3 & GraalVM & Mybatis Plus. Plugin
native:compile
works, butspring-boot:build-image
doesn't. https://github.com/lumine1996/lumine-starter @kazuki43zoo @linghengqian
Hello everyone, here is a demo that support Spring Boot 3 & GraalVM & Mybatis Plus. Plugin
native:compile
works, butspring-boot:build-image
doesn't. https://github.com/lumine1996/lumine-starter @kazuki43zoo @linghengqian
- @lumine1996 Hi, the Mybatis Plus Example should not be discussed in this issue, I suggest you open a new issue on the baomidou side.
Maybe you misunderstood me, here I want to help those friends. This demo can help you run Mybatis on Spring Boot 3, you can build native image by GraalVM.
mvn -Pnative native:compile -DskipTests
In this demo, because Mybatis Plus is based on Mybatis, so Mybatis also works. As for the problem of the other plugin, that's a remind, but I'd be glad if anyone could help.
support springboot3 native has some new messages?
Spring Boot v3.3.2, Spring v6.1.11
2024-08-05 16:52:05 DEBUG c.g.xxx : Running with Spring Boot v3.3.2, Spring v6.1.11
2024-08-05 16:52:05 INFO c.g.xxx : No active profile set, falling back to 1 default profile: "default"
2024-08-05 16:52:05 WARN w.s.c.ServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: java.lang.ExceptionInInitializerError
Application run failed
java.lang.ExceptionInInitializerError
at org.mybatis.spring.mapper.MapperScannerConfigurer.postProcessBeanDefinitionRegistry(MapperScannerConfigurer.java:363)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:148)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:789)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:607)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
at com.gz.GzControlApplication.main(GzControlApplication.java:30)
Caused by: org.apache.ibatis.logging.LogException: Error creating logger for logger org.mybatis.spring.mapper.ClassPathMapperScanner. Cause: java.lang.NullPointerException
at org.apache.ibatis.logging.LogFactory.getLog(LogFactory.java:54)
at org.apache.ibatis.logging.LogFactory.getLog(LogFactory.java:47)
at org.mybatis.logging.LoggerFactory.getLogger(LoggerFactory.java:32)
at org.mybatis.spring.mapper.ClassPathMapperScanner.<clinit>(ClassPathMapperScanner.java:62)
... 10 more
Caused by: java.lang.NullPointerException
at org.apache.ibatis.logging.LogFactory.getLog(LogFactory.java:52)
... 13 more
Exception in thread "main" java.lang.IllegalStateException: java.lang.ExceptionInInitializerError
at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:825)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:345)
at com.gz.GzControlApplication.main(GzControlApplication.java:30)
Caused by: java.lang.ExceptionInInitializerError
at org.mybatis.spring.mapper.MapperScannerConfigurer.postProcessBeanDefinitionRegistry(MapperScannerConfigurer.java:363)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:349)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:148)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:789)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:607)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
... 1 more
Caused by: org.apache.ibatis.logging.LogException: Error creating logger for logger org.mybatis.spring.mapper.ClassPathMapperScanner. Cause: java.lang.NullPointerException
at org.apache.ibatis.logging.LogFactory.getLog(LogFactory.java:54)
at org.apache.ibatis.logging.LogFactory.getLog(LogFactory.java:47)
at org.mybatis.logging.LoggerFactory.getLogger(LoggerFactory.java:32)
at org.mybatis.spring.mapper.ClassPathMapperScanner.<clinit>(ClassPathMapperScanner.java:62)
... 10 more
Caused by: java.lang.NullPointerException
at org.apache.ibatis.logging.LogFactory.getLog(LogFactory.java:52)
... 13 more
The https://github.com/spring-attic/spring-native used in the project has been archived, and Spring Boot 3 already natively supports native without https://github.com/spring-attic/spring-native
question:
Caused by: java.lang.NullPointerException
at org.apache.ibatis.logging.LogFactory.getLog(LogFactory.java:52)
... 13 more
answer:
reflect-config.json
[
{
"name": "org.apache.ibatis.logging.slf4j.Slf4jImpl",
"allDeclaredConstructors": true,
"allDeclaredMethods": true
},
{
"name": "org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl",
"allDeclaredConstructors": true,
"allDeclaredMethods": true
},
{
"name": "org.apache.ibatis.logging.log4j2.Log4j2Impl",
"allDeclaredConstructors": true,
"allDeclaredMethods": true
},
{
"name": "org.apache.ibatis.logging.log4j.Log4jImpl",
"allDeclaredConstructors": true,
"allDeclaredMethods": true
},
{
"name": "org.apache.ibatis.logging.jdk14.Jdk14LoggingImpl",
"allDeclaredConstructors": true,
"allDeclaredMethods": true
},
{
"name": "org.apache.ibatis.logging.nologging.NoLoggingImpl",
"allDeclaredConstructors": true,
"allDeclaredMethods": true
}
]
Completed debugging of MyBatis functionality for Spring Boot 3.
Please refer to the submission record of the mybatis/native-image branch for details.
@kazuki43zoo let me know if I can help you migrate to the new API in Spring Boot 3. Spring Boot
3.0.0-M5
is available with the required tools to build a native image.