Error in Spring when starting the server

1

Imported a Maven project that worked perfectly before, but now I'm giving it error.

Every time I try to fix this error, I change the Java versions, deleting and importing them again and so on.

Dependencies:

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

<!-- BEGIN DEPENDENCIES -->
<dependencies>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc</artifactId>
    </dependency>

    <!-- BEGIN SPRING MVC -->
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
    </dependency>
    <!-- END SPRING MVC -->

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

    <!-- BEGIN SPRING BOOT -->
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-security</artifactId>
    </dependency>
    <!-- END SPRING BOOT -->

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-mail</artifactId>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>jstl</artifactId>
    </dependency>

    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <scope>provided</scope>
    </dependency>

    <!-- BEGIN HAKARICP -->
    <dependency>
        <groupId>com.zaxxer</groupId>
        <artifactId>HikariCP</artifactId>
    </dependency>
    <!-- END HAKARICP -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-entitymanager</artifactId>
    </dependency>

    <dependency>
        <groupId>org.springframework.data</groupId>
        <artifactId>spring-data-jpa</artifactId>
    </dependency>
    <!-- BEGIN APACHE COMMONS -->
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-io</artifactId>
        <version>1.3.2</version>
    </dependency>
    <!-- END APACHE COMMONS -->
    <!-- BEGIN COMMONS FILE UPLOAD -->
    <dependency>
        <groupId>commons-fileupload</groupId>
        <artifactId>commons-fileupload</artifactId>
        <version>1.2.2</version>
    </dependency>
    <!-- END COMMONS FILE UPLOAD -->
    <!-- BEGIN JUNIT -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>
    <!-- END JUNIT -->
    <!-- BEGIN MYSQL CONNECTOR -->
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
    </dependency>
    <!-- END MYSQL CONNECTOR -->
</dependencies>
<!-- END DEPENDENCIES -->

Error message:

  

INFORMATION: Starting Servlet Engine: Apache Tomcat / 7.0.78 Jul 01,   2017 10:02:50 PM org.apache.catalina.util.SessionIdGeneratorBase   createSecureRandom INFO: Creation of SecureRandom instance for   session ID generation using [SHA1PRNG] took [132] milliseconds. jul   01, 2017 10:02:51 PM org.apache.catalina.core.StandardContext   FILTERStart GRAVE: Exception starting filter springSecurityFilterChain   java.lang.ClassNotFoundException:   org.springframework.web.filter.DelegatingFilterProxy at   org.apache.catalina.loader.WebappClassLoaderBase.loadClass (WebappClassLoaderBase.java:1892)     at   org.apache.catalina.loader.WebappClassLoaderBase.loadClass (WebappClassLoaderBase.java:1735)     at   org.apache.catalina.core.DefaultInstanceManager.loadClass (DefaultInstanceManager.java:495)     at   org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged (DefaultInstanceManager.java:477)     at   org.apache.catalina.core.DefaultInstanceManager.newInstance (DefaultInstanceManager.java:113)     at   org.apache.catalina.core.ApplicationFilterConfig.getFilter (ApplicationFilterConfig.java:258)     at   org.apache.catalina.core.ApplicationFilterConfig (ApplicationFilterConfig.java:105)     at   org.apache.catalina.core.StandardContext.filterStart (StandardContext.java:4958)     at   org.apache.catalina.core.StandardContext.startInternal (StandardContext.java:5652)     at   org.apache.catalina.util.LifecycleBase.start (LifecycleBase.java:145)     at   org.apache.catalina.core.ContainerBase $ StartChild.call (ContainerBase.java:1571)     at   org.apache.catalina.core.ContainerBase $ StartChild.call (ContainerBase.java:1561)     at java.util.concurrent.FutureTask.run (FutureTask.java:266) at   java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142)     at   java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:617)     at java.lang.Thread.run (Thread.java:748)

     

Jul 01, 2017 10:02:51 PM org.apache.catalina.core.StandardContext   startInternal GRAVE: One or more Filters failed to start. Full details   will be found in the appropriate container log file Jul 01, 2017   10:02:51 PM org.apache.catalina.core.StandardContext startInternal   GRAVE: Context [/ file] startup failed due to previous errors

    
asked by anonymous 02.07.2017 / 03:21

1 answer

1

I decided this way:

  • Add Java Environment Variables ;
  • Remove the project and delete the workspace folder;
  • Create a new workspace (so you have the default settings);
  • Import the project as Java Project instead of Maven Project ;
  • Check the Markers tab if there are any errors in the project, if there is a right click and go to Quick Fix option;
  • Add a server using the default JRE configuration (make sure the project is running with the JRE from the JDK folder);
  • Right-click the project, go to Run As , select Maven Clean and right after Maven Install ;
  • Click on the project and give ALT + F5 ;
  • Go into the Servers tab, right-click the server and select Publish ;
  • Start the server;
  • 03.07.2017 / 07:22