eclipse - The type org.springframework.context.ConfigurableApplicationContext cannot be resolved -


i getting following error, when tried create first application in spring tool suite:

multiple markers @ line - type org.springframework.context.configurableapplicationcontext cannot resolved. indirectly referenced required .class files - method run(object, string...) thae type springapplication refers missing type configurableapplicationcontext

this following pom.xml

    <?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>          <groupid>com.welcome</groupid>         <artifactid>demo</artifactid>         <version>0.0.1-snapshot</version>         <packaging>jar</packaging>          <name>welcome</name>         <description>demo project spring boot</description>          <parent>             <groupid>org.springframework.boot</groupid>             <artifactid>spring-boot-starter-parent</artifactid>             <version>1.3.6.release</version>             <relativepath/> <!-- lookup parent repository -->         </parent>          <properties>             <project.build.sourceencoding>utf-8</project.build.sourceencoding>             <project.reporting.outputencoding>utf-8</project.reporting.outputencoding>             <java.version>1.8</java.version>         </properties>            <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</artifactid>             </dependency>         </dependencies>          <build>             <plugins>                 <plugin>                     <groupid>org.springframework.boot</groupid>                     <artifactid>spring-boot-maven-plugin</artifactid>                 </plugin>             </plugins>         </build>     </project>        controller used       package com.welcome.demo;      import org.springframework.boot.springapplication;     import org.springframework.boot.autoconfigure.enableautoconfiguration;     import org.springframework.boot.autoconfigure.springbootapplication;       @springbootapplication     @enableautoconfiguration     public class welcomeapplication {          public static void main(string[] args)throws exception {             springapplication.run(welcomeapplication.class, args);         }     } 

can 1 in this? mistake? , showing red exclamation mark on project folder.

your maven cache corrupted. resolve problem, follow steps below:

  • go directory of project on command line.
  • make sure pom.xml in same directory command line
  • run command

    mvn dependency:purge-local-repository 
  • if receive build successful message, means error has been resolved.

  • if error still there, delete (~/.m2/repository/org/springframework) folder , run

    mvn package 

it work now.


Comments