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

Upgrade to Spring Boot 3 #19782

Closed
mraible opened this issue Sep 19, 2022 · 23 comments · Fixed by #19791
Closed

Upgrade to Spring Boot 3 #19782

mraible opened this issue Sep 19, 2022 · 23 comments · Fixed by #19791
Labels
$$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ changes: major ⭐ theme: java v8 $500 https://www.jhipster.tech/bug-bounties/
Milestone

Comments

@mraible
Copy link
Contributor

mraible commented Sep 19, 2022

Overview of the feature request

Start upgrading to Spring Boot 3.

Motivation for or Use Case

Selfishly, I need it for a demo at ApacheCon, but I'd also like to hack on it during the JavaOne Hackergarten.

Related issues or PR
@mraible mraible added $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $500 https://www.jhipster.tech/bug-bounties/ labels Sep 19, 2022
@DanielFran
Copy link
Member

DanielFran commented Sep 21, 2022

@mraible We should consider to migrate from zalando (problem and problem-spring-web) to spring-framework native implementation coming with spring-framework 6.0

@pascalgrimaud same for JHLite

@pascalgrimaud
Copy link
Member

Thanks for the information @DanielFran !

@mraible
Copy link
Contributor Author

mraible commented Sep 21, 2022

I'm looking for issues to try and fix at the JavaOne Hackergarten, so this could be a candidate.

Does anyone know how to fix the compilation errors from Hibernate? Do we still need the fixed PostgreSQL dialects in jhipster-framework?

@DanielFran
Copy link
Member

@DanielFran
Copy link
Member

DanielFran commented Sep 21, 2022

I'm looking for issues to try and fix at the JavaOne Hackergarten, so this could be a candidate.

Does anyone know how to fix the compilation errors from Hibernate? Do we still need the fixed PostgreSQL dialects in jhipster-framework?

@mraible The fixed PostgreSQL dialect was needed for BLOB integration: https://github.com/jhipster/jhipster-bom/blob/main/jhipster-framework/src/main/java/tech/jhipster/domain/util/FixedPostgreSQL10Dialect.java#L37-L39

We just need to confirm hibernate 6 handles it now: https://docs.jboss.org/hibernate/orm/6.1/userguide/html_single/Hibernate_User_Guide.html#basic-blob

@mraible
Copy link
Contributor Author

mraible commented Sep 28, 2022

@mraible @pascalgrimaud This might be helpful: https://github.com/rstoyanchev/sandbox-rfc7807

@DanielFran This looks very helpful. Do you know if we need to extend the exception handler like
WebMvcExceptionHandler.java does in this example? Or can we just declare a bean that returns the parent exception handler?

Related: do we need to register this exception handler with Spring Security?

@mraible
Copy link
Contributor Author

mraible commented Sep 28, 2022

A fix for Spring Doc might exist in this PR:

springdoc/springdoc-openapi#1860

@DanielFran
Copy link
Member

@mraible @pascalgrimaud This might be helpful: https://github.com/rstoyanchev/sandbox-rfc7807

@DanielFran This looks very helpful. Do you know if we need to extend the exception handler like WebMvcExceptionHandler.java does in this example? Or can we just declare a bean that returns the parent exception handler?

Related: do we need to register this exception handler with Spring Security?

Seems that WebMvcExceptionHandler.java example is like our current https://github.com/jhipster/generator-jhipster/blob/main/generators/server/templates/src/main/java/package/web/rest/errors/ExceptionTranslator.java.ejs
But we would need to implement those exceptions https://github.com/zalando/problem-spring-web/tree/main/problem-spring-web#configuration

@DanielFran
Copy link
Member

DanielFran commented Sep 28, 2022

A fix for Spring Doc might exist in this PR:

springdoc/springdoc-openapi#1860

We still have some spring.factories in the generator (for testing purposes with testcontainer I believe) to change also.
In the bom, I already migrated them when upgrading to 2.7.0

@mraible
Copy link
Contributor Author

mraible commented Oct 12, 2022

Seems that WebMvcExceptionHandler.java example is like our current https://github.com/jhipster/generator-jhipster/blob/main/generators/server/templates/src/main/java/package/web/rest/errors/ExceptionTranslator.java.ejs But we would need to implement those exceptions https://github.com/zalando/problem-spring-web/tree/main/problem-spring-web#configuration

It looks like Spring Boot might fix this by adding problem support by default. spring-projects/spring-boot#32634

@mraible
Copy link
Contributor Author

mraible commented Oct 12, 2022

I added new issues with bug bounties for Elasticsearch and the Zalando migration.

@omnya-alaa-eddin
Copy link

Hi Matt Raible ,
how can I pull your changes in order to generate new app that is internally using spring 3
Thanks for your effort regarding this fixes :)

@mraible
Copy link
Contributor Author

mraible commented Jan 16, 2023

git clone https://github.com/jhipster/generator-jhipster.git
cd generator-jhipster
npm install
npm link

Then, create a new directory and run jhipster in it.

mkdir app
cd app
jhipster

I've had a lot of questions about this recently. I plan to make a video this week.

@omnya-alaa-eddin
Copy link

Hi @mraible
Thanks for your response.
I'm trying to generate new app using the main branch and I'm expecting to get new app with spring 3
but I got the below error when trying to generate the new app using command (jhipster), Any Advice please ?

image

@mraible
Copy link
Contributor Author

mraible commented Jan 16, 2023

Can you please provide the steps you used to reproduce this error. Or, better yet, copy/paste your .yo-rc.json as a comment?

For a quick fix, you might try changing the base-url value to remove the trailing colon.

@pascalgrimaud
Copy link
Member

You already provided the steps, @mraible
The main branch is simply broken when you want to generate a project from scratch. Just tried it few minutes ago:

image

@Tcharl
Copy link
Contributor

Tcharl commented Jan 16, 2023

Reproduced locally, I reopen

@Tcharl Tcharl reopened this Jan 16, 2023
@pascalgrimaud
Copy link
Member

It's not related to Spring Boot 3, so I think we should open a new dedicated ticket instead of reopening this one

@Tcharl
Copy link
Contributor

Tcharl commented Jan 16, 2023

PR provided, too lazy for a ticket, was too easy to fix directly ^^

@mshima
Copy link
Member

mshima commented Jan 17, 2023

This new bug is not related to sb3, but to the prompts/defaults refactoring.
I don’t know why this issue was reopen.

@Tcharl
Copy link
Contributor

Tcharl commented Jan 17, 2023

Closing in favor of the dedicated issue.

@mshima
Copy link
Member

mshima commented Jul 10, 2023

Half work was done by @mraible, but since he usually don't claim, I will claim full 😄
@DanielFran bounty claimed https://opencollective.com/generator-jhipster/expenses/148964

@DanielFran
Copy link
Member

@mshima approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
$$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ changes: major ⭐ theme: java v8 $500 https://www.jhipster.tech/bug-bounties/
Projects
None yet
7 participants