Spring error starting server

Asked

Viewed 494 times

1

I imported a Maven project that worked perfectly before, but now I’m with it giving error.

Every time I try to fix this error, I keep changing the versions of Java, deleting and importing 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.Talina.util.Sessionidgeneratorbase createSecureRandom INFORMATION: Creation of Securerandom instance for Session ID Generation using [SHA1PRNG] Took [132] milliseconds. jul 01, 2017 10:02:51 pm org.apache.Talina.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.Talina.core.Defaultinstancemanager.loadClass(Defaultinstancemanager.java:495) at org.apache.Catalina.core.Defaultinstancemanager.loadClassMaybePrivileged(Defaultinstancemanager.java:477) at org.apache.Talina.core.Defaultinstancemanager.newInstance(Defaultinstancemanager.java:113) at org.apache.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.Containerbase$Startchild.call(Containerbase.java:1571) at org.apache.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

  • First, don’t mix Spring Boot dependencies with Spring Framework dependencies, you can have a lot of conflicts. The exception seems to be related to Spring Security.

  • @How then to separate them?

1 answer

1


I solved it like this:

  1. Add Java to Environment Variables;
  2. Remove the project and delete the Workspace folder;
  3. Create a new Workspace (so you have the default settings);
  4. Import the project as Java Project instead of Maven Project;
  5. Check in the tab Markers if there is an error in the project, if there is, right-click and go to the option Quick Fix;
  6. Add a server using the default JRE configuration (make sure the project is running with the JRE of the JDK folder);
  7. Right-click on the project, go to the option Run As, select Maven Clean and shortly after Maven Install;
  8. Click on the project and give ALT + F5;
  9. Go on the tab Servers, right-click on the server and select Publish;
  10. Start the server;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.