codecentric / spring-boot-admin

Admin UI for administration of spring boot applications
Apache License 2.0
12.39k stars 3.08k forks source link

Failed to Register App in SBA! #1319

Closed thangavel-projects closed 4 years ago

thangavel-projects commented 4 years ago

My pom.xml as below,

 <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <properties>
        <java.version>11</java.version>
    </properties>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.0.RELEASE</version>
    </parent>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
        <dependency>
            <groupId>org.apache.tomcat.embed</groupId>
            <artifactId>tomcat-embed-jasper</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt</artifactId>
            <version>0.9.0</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.18.10</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.modelmapper</groupId>
            <artifactId>modelmapper</artifactId>
            <version>2.3.5</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-server</artifactId>
            <version>2.1.0</version>
        </dependency>
        <dependency>
            <groupId>de.codecentric</groupId>
            <artifactId>spring-boot-admin-starter-client</artifactId>
            <version>2.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <version>3.0.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>

and Security config is

 @Configuration
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity httpSecurity) throws Exception {
        httpSecurity.authorizeRequests().anyRequest().permitAll()
                .and().csrf().disable();
    }
}  

and My SB main class,

@EnableAdminServer
@Configuration
@EnableAutoConfiguration
@SpringBootApplication
public class ProductServiceApplication {

    public static void main(String[] args) {
        SpringApplication.run(ProductServiceApplication.class, args);
    }

} 

and properties,

spring.boot.admin.client.url=http://localhost:8080
management.endpoints.web.exposure.include=*
management.security.enabled = false

I'm facing error as below,

Failed to register application as Application(name=spring-boot-application, managementUrl=https://192.168.0.227:8080/actuator, healthUrl=https://192.168.0.227:8080/actuator/health, serviceUrl=https://192.168.0.227:8080/) at spring-boot-admin ([http://localhost:8080/instances]): 400 null. Further attempts are logged on DEBUG level
2019-12-04 00:10:59.178  INFO 38949 --- [nio-8080-exec-7] o.a.c.c.C.[Tomcat].[localhost].[/]       :
joshiste commented 4 years ago

If you want me to take a look at your project please provide it in a way I can easily execute it. I don't have the time to stitch it together from your message. So please either upload a zip file here or post a linkt to a github repo.

Also please Note that you are using a pretty old version of Spring Boot and Spring Boot Admin you should update to a more recent 2.1.x (of both)

thangavel-projects commented 4 years ago

Thanks for your reply, and i used SSL in my code which blocked SBA . For time being i just commented SSL config in my application.properties. If you have any suggestion for SSL settings for SBA, just let me know. Thanks!

joshiste commented 4 years ago

then using a https url should do it.