Skip to content
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

Support Spring Boot 3 #36

Open
kazuki43zoo opened this issue Jun 5, 2022 · 18 comments
Open

Support Spring Boot 3 #36

kazuki43zoo opened this issue Jun 5, 2022 · 18 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@kazuki43zoo
Copy link
Member

No description provided.

@kazuki43zoo kazuki43zoo added the enhancement New feature or request label Jun 5, 2022
@kazuki43zoo kazuki43zoo self-assigned this Jun 5, 2022
@kazuki43zoo kazuki43zoo added this to the 1.0.0 milestone Jun 5, 2022
@snicoll
Copy link

snicoll commented Sep 23, 2022

@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.

@kazuki43zoo
Copy link
Member Author

@snicoll Sorry to late reply...
I want to support to run on Spring Boot 3. Now, I need to your helping !!!!

@linghengqian
Copy link

  • Hey, I noticed that this project generates GraalVM reachability metadata through specific Spring annotations. I want to know if you allow me to submit to https://github.com/oracle/graalvm-reachability-metadata, about mybatis GraalVM Reachability metadata PR? That should include graalvm reachability metadata that can be generated by conditional agent mode so that I can configure as little json as possible before this issue is resolved.🤔

@qiangbro
Copy link

同求

@gogolin001
Copy link

SpringBoot3 AOT startup and running error after native compilation
e157ee82bbdc4d5005442ec3c7d7ced0_222346640-95b8c87c-1e52-428d-a715-d30b899d68e8

@Reason94
Copy link

Reason94 commented Jun 2, 2023

Hi, Is there any progress on this issue? I have also meet this problem

@snicoll
Copy link

snicoll commented Jun 2, 2023

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?

@kazuki43zoo
Copy link
Member Author

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.

@lumine1996
Copy link

lumine1996 commented Jun 26, 2023

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

@linghengqian
Copy link

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

  • @lumine1996 Hi, the Mybatis Plus Example should not be discussed in this issue, I suggest you open a new issue on the baomidou side.

@lumine1996
Copy link

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

  • @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.

@elevenkongqian
Copy link

support springboot3 native has some new messages?

@iloveuaa
Copy link

iloveuaa commented Aug 5, 2024

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

@xuxiaowei-com-cn
Copy link

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

@xuxiaowei-com-cn
Copy link

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
  }
]

@xuxiaowei-com-cn
Copy link

@xuxiaowei-com-cn
Copy link

Completed debugging of MyBatis functionality for Spring Boot 3.

Please refer to the submission record of the mybatis/native-image branch for details.

https://github.com/xuxiaowei-com-cn/spring-cloud-graalvm

@xuxiaowei-com-cn
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

10 participants