0

I have a springboot2.x application and I want to deploy springboot war file to tomcat10. I think I have to migrate javax to jakarta. How should I migrate the same?

Jahnavi Paliwal
  • 1,721
  • 1
  • 12
  • 20
Leejinsol
  • 31
  • 3
  • 3
    You cannot. Spring (Boot) doesn't support JakartaEE (yet). – M. Deinum Jul 05 '21 at 10:04
  • @M.Deinum - Read the question again. He is migrating from Spring Boot to Jakarta / Tomcat 10 – Stephen C Jul 05 '21 at 10:10
  • Start by reading this: https://ralph.blog.imixs.com/2020/12/13/migrating-to-jakarta-ee-9/. There are lots of other articles (and videos) on this too. – Stephen C Jul 05 '21 at 10:11
  • You may also have some success using this: https://github.com/apache/tomcat-jakartaee-migration ... but beware that it describes itself as a "work in progress". – Stephen C Jul 05 '21 at 10:15
  • The [Tomcat Migration Tool](https://tomcat.apache.org/download-migration.cgi) reached version 1.0.0 recently, so it is pretty stable now and it converts source files, java classes and `META-INF/services`. – Piotr P. Karwasz Jul 05 '21 at 10:55
  • 3
    @StephenC he isn't migrating from Spring Boot to Jakarta but rather he wants to deploy his Spring Boot application to Tomcat 10. That simply isn't possible. The question is how to migrate the javax. packages to jakartaee packages. So maybe you have to read again. – M. Deinum Jul 05 '21 at 11:23
  • @M.Deinum - Quoting from the question. *"I have springboot2.x application I want to deploy springboot war file to tomcat10 So I think I have to migration ..."* - Parsing this for you. 1) "I have springboot app." 2) "I want to run the app on Tomcat 10". 3) "That means that I need to **migrate** the app". 4) "Please help me migrate". It is clear that he *already* thinks (and probably knows) that he cannot simply run his app on Tomcat 10, and he is asking for help migrating. The OP's use of the word "So" is important. – Stephen C Jul 05 '21 at 22:37
  • 1
    hi thanks for help ! I'm sorry for confuse, I'm not good at English :( ... @M.Deinum is right. Actually I want to deploy my springboot app to Tomcat 10. How can I run my app on tomcat10? (Jakarta+ springboot ..? ) – Leejinsol Jul 06 '21 at 04:28
  • @Leejinsol as I stated twice already you cannot as Spring (Boot) doesn't support JakartaEE (yet). – M. Deinum Jul 06 '21 at 05:30
  • @M. Deinum Thank you !! So If i want to use Tomcat10 , I have to make jakarta application. Is that right? – Leejinsol Jul 06 '21 at 05:53
  • Yes, yu cannot use Spring or Spring Boot (yet) with Jakarta as those APIs aren't supported yet. This doesn't only apply to Spring or Spring Boot but also other frameworks haven't migrated or provided a JakartaEE application. So depending on your needs it might not be (totally) possible to migrate to JakartaEE. But as stated that depends on your frameworks/libraries in use and you will need to investigate them all. – M. Deinum Jul 06 '21 at 08:25
  • @M.Deinum It really helped! thank you so much ! To sum up, I have to deploy java application to tomcat 10. I will make new project with jakarta. But I can't find any reference about jakarta crud :( – Leejinsol Jul 07 '21 at 05:33
  • 1
    There aren't many frameworks out there that support JakartaEE just yet (I think Hibernate and Hibernate Validator or among the only ones). So you would have to write everything yourself (no Spring Data JPA or the likes, etc). You basically need to rewrite most of your application as you have it now. – M. Deinum Jul 07 '21 at 05:44
  • @M.Deinum oh .. OK Thank you It helped a lot !! I have to figure it out how to make jakarta application.... – Leejinsol Jul 07 '21 at 07:09
  • @Leejinsol: why do you think you need to use Tomcat 10 **now**? Tomcat 9 is and will be supported for many years to come and Tomcat 10 does not have any outstanding features. Wait until the libraries you use have migrated or use the migration tool and distribute the Jakarta EE version of your application as _"Jakarta EE preview"_. – Piotr P. Karwasz Jul 07 '21 at 09:03
  • @PiotrP.Karwasz I have to test some agent that I'm working on. Agent must run on tomcat 10 + java application. So that's why I have to use tomcat 10 :( – Leejinsol Jul 08 '21 at 05:07

0 Answers0