Phate P
Phate P

Reputation: 1691

Configure Spring Boot to listen for request beside localhost

I am connected to dormitory subweb. I have 2 machines with external ip adresses. ( I am able to ping them or connect with them via SSH) Raspberry Pi running ubuntu mate where my Spring Boot server is hosted and other machine running Windows 10. Problem is that Spring server do not respond to requests from any source beside dormitory web (DW). I found that Issue is 8080 port closed. when I scan for open ports from beside DW I can only see 22 port opened, Computers inside DW see 8080 and 22 ports as opened and are able to respond HTTP server.

From what I have read here I have to set server.address property to be accessible from "outside"

My spring application.properties

#mysql test config
spring.datasource.url=jdbc:mysql://localhost:3306/springboot
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver`
spring.jpa.show-sql=true

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQLDialect
spring.jpa.hibernate.ddl-auto = update
spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.DefaultNamingStrategy

#initialization
spring.datasource.schema=classpath:/data/schema.sql

#server
server.address= my.adres.here
server.port = 8080

I am sure that sever reads this file properly.

I also tried turn off firewall temporarily

sudo ufw disable

to check if it blocks connection on this port but thats not the issue.

I am not sure where the real problem may be localized. Could it be something wrong with Spring Boot config? Or maybe it is some networking issue.

Upvotes: 0

Views: 3521

Answers (1)

Phate P
Phate P

Reputation: 1691

as @Robert Masen suggested problem was dormitory network blocking connection on 8080 port.

Upvotes: 1

Related Questions