[JAVA]TOMCAT闪退如何查看错误原因

       最近完成了一次系统迁移,是采取V2V的形式克隆的虚拟机,本地环境几乎没有发生变化。但是启动tomcat时一直闪退,对于一个没有用JAVA搞过事情的小白来讲无法查找到错误原因,十分痛苦。网上教程大多都是说环境变量设置的问题,excuse me?都没有说怎么查看报错原因,难道是一个一个尝试出来的?

       其实不管是什么原因,能查看到抛出的错误才是最关键的,这样才知道该从哪个方向解决。

@echo off
rem Licensed to the Apache Software Foundation (ASF) under one or more
rem contributor license agreements.  See the NOTICE file distributed with
rem this work for additional information regarding copyright ownership.
rem The ASF licenses this file to You under the Apache License, Version 2.0
rem (the "License"); you may not use this file except in compliance with
rem the License.  You may obtain a copy of the License at
rem
rem     http://www.apache.org/licenses/LICENSE-2.0
rem
rem Unless required by applicable law or agreed to in writing, software
rem distributed under the License is distributed on an "AS IS" BASIS,
rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
rem See the License for the specific language governing permissions and
rem limitations under the License.

set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_51
set JRE_HOME=C:\Program Files\Java\jre7

rem ---------------------------------------------------------------------------
rem Start script for the CATALINA Server
rem ---------------------------------------------------------------------------

setlocal

rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%CATALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%CURRENT_DIR%"
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
cd ..
set "CATALINA_HOME=%cd%"
cd "%CURRENT_DIR%"
:gotHome
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
echo The CATALINA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

set "EXECUTABLE=%CATALINA_HOME%\bin\catalina.bat"

rem Check that target executable exists
if exist "%EXECUTABLE%" goto okExec
echo Cannot find "%EXECUTABLE%"
echo This file is needed to run this program
goto end
:okExec

rem Get remaining unshifted command line arguments and save them in the
set CMD_LINE_ARGS=
:setArgs
if ""%1""=="""" goto doneSetArgs
set CMD_LINE_ARGS=%CMD_LINE_ARGS% %1
shift
goto setArgs
:doneSetArgs

call "%EXECUTABLE%" start %CMD_LINE_ARGS%

:end


上述是启动tomcat的脚本,一点就闪退,什么都看不见。恼火!

尝试在末尾添加pause(按任意键继续),这下好了,cmd窗口倒是不闪退了,但是tomcat窗口还是闪退。按任意键继续~闪退了。。

其实最重要的是把call "%EXECUTABLE%" start %CMD_LINE_ARGS% 的start改成run,即call "%EXECUTABLE%" run %CMD_LINE_ARGS%

终于不闪退了,能查看报错原因了

才发现原来是附件映射路径失效了,重新建立磁盘映射再启动tomcat即可。

没搞懂为什么会因为附件的映射路径失效启动不了应用~

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值