0
votes

spring-boot-starter-parent uses 1.5.9

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.9.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

Dependency :

<dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
            <version>2.0.0.RELEASE</version>
        </dependency>

Application :

@RestController
@ComponentScan({"com.bmc.common.portal","com.bmc.common.portal.controllers","com.bmc.dem", "com.bmc.costportal.controllers", "com.bmc.cost.portal"})
@EnableZuulProxy
@SpringBootApplication
public class PortalApplication {

    @Bean
    public EmbeddedServletContainerCustomizer containerCustomizer() {

       return (container -> {
            ErrorPage error400Page = new ErrorPage(HttpStatus.BAD_REQUEST,"/error/400.html");
            ErrorPage error401Page = new ErrorPage(HttpStatus.UNAUTHORIZED,"/error/401.html");
            ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND,"/error/404.html");
            ErrorPage error500Page = new ErrorPage(HttpStatus.INTERNAL_SERVER_ERROR, "/error/500.html");
            container.addErrorPages(error400Page, error401Page,error404Page, error500Page); });
    }

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

Error :

[12 Sep 2018 20:36:26,702] [ERROR] org.springframework.boot.SpringApplication: Application startup failed java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.([Ljava/lang/Class;)V at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:170) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:104) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:70) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:74) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:325) at org.springframework.boot.SpringApplication.run(SpringApplication.java:296) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) atorg.springframework.boot.SpringApplication.run(SpringApplication.java:1107)

1

1 Answers

2
votes

You're using spring-boot-starter-parent from the 1.x branch with spring-cloud-starter-netflix-zuul from the 2.x branch. 2.x is not compatible with 1.x. Try upgrading to a spring-boot-starter-parent from the 2.x branch or downgrading spring-cloud-starter-netflix-zuul to 1.x