gRPC in spring boot

238 views
Skip to first unread message

Lawrence Emuria Ekale

unread,
Jun 6, 2023, 3:52:52 AM6/6/23
to grpc.io
I have a problem such that my application is terminating without errors or warnings and I don't know why, the proto file generated the classes successfully and I tried to implement it in a service but when I start the application it starts well then terminates. Here are the logs for termination `2023-06-06T10:47:10.155+03:00  INFO 105277 --- [           main] c.l.gRPCservice.GRpcServiceApplication   : Starting GRpcServiceApplication using Java 17.0.6 with PID 105277 (/home/lawrence/Music/Projects/Messaging-microservice/gRPC-service/target/classes started by lawrence in /home/lawrence/Music/Projects/Messaging-microservice)
2023-06-06T10:47:10.168+03:00  INFO 105277 --- [           main] c.l.gRPCservice.GRpcServiceApplication   : The following 1 profile is active: "lawrence"
2023-06-06T10:47:10.918+03:00  INFO 105277 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-06-06T10:47:11.001+03:00  INFO 105277 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 71 ms. Found 1 JPA repository interfaces.
2023-06-06T10:47:11.414+03:00  INFO 105277 --- [           main] o.hibernate.jpa.internal.util.LogHelper  : HHH000204: Processing PersistenceUnitInfo [name: default]
2023-06-06T10:47:11.462+03:00  INFO 105277 --- [           main] org.hibernate.Version                    : HHH000412: Hibernate ORM core version 6.2.2.Final
2023-06-06T10:47:11.464+03:00  INFO 105277 --- [           main] org.hibernate.cfg.Environment            : HHH000406: Using bytecode reflection optimizer
2023-06-06T10:47:11.635+03:00  INFO 105277 --- [           main] o.h.b.i.BytecodeProviderInitiator        : HHH000021: Bytecode provider name : bytebuddy
2023-06-06T10:47:11.770+03:00  INFO 105277 --- [           main] o.s.o.j.p.SpringPersistenceUnitInfo      : No LoadTimeWeaver setup: ignoring JPA class transformer
2023-06-06T10:47:11.786+03:00  INFO 105277 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Starting...
2023-06-06T10:47:12.196+03:00  INFO 105277 --- [           main] com.zaxxer.hikari.pool.HikariPool        : HikariPool-1 - Added connection org.postgresql.jdbc.PgConnection@134f8ef6
2023-06-06T10:47:12.197+03:00  INFO 105277 --- [           main] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Start completed.
2023-06-06T10:47:12.226+03:00  INFO 105277 --- [           main] org.hibernate.orm.dialect                : HHH035001: Using dialect: org.hibernate.dialect.PostgreSQLDialect, version: org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$DialectResolutionInfoImpl@6579cdbb
2023-06-06T10:47:12.516+03:00  INFO 105277 --- [           main] o.h.b.i.BytecodeProviderInitiator        : HHH000021: Bytecode provider name : bytebuddy
2023-06-06T10:47:13.238+03:00  INFO 105277 --- [           main] o.h.e.t.j.p.i.JtaPlatformInitiator       : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
Hibernate:
    alter table if exists messages
       alter column time set data type bytea
2023-06-06T10:47:13.290+03:00  INFO 105277 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2023-06-06T10:47:13.632+03:00  INFO 105277 --- [           main] o.s.d.j.r.query.QueryEnhancerFactory     : Hibernate is in classpath; If applicable, HQL parser will be used.
2023-06-06T10:47:14.127+03:00  INFO 105277 --- [           main] c.l.gRPCservice.GRpcServiceApplication   : Started GRpcServiceApplication in 4.817 seconds (process running for 5.495)
2023-06-06T10:47:14.132+03:00  INFO 105277 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2023-06-06T10:47:14.134+03:00  INFO 105277 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown initiated...
2023-06-06T10:47:14.152+03:00  INFO 105277 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource       : HikariPool-1 - Shutdown completed.

Process finished with exit code 0`

Thanks for the support in advance

sanjay...@google.com

unread,
Jun 6, 2023, 12:46:04 PM6/6/23
to grpc.io
This seems to be the trigger:

> 2023-06-06T10:47:14.132+03:00  INFO 105277 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'

and seems unrelated to the gRPC library. Any idea why this shutdown hook was called?

Lawrence Emuria Ekale

unread,
Jun 6, 2023, 12:59:36 PM6/6/23
to sanjay...@google.com, grp...@googlegroups.com


On Tue, 6 Jun 2023, 19:54 Lawrence Emuria Ekale, <lawrenc...@gmail.com> wrote:
Thanks.

I knew the problem was the version of spring boot which is not supported by the grpc starter. I had to change to version 2 which is compatible with it.

I will look forward to contributing to make new releases for the gRPC starter to go hand in hand everytime spring releases a new version. 

--
You received this message because you are subscribed to a topic in the Google Groups "grpc.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/grpc-io/lfV8ev8xlOU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to grpc-io+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/098e59b0-7362-49d4-a2e9-29728f6502a2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages