5

I am trying to Run a web-service server as standalone application using the spring-boot (1.2.4.RELEASE). I have refereed the tutorial provided here spring site.

But in my application I am unable to locate org.springframework.boot.SpringApplication class in any of the APIs of spring boot.

Below is pom.xml file I am using for this:

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.2.4.RELEASE</version>
</parent>
<dependencies>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

Can anyone help me to find out what could be wrong in this.

mevada.yogesh
  • 1,118
  • 3
  • 12
  • 35

2 Answers2

2

I got this working. After using the mvn clean install it has started working.

Initial it was not showing the spring-boot-1.2.5.RELEASE.jar(to which SpringApplication class belong) in the project dependencies. After running above command this dependency got added and now its working fine.

mevada.yogesh
  • 1,118
  • 3
  • 12
  • 35
1

As a newbie to Spring framework, this was one of the errors due to using unmatching java versions in the spring initializer and own project.

I had generated the initializing files with Spring Initializer using JDK 8. But had JDK 11 for the rest of the project's configurations.

Solution - I simply created a new spring initialing file using the Spring documentation.

Upulie Han
  • 431
  • 1
  • 7
  • 15