Hazelcast new members not joining existing cluster - java

I am trying to use Hazelcast in a Spring Boot application on my local. But it seems that each instance is starting up separately(without any errors) and not joining into the existing member list.
Instance 1:
Members {size:1, ver:1} [
Member [10.111.130.204]:5701 - 6d4a2864-5c90-4063-a2cc-deb64a950622 this
]
Instance 2:
Members {size:1, ver:1} [
Member [10.111.130.204]:5702 - 196c9d1f-7fd4-4c48-8dec-0fb913671610 this
]
I followed the guideline found here to setup a simple environment https://guides.hazelcast.org/hazelcast-embedded-springboot/
Can someone help figure out what am I missing here?
PS:
I also tried creating below configs, still the same behaviour.
#Bean
public Config hazelCastConfig() {
Config config = new Config();
config.getNetworkConfig().setPortAutoIncrement(true);
config.getGroupConfig().setName("hazelcast-cluster");
config.setManagementCenterConfig(new ManagementCenterConfig().setEnabled(true).setUrl("http://localhost:8080/hazelcast-mancenter"));
NetworkConfig network = config.getNetworkConfig();
JoinConfig join = network.getJoin();
join.getMulticastConfig().setEnabled(true);
return config;
}
#Bean
public HazelcastInstance hazelcastInstance(Config hazelCastConfig) {
return Hazelcast.newHazelcastInstance(hazelCastConfig);
}
Sample Logs[Instance 1]
2021-12-15 18:08:06.186 INFO 38768 --- [ main] com.example.hzdemo.HzDemoApplication : Starting HzDemoApplication
2021-12-15 18:08:06.192 INFO 38768 --- [ main] com.example.hzdemo.HzDemoApplication : No active profile set, falling back to default profiles: default
2021-12-15 18:08:07.776 INFO 38768 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http)
2021-12-15 18:08:07.783 INFO 38768 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-12-15 18:08:07.783 INFO 38768 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.55]
2021-12-15 18:08:07.854 INFO 38768 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-12-15 18:08:07.854 INFO 38768 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1542 ms
2021-12-15 18:08:07.943 WARN 38768 --- [ main] c.h.instance.HazelcastInstanceFactory : Hazelcast is starting in a Java modular environment (Java 9 and newer) but without proper access to required Java packages. Use additional Java arguments to provide Hazelcast access to Java internal API. The internal API access is used to get the best performance results. Arguments to be used:
--add-modules java.se --add-exports java.base/jdk.internal.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.management/sun.management=ALL-UNNAMED --add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED
2021-12-15 18:08:07.966 INFO 38768 --- [ main] com.hazelcast.instance.AddressPicker : [LOCAL] [hazelcast-cluster] [3.12.6] Prefer IPv4 stack is true, prefer IPv6 addresses is false
2021-12-15 18:08:07.985 INFO 38768 --- [ main] com.hazelcast.instance.AddressPicker : [LOCAL] [hazelcast-cluster] [3.12.6] Picked [10.111.130.204]:5701, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5701], bind any local is true
2021-12-15 18:08:07.994 INFO 38768 --- [ main] com.hazelcast.system : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Hazelcast 3.12.6 (20200130 - be02cc5) starting at [10.111.130.204]:5701
2021-12-15 18:08:07.994 INFO 38768 --- [ main] com.hazelcast.system : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved.
2021-12-15 18:08:08.208 INFO 38768 --- [ main] c.h.s.i.o.impl.BackpressureRegulator : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Backpressure is disabled
2021-12-15 18:08:08.576 INFO 38768 --- [ main] com.hazelcast.instance.Node : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Creating MulticastJoiner
2021-12-15 18:08:08.676 INFO 38768 --- [ main] c.h.s.i.o.impl.OperationExecutorImpl : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Starting 16 partition threads and 9 generic threads (1 dedicated for priority tasks)
2021-12-15 18:08:08.678 INFO 38768 --- [ main] c.h.internal.diagnostics.Diagnostics : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
2021-12-15 18:08:08.686 INFO 38768 --- [ main] com.hazelcast.core.LifecycleService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] [10.111.130.204]:5701 is STARTING
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.hazelcast.internal.networking.nio.SelectorOptimizer (file:/Users/<user>/.gradle/caches/modules-2/files-2.1/com.hazelcast/hazelcast/3.12.6/7640af720dfb86de81d93617271e2959dea6bfdc/hazelcast-3.12.6.jar) to field sun.nio.ch.SelectorImpl.selectedKeys
WARNING: Please consider reporting this to the maintainers of com.hazelcast.internal.networking.nio.SelectorOptimizer
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
2021-12-15 18:08:11.096 INFO 38768 --- [ main] c.h.internal.cluster.ClusterService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6]
Members {size:1, ver:1} [
Member [10.111.130.204]:5701 - 6d4a2864-5c90-4063-a2cc-deb64a950622 this
]
2021-12-15 18:08:11.111 INFO 38768 --- [ main] c.h.i.m.ManagementCenterService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Hazelcast will connect to Hazelcast Management Center on address:
http://localhost:8080/hazelcast-mancenter
2021-12-15 18:08:11.117 INFO 38768 --- [ main] com.hazelcast.core.LifecycleService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] [10.111.130.204]:5701 is STARTED
2021-12-15 18:08:11.389 INFO 38768 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path ''
2021-12-15 18:08:11.404 INFO 38768 --- [ main] com.example.hzdemo.HzDemoApplication : Started HzDemoApplication in 5.715 seconds (JVM running for 6.731)
2021-12-15 18:08:12.126 INFO 38768 --- [.MC.Task.Poller] c.h.i.m.ManagementCenterService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Failed to pull tasks from Management Center
2021-12-15 18:08:12.126 INFO 38768 --- [MC.State.Sender] c.h.i.m.ManagementCenterService : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Failed to connect to: http://localhost:8080/hazelcast-mancenter/collector.do
2021-12-15 18:08:12.126 INFO 38768 --- [MC.State.Sender] com.hazelcast.client.impl.ClientEngine : [10.111.130.204]:5701 [hazelcast-cluster] [3.12.6] Applying a new client selector :ClientSelector{any}
Sample Logs[Instance 2]
2021-12-15 18:09:06.831 INFO 39059 --- [ main] com.example.hzdemo.HzDemoApplication : Starting HzDemoApplication
2021-12-15 18:09:06.843 INFO 39059 --- [ main] com.example.hzdemo.HzDemoApplication : No active profile set, falling back to default profiles: default
2021-12-15 18:09:07.943 INFO 39059 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8082 (http)
2021-12-15 18:09:07.953 INFO 39059 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-12-15 18:09:07.954 INFO 39059 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.31]
2021-12-15 18:09:08.024 INFO 39059 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-12-15 18:09:08.024 INFO 39059 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1047 ms
2021-12-15 18:09:08.162 INFO 39059 --- [ main] com.hazelcast.instance.AddressPicker : [LOCAL] [hazelcast-cluster] [3.12.6] Prefer IPv4 stack is true, prefer IPv6 addresses is false
2021-12-15 18:09:08.188 INFO 39059 --- [ main] com.hazelcast.instance.AddressPicker : [LOCAL] [hazelcast-cluster] [3.12.6] Picked [10.111.130.204]:5702, using socket ServerSocket[addr=/0:0:0:0:0:0:0:0,localport=5702], bind any local is true
2021-12-15 18:09:08.213 INFO 39059 --- [ main] com.hazelcast.system : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Hazelcast 3.12.6 (20200130 - be02cc5) starting at [10.111.130.204]:5702
2021-12-15 18:09:08.213 INFO 39059 --- [ main] com.hazelcast.system : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Copyright (c) 2008-2020, Hazelcast, Inc. All Rights Reserved.
2021-12-15 18:09:08.490 INFO 39059 --- [ main] c.h.s.i.o.impl.BackpressureRegulator : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Backpressure is disabled
2021-12-15 18:09:08.917 INFO 39059 --- [ main] com.hazelcast.instance.Node : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Creating MulticastJoiner
2021-12-15 18:09:09.101 INFO 39059 --- [ main] c.h.s.i.o.impl.OperationExecutorImpl : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Starting 16 partition threads and 9 generic threads (1 dedicated for priority tasks)
2021-12-15 18:09:09.104 INFO 39059 --- [ main] c.h.internal.diagnostics.Diagnostics : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Diagnostics disabled. To enable add -Dhazelcast.diagnostics.enabled=true to the JVM arguments.
2021-12-15 18:09:09.107 INFO 39059 --- [ main] com.hazelcast.core.LifecycleService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] [10.111.130.204]:5702 is STARTING
2021-12-15 18:09:11.423 INFO 39059 --- [ main] c.h.internal.cluster.ClusterService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6]
Members {size:1, ver:1} [
Member [10.111.130.204]:5702 - 196c9d1f-7fd4-4c48-8dec-0fb913671610 this
]
2021-12-15 18:09:11.424 WARN 39059 --- [ main] com.hazelcast.instance.Node : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Config seed port is 5701 and cluster size is 1. Some of the ports seem occupied!
2021-12-15 18:09:11.451 INFO 39059 --- [ main] c.h.i.m.ManagementCenterService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Hazelcast will connect to Hazelcast Management Center on address:
http://localhost:8080/hazelcast-mancenter
2021-12-15 18:09:11.460 INFO 39059 --- [ main] com.hazelcast.core.LifecycleService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] [10.111.130.204]:5702 is STARTED
2021-12-15 18:09:11.620 INFO 39059 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-12-15 18:09:11.761 INFO 39059 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8082 (http) with context path ''
2021-12-15 18:09:11.765 INFO 39059 --- [ main] com.example.hzdemo.HzDemoApplication : Started HzDemoApplication in 5.854 seconds (JVM running for 6.337)
2021-12-15 18:09:12.470 INFO 39059 --- [.MC.Task.Poller] c.h.i.m.ManagementCenterService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Failed to pull tasks from Management Center
2021-12-15 18:09:12.470 INFO 39059 --- [MC.State.Sender] c.h.i.m.ManagementCenterService : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Failed to connect to: http://localhost:8080/hazelcast-mancenter/collector.do
2021-12-15 18:09:12.471 INFO 39059 --- [MC.State.Sender] com.hazelcast.client.impl.ClientEngine : [10.111.130.204]:5702 [hazelcast-cluster] [3.12.6] Applying a new client selector :ClientSelector{any}
ifconfig output:
utun2: flags=80d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1390
inet 10.111.130.204 --> 10.111.130.204 netmask 0xffffc000

Related

My h2 working, but i cant connect inside of h2-console

Yoo coder, have one issue with h2-console.When i created some entitys on start,my h2 worked and i could open my h2-console and saw there tables ,but after some time i want connect again and doesn't work now.Meanwhile i added some lines and classes,but idk why doesn't work my h2-console,cause i don't touch application properties.
After lick on conect or testconect i got this error
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Mon Mar 14 19:12:33 CET 2022
There was an unexpected error (type=Forbidden, status=403).
My github project: https://github.com/Wynnyy/bookingdoctor-project.git
logs
2022-03-14 19:12:16.222 INFO 23108 --- [ main] s.w.b.BookingdoctorApplication : Starting BookingdoctorApplication using Java 17.0.2 on DESKTOP-K3O8I67 with PID 23108 (C:\Users\Patrik Severín\IdeaProjects\bookingdoctor\target\classes started by Wynny in C:\Users\Patrik Severín\IdeaProjects\bookingdoctor)
2022-03-14 19:12:16.224 INFO 23108 --- [ main] s.w.b.BookingdoctorApplication : No active profile set, falling back to 1 default profile: "default"
2022-03-14 19:12:16.928 INFO 23108 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2022-03-14 19:12:16.986 INFO 23108 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 47 ms. Found 2 JPA repository interfaces.
2022-03-14 19:12:17.670 INFO 23108 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2022-03-14 19:12:17.682 INFO 23108 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2022-03-14 19:12:17.682 INFO 23108 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.58]
2022-03-14 19:12:17.780 INFO 23108 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2022-03-14 19:12:17.780 INFO 23108 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1503 ms
2022-03-14 19:12:17.829 INFO 23108 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2022-03-14 19:12:18.068 INFO 23108 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2022-03-14 19:12:18.080 INFO 23108 --- [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:wynny'
2022-03-14 19:12:18.277 INFO 23108 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2022-03-14 19:12:18.331 INFO 23108 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.5.Final
2022-03-14 19:12:18.497 INFO 23108 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2022-03-14 19:12:18.627 INFO 23108 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect
2022-03-14 19:12:19.225 INFO 23108 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2022-03-14 19:12:19.232 INFO 23108 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2022-03-14 19:12:19.540 WARN 23108 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2022-03-14 19:12:19.708 INFO 23108 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will not secure any request
2022-03-14 19:12:20.112 INFO 23108 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2022-03-14 19:12:20.211 INFO 23108 --- [ main] s.w.b.BookingdoctorApplication : Started BookingdoctorApplication in 4.362 seconds (JVM running for 4.745)
2022-03-14 19:12:24.415 INFO 23108 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-03-14 19:12:24.415 INFO 23108 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2022-03-14 19:12:24.417 INFO 23108 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 2 ms
By default, spring-security will protect each and every end-point - So, for /error you need to manually configure like the following -
#EnableWebSecurity
public class AppSecurityConfig extends WebSecurityConfigurerAdapter {
#Override
public void configure(HttpSecurity auth) {
auth.csrf().disable()
.authorizeRequests()
.antMatchers("/error/**").permitAll() // permit-all for /error page
.anyRequest().authenticated();
}
}
For future reference:
In Spring Boot 3.0 / Spring Security 6.0 http.antMatcher() is not longer available and was replaced with http.securityMatcher().
So Subham's answer would look like that:
#Configuration
public class SecurityConfiguration {
#Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.authorizeHttpRequests((authz) -> authz.anyRequest().permitAll())
.csrf().disable()
.securityMatcher("/error/**")
.httpBasic(withDefaults());
return http.build();
}
}

why I see this when compiling my project in bootstrap? "Found 0 JPA repository interfaces."

I have created a Bootstrap project in which I have 3 repositories. When I compile the project I do not receive any errors but unfortunately I can not see my controllers in Swagger!!!
I have found out that line 4 says:
Finished Spring Data repository scanning in 4 ms. Found 0 JPA
repository interfaces.
I think this the reason that I can not see the controllers. Any idea to solve this? Thank you in advance.
2021-12-14 00:26:13.768 INFO 5472 --- [ main] WBSthesis.rotab.RotabApplication
: No active profile set, falling back to default profiles: default
2021-12-14 00:26:14.648 INFO 5472 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2021-12-14 00:26:14.661 INFO 5472 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : ***Finished Spring Data repository scanning in 4 ms. Found 0 JPA repository interfaces.***
2021-12-14 00:26:15.592 INFO 5472 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-12-14 00:26:15.609 INFO 5472 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-12-14 00:26:15.609 INFO 5472 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.54]
2021-12-14 00:26:15.718 INFO 5472 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-12-14 00:26:15.718 INFO 5472 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1885 ms
2021-12-14 00:26:15.975 INFO 5472 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2021-12-14 00:26:16.051 INFO 5472 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.32.Final
2021-12-14 00:26:16.226 INFO 5472 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}
2021-12-14 00:26:16.356 INFO 5472 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2021-12-14 00:26:16.562 INFO 5472 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2021-12-14 00:26:16.580 INFO 5472 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL55Dialect
2021-12-14 00:26:16.856 INFO 5472 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2021-12-14 00:26:16.866 INFO 5472 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2021-12-14 00:26:17.090 WARN 5472 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2021-12-14 00:26:17.225 INFO 5472 --- [ main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [springfox.documentation.swagger2.web.Swagger2Controller#getDocumentation(String, HttpServletRequest)]
2021-12-14 00:26:17.490 INFO 5472 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2021-12-14 00:26:17.491 INFO 5472 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2021-12-14 00:26:17.511 INFO 5472 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2021-12-14 00:26:17.544 INFO 5472 --- [ main] s.d.s.w.s.ApiListingReferenceScanner : Scanning for api listing references
2021-12-14 00:26:17.698 INFO 5472 --- [ main] WBSthesis.rotab.RotabApplication : Started RotabApplication in 4.468 seconds (JVM running for 4.958)
More info of your project would be helpful, but maybe your interfaces are not inside the right package. I was facing this once...
Here is an example.
Notice that all sub-packages are on the same level as the #SpringBootApplication.

Failed to validate data received from Authorization service - could not validate state

I downloaded ms-identity-java-webapp archive and updated the application.properties file with the Azure AD details.
When I started the Spring Boot application, I got a login page. After clicking login button, I got a microsoft login page and after logging in with the user account, I got the following log lines with an error page:
2020-09-23 16:53:06.982 INFO 708 --- [ main] c.m.a.m.MsalWebSampleApplication : Starting MsalWebSampleApplication with PID 708 (C:\Users\testuser\Downloads\ms-identity-java-webapp-master\msal-java-webapp-sample\target\classes started by testuser in C:\Users\testuser\Downloads\ms-identity-java-webapp-master\msal-java-webapp-sample)
2020-09-23 16:53:06.985 INFO 708 --- [ main] c.m.a.m.MsalWebSampleApplication : No active profile set, falling back to default profiles: default
2020-09-23 16:53:08.466 INFO 708 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2020-09-23 16:53:08.497 INFO 708 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-09-23 16:53:08.497 INFO 708 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.17]
2020-09-23 16:53:08.646 INFO 708 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-09-23 16:53:08.647 INFO 708 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 1613 ms
2020-09-23 16:53:08.967 INFO 708 --- [ main] .s.s.UserDetailsServiceAutoConfiguration :
Using generated security password: 970ff480-0c7d-4cd0-b657-000c23a68ab4
2020-09-23 16:53:09.148 INFO 708 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#6813a331, org.springframework.security.web.context.SecurityContextPersistenceFilter#27494e46, org.springframework.security.web.header.HeaderWriterFilter#68105edc, org.springframework.security.web.csrf.CsrfFilter#6e4ea0bd, org.springframework.security.web.authentication.logout.LogoutFilter#3e598df9, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#1e411d81, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#75504cef, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#1bd81830, org.springframework.security.web.session.SessionManagementFilter#470a9030, org.springframework.security.web.access.ExceptionTranslationFilter#28782602]
2020-09-23 16:53:09.373 INFO 708 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-09-23 16:53:09.561 INFO 708 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page template: index
2020-09-23 16:53:09.710 INFO 708 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2020-09-23 16:53:09.715 INFO 708 --- [ main] c.m.a.m.MsalWebSampleApplication : Started MsalWebSampleApplication in 3.211 seconds (JVM running for 4.717)
2020-09-23 16:53:29.556 INFO 708 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2020-09-23 16:53:29.556 INFO 708 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2020-09-23 16:53:29.562 INFO 708 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 6 ms
Failed to validate data received from Authorization service - could not validate state
Has anyone faced this issue? How can I resolve this?
This issue was already addressed on GitHub and was already fixed. Please go through the solution given here .

How to check for another running project on Eclipse?

I am using eclipse IDE to run my spring boot project(the backend part) which uses the port 8080 on localhost. When i try to run my program it shuts down the program saying port 8080 was already in use. There isn't any other application that is using the port 8080 and there is no other console window because of which i cannot shut down the currently running application that is using port 8080. PFB the logs from the console window:
:: Spring Boot :: (v2.3.3.RELEASE)
2020-09-24 19:31:44.942 INFO 4092 --- [ main] c.library_management.lms.LmsApplication : Starting LmsApplication on DESKTOP-GM2UUP2 with PID 4092 (D:\eclipse-workspace\lms\target\classes started by Electrical Engineer in D:\eclipse-workspace\lms)
2020-09-24 19:31:44.948 INFO 4092 --- [ main] c.library_management.lms.LmsApplication : No active profile set, falling back to default profiles: default
2020-09-24 19:31:50.633 INFO 4092 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode.
2020-09-24 19:31:51.947 INFO 4092 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 1092ms. Found 3 JPA repository interfaces.
2020-09-24 19:31:59.953 INFO 4092 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2020-09-24 19:32:00.358 INFO 4092 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2020-09-24 19:32:00.360 INFO 4092 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.37]
2020-09-24 19:32:01.666 INFO 4092 --- [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2020-09-24 19:32:01.667 INFO 4092 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 16526 ms
2020-09-24 19:32:05.077 INFO 4092 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2020-09-24 19:32:06.080 INFO 4092 --- [ task-1] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]
2020-09-24 19:32:06.793 WARN 4092 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
2020-09-24 19:32:08.214 INFO 4092 --- [ task-1] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.20.Final
2020-09-24 19:32:16.114 INFO 4092 --- [ task-1] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
2020-09-24 19:32:16.817 INFO 4092 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter#5477a1ca, org.springframework.security.web.context.SecurityContextPersistenceFilter#6794ac0b, org.springframework.security.web.header.HeaderWriterFilter#77d680e6, org.springframework.security.web.authentication.logout.LogoutFilter#33a3c44a, org.springframework.security.web.authentication.www.BasicAuthenticationFilter#222afc67, org.springframework.security.web.savedrequest.RequestCacheAwareFilter#5cb5bb88, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter#3a01773b, org.springframework.security.web.authentication.AnonymousAuthenticationFilter#3ae9d1e2, org.springframework.security.web.session.SessionManagementFilter#5c1f6d57, org.springframework.security.web.access.ExceptionTranslationFilter#6014a9ba, org.springframework.security.web.access.intercept.FilterSecurityInterceptor#65f2f9b0]
2020-09-24 19:32:21.739 INFO 4092 --- [ task-1] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2020-09-24 19:32:26.793 WARN 4092 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Failed to start bean 'webServerStartStop'; nested exception is org.springframework.boot.web.server.PortInUseException: Port 8080 is already in use
2020-09-24 19:32:26.862 INFO 4092 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2020-09-24 19:32:31.239 INFO 4092 --- [ task-1] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2020-09-24 19:32:31.877 INFO 4092 --- [ task-1] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect
2020-09-24 19:32:41.109 INFO 4092 --- [ task-1] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
2020-09-24 19:32:41.172 INFO 4092 --- [ task-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
Exception in thread "task-2" 2020-09-24 19:32:41.202 INFO 4092 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2020-09-24 19:32:41.204 INFO 4092 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
java.lang.IllegalStateException: EntityManagerFactory is closed
at org.hibernate.internal.SessionFactoryImpl.validateNotClosed(SessionFactoryImpl.java:509)
at org.hibernate.internal.SessionFactoryImpl.getProperties(SessionFactoryImpl.java:503)
at org.springframework.boot.autoconfigure.orm.jpa.DataSourceInitializedPublisher.findDataSource(DataSourceInitializedPublisher.java:105)
at org.springframework.boot.autoconfigure.orm.jpa.DataSourceInitializedPublisher.publishEventIfRequired(DataSourceInitializedPublisher.java:97)
at org.springframework.boot.autoconfigure.orm.jpa.DataSourceInitializedPublisher.access$100(DataSourceInitializedPublisher.java:50)
at org.springframework.boot.autoconfigure.orm.jpa.DataSourceInitializedPublisher$DataSourceSchemaCreatedPublisher.lambda$postProcessEntityManagerFactory$0(DataSourceInitializedPublisher.java:200)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
2020-09-24 19:32:41.413 INFO 4092 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2020-09-24 19:32:41.418 INFO 4092 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2020-09-24 19:32:41.629 INFO 4092 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-09-24 19:32:41.652 ERROR 4092 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Web server failed to start. Port 8080 was already in use.
Action:
Identify and stop the process that's listening on port 8080 or configure this application to listen on another port.
This can be because you might gave run the project first (so it occupied the port) and now you are trying to run it again without closing the last one.Use this Option
The error message is not ambiguous, and that's not something that will occur "erroneously" (saying something is using the port when it's not actually in use). The port doesn't have to be used by something you started from Eclipse. There is no question that something is already listening on that port. You just have to figure out what it is. Alternatively, you could set up your application to run on a different port.

Suspend after `HHH000204: Processing PersistenceUnitInfo`

I'm using SpringBoot and Hibernate, but the application stops after log HHH000204: Processing PersistenceUnitInfo at start up.
What does it mean?
Full stack:
:: Spring Boot :: (v2.0.5.RELEASE)
2019-01-19 17:30:40.343 INFO 23942 --- [ main] com.mafengwo.Application : Starting Application on sunxingbindeMacBook-Pro.local with PID 23942 (/Users/sunxingbin/IdeaProjects/contentrepojob/target/classes started by sunxingbin in /Users/sunxingbin/IdeaProjects/contentrepojob)
2019-01-19 17:30:40.347 INFO 23942 --- [ main] com.mafengwo.Application : No active profile set, falling back to default profiles: default
2019-01-19 17:30:40.470 INFO 23942 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext#cd3fee8: startup date [Sat Jan 19 17:30:40 CST 2019]; root of context hierarchy
2019-01-19 17:30:41.910 INFO 23942 --- [ main] f.a.AutowiredAnnotationBeanPostProcessor : JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2019-01-19 17:30:42.208 INFO 23942 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$86296a04] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-01-19 17:30:42.750 INFO 23942 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 10086 (http)
2019-01-19 17:30:42.788 INFO 23942 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2019-01-19 17:30:42.788 INFO 23942 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34
2019-01-19 17:30:42.801 INFO 23942 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/Users/sunxingbin/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
2019-01-19 17:30:43.028 INFO 23942 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2019-01-19 17:30:43.028 INFO 23942 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2561 ms
2019-01-19 17:30:43.130 INFO 23942 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2019-01-19 17:30:43.135 INFO 23942 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2019-01-19 17:30:43.136 INFO 23942 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2019-01-19 17:30:43.136 INFO 23942 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2019-01-19 17:30:43.137 INFO 23942 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2019-01-19 17:30:43.200 INFO 23942 --- [ main] o.s.j.d.DriverManagerDataSource : Loaded JDBC driver: com.mysql.jdbc.Driver
2019-01-19 17:30:43.402 INFO 23942 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2019-01-19 17:30:43.433 INFO 23942 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2019-01-19 17:30:43.549 INFO 23942 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.2.17.Final}
2019-01-19 17:30:43.550 INFO 23942 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2019-01-19 17:30:43.599 INFO 23942 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
Sat Jan 19 17:30:43 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2019-01-19 17:30:44.423 INFO 23942 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
Sat Jan 19 17:30:45 CST 2019 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2019-01-19 17:30:45.251 INFO 23942 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-01-19 17:30:45.271 INFO 23942 --- [ main] o.s.j.d.DriverManagerDataSource : Loaded JDBC driver: com.mysql.jdbc.Driver
2019-01-19 17:30:45.276 INFO 23942 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2019-01-19 17:30:45.276 INFO 23942 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]

Categories