简体   繁体   English

无法在远程Ubuntu Tomcat 8.5上进行战争部署-但在本地Tomcat 8.5上运行

[英]War deployment on remote Ubuntu tomcat 8.5 not working - but working on local tomcat 8.5

I try to deploy my war file on a remote ubuntu tomcat 8.5 server, using the gui manager. 我尝试使用gui管理器将war文件部署在远程ubuntu tomcat 8.5服务器上。 But the deployment faile and give back this error : 但是部署失败并返回此错误:

[org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/rest-api-0.0.1-SNAPSHOT]]] [org.apache.catalina.LifecycleException:无法启动组件[StandardEngine [Catalina] .StandardHost [localhost] .StandardContext [/rest-api-0.0.1-SNAPSHOT]]]

Here is my pom.xml : 这是我的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>
<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.0.7.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.faceRecon</groupId>
<artifactId>rest-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>rest-api</name>
<description>faceRecon rest-api</description>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <start-class>com.faceRecon.restapi.Application</start-class>
    <java.version>1.8</java.version>
</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-web</artifactId>
    </dependency>

    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <scope>runtime</scope>
    </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>
</dependencies>

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

and here is my java class starting point : Application.java 这是我的Java类的起点:Application.java

package com.faceRecon.restapi;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import  org.springframework.boot.web.servlet.support.SpringBootServletInitializer;

@SpringBootApplication
public class Application extends SpringBootServletInitializer{

    public static void main(String[] args) {
        SpringApplication.run(Application.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder     application) {
        return application.sources(Application.class);
    }

}

Is this the full error message? 这是完整的错误消息吗? Did you check the "catalina.log" file? 您检查“ catalina.log”文件了吗?

To me it looks like you could forget to provide MYSQL driver on the remote Tomcat. 在我看来,您可能忘记了在远程Tomcat上提供MYSQL驱动程序。

Try copying the driver to the Tomcat's "lib" directory and configure it properly like in this example: Tomcat MYSQL DBCP 尝试将驱动程序复制到Tomcat的“ lib”目录,并像下面的示例一样正确配置它: Tomcat MYSQL DBCP

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM