I am learning Spring Boot JPA and write a very very small API to fetch data from MySql database.
I used Postman to testcalls to my API but when i passed the URL with GET request as:-
http://localhost/9090/Ecommerce/Products
I am getting error saying :- There is an error connecting to
http://localhost/9090/Ecommerce/Products Why this might have happened:
. The server couldn't send a response:Ensure that the backed is working property
. SSL certifications are being blocked : Fix ths by importing SSL certificates in Chrome
. Cookies not being sent Use the Interceptor extension
.Request timeout: Change request timeout in Setting->General
I am sharing all data which i found important to be share here in last section of this post i have shared some important conclusion which i feel weird. Please help me to get out of this rid....
Thanks in advance, your words are value for me.
I am also sharing the content of
application.properties and pom.xml file :-
application.properties file content:- spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/ecommerce spring.datasource.username=root spring.datasource.password=deep spring.jpa.show-sql=true spring.jpa.hibernate.ddl-auto = update spring.jpa.properties.hibernate.dialect= org.hibernate.dialect.MySQL5Dialect server.port = 9090
pom.xml file content:- 4.0.0 org.springframework.boot spring-boot-starter-parent 2.3.1.RELEASE lookup parent from repository com.example demo 0.0.1-SNAPSHOT demo API for Ecommerce demo 1.8 org.springframework.boot spring-boot-starter-data-jpa org.springframework.boot spring-boot-starter-security org.springframework.boot spring-boot-starter-web org.springframework.boot spring-boot-devtools runtime true mysql mysql-connector-java runtime org.springframework.boot spring-boot-starter-test test org.junit.vintage junit-vintage-engine org.springframework.security spring-security-test test org.springframework.boot spring-boot-maven-plugin
Important thing to be notice Notes:- I have seen after running our application by
run as->java application, in console Urls we be generated like :-
main] s.w.s.m.m.a.RequestMappingHandlerAdapter : Mapped "{[/blah/blahs], ........
But i my case i there is nothing like this happened in my console.
I am sharing the output showing on the console..... 2020-07-13 16:36:33.176 INFO 14624 --- [ restartedMain] com.Ecom.demo.DemoApplication : Starting DemoApplication on Owners with PID 14624 (C:\Users\Admin\Documents\workspace-spring-tool-suite-4-4.7.0.RELEASE\demo\target\classes started by Admin in C:\Users\Admin\Documents\workspace-spring-tool-suite-4-4.7.0.RELEASE\demo) 2020-07-13 16:36:33.183 INFO 14624 --- [ restartedMain] com.Ecom.demo.DemoApplication : No active profile set, falling back to default profiles: default 2020-07-13 16:36:33.338 INFO 14624 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2020-07-13 16:36:33.340 INFO 14624 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2020-07-13 16:36:35.363 INFO 14624 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFERRED mode. 2020-07-13 16:36:35.399 INFO 14624 --- [ restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 20ms. Found 0 JPA repository interfaces. 2020-07-13 16:36:37.018 INFO 14624 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9090 (http) 2020-07-13 16:36:37.047 INFO 14624 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-07-13 16:36:37.048 INFO 14624 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.36] 2020-07-13 16:36:37.298 INFO 14624 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-07-13 16:36:37.298 INFO 14624 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3957 ms 2020-07-13 16:36:37.713 INFO 14624 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2020-07-13 16:36:37.885 INFO 14624 --- [ task-1] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default] 2020-07-13 16:36:37.934 WARN 14624 --- [ restartedMain] 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-07-13 16:36:38.180 INFO 14624 --- [ task-1] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.4.17.Final 2020-07-13 16:36:38.768 INFO 14624 --- [ task-1] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.0.Final} 2020-07-13 16:36:39.079 INFO 14624 --- [ restartedMain] .s.s.UserDetailsServiceAutoConfiguration : Using generated security password: 12744535-517f-49ed-95d8-851539d4b3fb 2020-07-13 16:36:39.090 INFO 14624 --- [ task-1] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2020-07-13 16:36:39.294 INFO 14624 --- [ restartedMain] o.s.s.web.DefaultSecurityFilterChain : Creating filter chain: any request, [org.springframework.secu[email protected]50f1a8fd, org.spring[email protected]1da3f9c1, [email protected]73b, [email protected], org.[email protected]6bcc1d40, org.springframework.s[email protected]3ceb6030, org.springframework.[email protected]618dc980, org.springframework.s[email protected]5fb816a7, org.springfram[email protected]71036e06, org.sp[email protected]24189aa0, org.springframework.[email protected]20d91038, org.springfram[email protected]628028ad, o[email protected]5c50972a, org[email protected]4ac2c4e, org.springfr[email protected]c478ce] 2020-07-13 16:36:39.375 INFO 14624 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2020-07-13 16:36:39.540 INFO 14624 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 9090 (http) with context path '' 2020-07-13 16:36:39.545 INFO 14624 --- [ restartedMain] DeferredRepositoryInitializationListener : Triggering deferred initialization of Spring Data repositories… 2020-07-13 16:36:39.547 INFO 14624 --- [ restartedMain] DeferredRepositoryInitializationListener : Spring Data repositories initialized! 2020-07-13 16:36:39.569 INFO 14624 --- [ restartedMain] com.Ecom.demo.DemoApplication : Started DemoApplication in 7.222 seconds (JVM running for 8.19) 2020-07-13 16:36:40.434 INFO 14624 --- [ task-1] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2020-07-13 16:36:40.556 INFO 14624 --- [ task-1] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect 2020-07-13 16:36:41.269 INFO 14624 --- [ task-1] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform] 2020-07-13 16:36:41.281 INFO 14624 --- [ task-1] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
I searched this problem on internet i found to
Turn Off the SSL Certificate Verification by
File >> Settings >> General but please believe me there is option to turn of SSL certification verification in postman i have installed.
Thanks again.......
Hi, our backend uses Tomcat and frontend uses nginx. These are hosted in a windows server. I need to integrate ssl in the application. I need best way to install SSL. It would be really helpful if anyone could give me a good way to do this.