ClassNotFoundException-org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader

时间:2019-06-07 17:14:06

标签: eclipse maven spring-boot

在运行网络应用程序时以及成功构建后出现以下错误

  

java.lang.ClassNotFoundException:   org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader     在java.net.URLClassLoader.findClass(URLClassLoader.java:382)   〜[na:1.8.0_201]在   java.lang.ClassLoader.loadClass(ClassLoader.java:424)〜[na:1.8.0_201]     在java.lang.ClassLoader.loadClass(ClassLoader.java:357)   〜[na:1.8.0_201],位于java.lang.Class.forName0(本机方法)   〜[na:1.8.0_201],位于java.lang.Class.forName(Class.java:264)   〜[na:1.8.0_201]在   org.apache.catalina.loader.WebappLoader.createClassLoader(WebappLoader.java:507)   〜[catalina.jar:8.5.37]在   org.apache.catalina.loader.WebappLoader.startInternal(WebappLoader.java:392)   〜[catalina.jar:8.5.37]在   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)   [catalina.jar:8.5.37]

Pom.xml

   
<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>

<parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.1.2.RELEASE</version>
        <relativePath /> <!-- lookup parent from repository -->
    </parent>

  <groupId>com.neu.csye6225</groupId>
  <artifactId>webApplication</artifactId>
  <version>0.0.1-SNAPSHOT</version>
 <!--  <packaging>jar</packaging> -->

  <name>webApplication</name>
  <url>http://maven.apache.org</url>

  <properties>
    <java.version>1.8</java.version>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

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

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.9.2</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.9.2</version>
        </dependency>
        <dependency>
                        <groupId>org.springframework.boot</groupId>
                        <artifactId>spring-boot-starter-tomcat</artifactId>
                </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-compiler-plugin -->
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
        </dependency>

            <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>

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

</project>

0 个答案:

没有答案