在Linux的Tomcat中部署War文件时出错

时间:2018-09-18 09:45:03

标签: java linux spring-boot tomcat

我有一个maven spring项目,该项目仅包含REST API(仅包含mvc控制器部分)。我需要在Linux机器上运行项目的战争。为此,我已经完成了以下步骤

  • 使用maven build创建了战争文件
  • 将战争放置在tomcat的webapps文件夹中
  • 启动了tomcat服务器

但是,我在catalina.log文件中遇到错误

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.example</groupId>
<artifactId>artifacts_repository</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<!-- <packaging>jar</packaging> -->

<name>artifacts_repository</name>
<description>Demo project for Spring Boot</description>

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.4.RELEASE</version>
    <relativePath/> <!-- lookup parent from 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-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-tomcat</artifactId>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
<groupId>org.gitlab4j</groupId>
<artifactId>gitlab4j-api</artifactId>
<version>4.8.0</version>
 </dependency> 
 <dependency>
            <groupId>ch.qos.logback</groupId>
             <artifactId>logback-core</artifactId>
             <version>1.1.7</version>
      </dependency>
   </dependencies>
   </project>

堆栈跟踪-

  

org.springframework.beans.factory.BeanDefinitionStoreException:无法处理配置类[org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration $ EnableTransactionManagementConfiguration $ CglibAutoProxyConfiguration]的导入候选对象;嵌套异常是java.lang.IllegalArgumentException:类org.springframework.transaction.annotation.TransactionManagementConfigurationSelector不能分配给接口org.springframework.context.annotation.ImportSelector

关于我为什么要面对这个问题的任何指示都会很有帮助

0 个答案:

没有答案