0

With v1.5.14 of the spring-boot-starter-parent the app starts just fine, just changing it to v2.0.x breaks it. I get the below error:

`[main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>([Ljava/lang/Object;)V
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:157)
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:98)
    at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:64)
    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:127)
    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:358)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:317)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1243)
    at com.athena.collector.decisions.application.Application.main(Application.java:57)
([Ljava/lang/Object;)V`



I did read the change in the SpringApplicationBuilder for 2.x. But not sure how to go about fixing it.
Here is the startup snippet

@SpringBootApplication(scanBasePackages = {"com.xyz", "com.abc"})
@EntityScan("com.xyz")
@EnableJpaRepositories("com.xyz")
@EnableAsync
public class Application {

@Autowired 
AppConfigurationProperties applicationPropertiesWrapper;

public static void main(final String[] args) throws Exception {
SpringApplication.run(Application.class, args);
}


Am I missing something basic? Any pointers to stuff that I should read up?

The relevant maven dependencies are below:

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>**2.0.3.RELEASE**</version>
        <!-- <version>1.5.14.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-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <dependency>
        <groupId>org.postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <scope>runtime</scope>
    </dependency>
</dependencies>
Kumaresh Babu N S
  • 1,648
  • 5
  • 23
  • 39
Vinod
  • 81
  • 9

1 Answers1

0

The problem is due to some conflict about versions referenced. Another dependency was using a different set of spring-related jars. Shall update with more details when Ive fully resolved the issue.

Vinod
  • 81
  • 9