Skip to content

Instantly share code, notes, and snippets.

View snicoll's full-sized avatar
🍃
👨‍💻

Stéphane Nicoll snicoll

🍃
👨‍💻
View GitHub Profile
Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Failed to initialize dependency 'dataSourceScriptDatabaseInitializer' of LoadTimeWeaverAware bean 'entityManagerFactory': Error creating bean with name 'dataSourceScriptDatabaseInitializer' defined in class path resource [org/springframework/boot/autoconfigure/sql/init/DataSourceInitializationConfiguration.class]: Unsatisfied dependency expressed through method 'dataSourceScriptDatabaseInitializer' parameter 0: Error creating bean with name 'dataSource' defined in class path resource [org/springframework/boot/autoconfigure/jdbc/DataSourceConfiguration$Hikari.class]: Failed to instantiate [com.zaxxer.hikari.HikariDataSource]: Factory method 'dataSource' threw exception with message: Error creating bean with name 'startupTimeMetrics' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/startup/StartupTimeMetricsLis

Merci à toutes et tous, c'était bien chouette!

Le repo: https://github.com/snicoll/ops-status

Comme quelqu'un me l'a fait remarquer, il n'y pas eu de séance de questions/réponses à l'amphi, donc je me suis dit que j'allais essayer de vous faire un résumé de mes discussions.

Un petit retour sur les "slice tests": https://docs.spring.io/spring-boot/docs/current/reference/html/features.html#features.testing.spring-boot-applications.autoconfigured-tests

RestClient vs. RestTemplate dans le contexte de Loom (Virtual Threads) et de l'importance de préciser que RestClient reste une interface moderne au-dessus de RestTemplate et n'est pas une contrainte pour bénéficier de Loom. Donc si vous voulez utiliser Loom, RestTemplate ou RestClient, peu importe mais RestClient offre une interface plus moderne. Je précise aussi que nous avons appliqué un peu de modernisme à JdbcTemplate aussi, avec JdbcClient: https://docs.spring.io/spring-framework/reference/data-access/jdbc/core.html#jdbc-JdbcClient

This file has been truncated, but you can view the full file.
2024-01-09T18:37:31.433+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483547
2024-01-09T18:37:31.433+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147482647
2024-01-09T18:37:31.433+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2024-01-09T18:37:31.433+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2024-01-09T18:37:31.434+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147483547
2024-01-09T18:37:31.434+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 2147482647
2024-01-09T18:37:31.434+01:00 DEBUG 51526 --- [ionShutdownHook] o.s.c.support.DefaultLifecycleProcessor : Stopping beans in phase 0
2024-01-09T18:37:31.434+01:00 DEBUG 51526 --- [ionShutdow

Current status

Single module with Cloud Native Buildpacks

mvn spring-boot:build-image -Pnative

This works, even if the Spring Boot Maven Plugin nor the Native Build Tools Plugin have been applied in the project as the native profile brings them.

***************************
APPLICATION FAILED TO START
***************************
Description:
package com.example.custominitializr.generator.contributor;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Collections;
import io.spring.initializr.generator.io.template.MustacheTemplateRenderer;
import io.spring.initializr.generator.project.ResolvedProjectDescription;
This file has been truncated, but you can view the full file.
> Task :buildSrc:compileJava NO-SOURCE
> Task :buildSrc:compileGroovy UP-TO-DATE
> Task :buildSrc:processResources UP-TO-DATE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
> Task :buildSrc:testClasses UP-TO-DATE
This file has been truncated, but you can view the full file.
> Task :buildSrc:compileJava NO-SOURCE
> Task :buildSrc:compileGroovy UP-TO-DATE
> Task :buildSrc:processResources UP-TO-DATE
> Task :buildSrc:classes UP-TO-DATE
> Task :buildSrc:jar UP-TO-DATE
> Task :buildSrc:assemble UP-TO-DATE
> Task :buildSrc:compileTestJava NO-SOURCE
> Task :buildSrc:compileTestGroovy NO-SOURCE
> Task :buildSrc:processTestResources NO-SOURCE
> Task :buildSrc:testClasses UP-TO-DATE
@snicoll
snicoll / bytecode
Last active January 15, 2019 21:45
// ================com/example/demo/MyProperties.class =================
// class version 50.0 (50)
// access flags 0x31
public final class com/example/demo/MyProperties {
// access flags 0x12
private final Ljava/lang/String; foo
@Lorg/jetbrains/annotations/NotNull;() // invisible
Caused by: java.lang.StackOverflowError
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.naming.internal.VersionHelper12.getContextClassLoader(VersionHelper12.java:185)
at com.sun.naming.internal.ResourceManager.getFactory(ResourceManager.java:426)
at javax.naming.spi.NamingManager.getURLObject(NamingManager.java:592)
at javax.naming.spi.NamingManager.getURLContext(NamingManager.java:550)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(InitialContext.java:345)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.springframework.jndi.JndiTemplate.lambda$lookup$0(JndiTemplate.java:156)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:91)