mvc项目 + Tomcat 部署到服务器

总体过程:

1.本地使用maven打成war包;
2.在SecureCRT中打开SFTP窗口:
lpwd => 查看当前处于本地哪个目录 ,pwd => 查看线上服务器处于哪个目录;
首先进入线上服务器的目标目录,通过put xxx.war 就能上传到目标目录中;
3.通过 jar -xvf xxx.war将war包解压;

遇到的问题

1.NoSuchFieldError: Factory java.lang.NoSuchFieldError: Factory at org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:197)
在tomcat的bin目录下执行:./nohup_start.sh
出现如下错误:
在这里插入图片描述
1)由于在tomcat中部署了好几个应用,所以当时怀疑是依赖包冲突的问题,于是把其他项目的lib包删除了(别学我,被批评了),但是我的应用还是报上图的错误;
2)点击ctrl+N ,搜索发现lite包和schemas包有相同名字的类 ,删除schemas依赖后成功启动。
mvc项目 + Tomcat 部署到服务器_第1张图片
此部分解决思路参考了:https://blog.csdn.net/yuanlairuci1992/article/details/125406863

添加映射

C:\Windows\System32\drivers\etc\hosts文件

# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
#	127.0.0.1       localhost
#	::1             localhost
120.92.71.176       fdtest.dayainfo.com

你可能感兴趣的:(SpringMVC,mvc,tomcat,服务器)