-
Notifications
You must be signed in to change notification settings - Fork 15
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
Migrate to Spring Boot 3 and Java 17 #112
Comments
Hello, I am investigating it. There are many changes in Spring Boot 3 (dependencies and internal changes). |
hello @aurelien-baudet, |
Hello, I succeded to compile the whole project. I think I know why the service is not injected because auto-configuration check if there is javax.servlet.Servlet in the classpath. However, since Spring Boot 3, the javax libs are replaced by jakarta so the new package is jakarta.servlet. |
can you please tell me what I'm going to put in the bean @bean |
@Bean
public MessagingService messagingService() {
// configure properties (could be stored in a properties file or defined
// in System properties)
Properties properties = new Properties();
properties.setProperty("mail.smtp.host", "<your server host>");
properties.setProperty("mail.smtp.port", "<your server port>");
properties.setProperty("ogham.email.from.default-value", "<email address to display for the sender user>");
// Instantiate the messaging service using default behavior and
// provided properties
return MessagingBuilder.standard()
.environment()
.properties(properties)
.and()
.build();
} This is an example from documentation : https://groupe-sii.github.io/ogham/v3.0.0/user-manual.html#quick_start You won't have any Spring Boot integration but you can still send emails and sms by configuring the property values |
Ok I may have a temporary solution.
|
hello @aurelien-baudet, |
After many efforts, it requires too much work to maintain Spring Boot 1 + Sprig Boot 2 + Spring Boot 3 compatible with same Ogham version. It is technically possible but it breaks the purpose of Ogham wich is "Ogham adpats to what developer chooses". By keeping old Spring Boot versions, developer has to fix dependencies and classpath since there is a big mess between javax and jakarta. So the decision is to break retro-compatibility. This is not what I wanted but I have no other choice. I will be able to provide a new version soon. |
Everything seems to work. I finally found an acceptable solution to keep support for Spring Boot 1 and Spring Boot 2. |
I have issues with the CI. I need to update everything before being able to make a release. However, I deployed a SNAPSHOT version. So you can test that my fix works. You need to add the repository for snapshots <repositories>
<repository>
<id>ossrh-snapshots</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories> And then use the version Please tell me if it works for you. Thanks |
@amirbec86 Did you test the fix ? |
Hello @aurelien-baudet, |
This is really strange. Could you create a sample project to reproduce the issue ? |
Hello @aurelien-baudet i'm taking over for this issue. With the 3.0.0 version we're facing an issue with the processing of thymleaf templates. The messages are not being translated properly so when we receive the emails they just contain the message keys looking like :
With the 4.0.0-SNAPSHOT version, the project does not compile due to this error :
Could you help me fix these issues please ? Thanks |
Are you using Spring Boot or just Spring with your own configuration ? With version 3.0.0, are you using thymeleaf with Spring correctly ? Do you already use thymeleaf with internationalization without Ogham ? Have you followed Ogham documentation and examples regarding internationalization with thymeleaf ? With 4.0.0-SNAPSHOT, it seems that you have a classpath incompatibility ( I need more information if you want me to help you. I do that on my own time so please help me by giving me the maximum of useful information |
Hello, I'm using Spring boot in the version 3.0.6 and the spring-boot-starter-thymeleaf. We've been using Ogham (& Thymleaf templates with internalization) with the 2.5.7 verison of Spring Boot for a year now without issues. The issue happened when we migrated the project to Spring Boot 3 and had to add this dependency :
The full dependency tree : Please let me know if you need more information. |
Ok this seems to be a classpath issue. Could you provide me a sample projet (maybe a github private project with the dependencies, your Spring configuration, with the code extract that fails) because I can't reproduce it ? |
Hi, I want to migrate my messaging api to spring Boot 3 and java 17, I used this dependency :
fr.sii.ogham
ogham-spring-boot-starter-all
3.0.0
but I could not inject MessagingService using : @Autowired
I don't know if there is a solution for this problem by still using orgham with java 17
The text was updated successfully, but these errors were encountered: