org.apache.catalina.core.StandardService- Stopping service [Tomcat]

  如题Springboot启动时报错:INFO org.apache.catalina.core.StandardService- Stopping service [Tomcat]
  这个问题遇到的概率还是相对比较高的,特意总结一下,长期更新,欢迎大家补充和指正。
  原因一:controller的@RequestMapping中url重复
  原因二:springboot+mybatis时,实体类@Alias注解别名重复,或找不到对应的别名
  原因三:springboot+mybatis时,sql语法有问题,尤其是启动时有一些初始化操作,这种情况可以在application.properties配置mybatis的日志输出从而定位到错误位置

logging.com.qs.birp.dao=debug
mybatis.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl

  原因四 springboot定义了接口,实现类忘了Service注解
  接口:

public interface SignService {
	public Map<String,Object> registerConfirm(Map<String,Object> para);
}

  实现类

@Service    //忘记加注解
public class SignServiceImpl implements SignService{
	...
}

  原因五 mybatis dao层接口,忘了@Repository注解
例如下文的代码是错的

import .....
public interface DxxmglDao {
.....	
}
  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
============================================<br><br>Out of the box, Tomcat 5.5 requires the Java 2 Standard Edition Runtime<br>Environment (JRE) version 5.0 or later. However, you can also run Tomcat<br>5.5 on earlier versions of the JRE, as detailed below.<br><br>=============================<br>Running With JRE 5.0 Or Later<br>=============================<br><br>(1) Download and Install the J2SE Runtime Environment (JRE)<br><br>(1.1) Download the Java 2 Standard Edition Runtime Environment (JRE),<br> release version 5.0 or later, from http://java.sun.com/j2se.<br><br>(1.2) Install the JRE according to the instructions included with the<br> release.<br><br>(1.3) Set an environment variable named JAVA_HOME to the pathname of<br> the directory into which you installed the JRE, e.g. c:\j2sdk5.0<br> or /usr/local/java/j2sdk5.0.<br><br><br>(2) Download and Install the Tomcat Binary Distribution<br><br>NOTE: As an alternative to downloading a binary distribution, you can create<br>your own from the Tomcat source repository, as described in "BUILDING.txt".<br>If you do this, the value to use for "${catalina.home}" will be the "dist"<br>subdirectory of your source distribution.<br><br>(2.1) Download a binary distribution of Tomcat from:<br><br> http://tomcat.apache.org<br><br>(2.2) Unpack the binary distribution into a convenient location so that the<br> distribution resides in its own directory (conventionally named<br> "apache-tomcat-[version]"). For the purposes of the remainder of this document,<br> the symbolic name "$CATALINA_HOME" is used to refer to the full<br> pathname of the release directory.<br><br><br>(3) Start Up Tomcat<br><br>(3.1) Tomcat can be started by executing the following commands:<br><br> $CATALINA_HOME\bin\startup.bat (Windows)<br><br> $CATALINA_HOME/bin/startup.sh (Unix)<br><br>(3.2) After startup, the default web applications included with Tomcat will be<br> available by visiting:<br><br> http://localhost:8080/<br><br>(3.3) Further information about configuring and running Tomcat can be found in<br> the documentation included here, as well as on the Tomcat web site:<br><br> http://tomcat.apache.org<br><br><br>(4) Shut Down Tomcat<br><br>(4.1) Tomcat can be shut down by executing the following command:<br><br> $CATALINA_HOME\bin\shutdown (Windows)<br><br> $CATALINA_HOME/bin/shutdown.sh (Unix)<br><br><br><br>====================================<br>Running Tomcat With J2SE Version 1.4<br>====================================<br><br>(1) Obtain the compat package:<br><br>(1.1) Download the compat package from the binary download site:<br> http://tomcat.apache.org<br><br> * Or build this package yourself from the source code: see <br> "BUILDING.txt" in this directory.<br><br>(2) Unzip the package in $CATALINA_HOME. It will place the XML<br> parser APIs and Xerces implementation in the common/endorsed<br> directory, and the JMX API jar (jmx.jar from Sun) in the bin<br> directory.<br><br>(3) Follow the same directions for starting and stopping the<br> server as if you were using J2SE 5.0.<br><br><br>==================================================<br>Advanced Configuration - Multiple Tomcat Instances<br>==================================================<br><br>In many circumstances, it is desirable to have a single copy of a Tomcat<br>binary distribution shared among multiple users on the same server. To make<br>this possible, you can pass a "-Dcatalina.base=$CATALINA_BASE" argument when<br>executing the startup command (see (2)). In this<br>"-Dcatalina.base=$CATALINA_BASE" argument, replace $CATALINA_BASE with the<br>directory that contains the files for your 'personal' Tomcat instance.<br><br>When you use this "-Dcatalina.base=$CATALINA_BASE" argument, Tomcat will<br>calculate all relative references for files in the following directories based<br>on the value of $CATALINA_BASE instead of $CATALINA_HOME:<br><br>* conf - Server configuration files (including server.xml)<br><br>* logs - Log and output files<br><br>* shared - For classes and resources that must be shared across all web<br> applications<br><br>* webapps - Automatically loaded web applications<br><br>* work - Temporary working directories for web applications<br><br>* temp - Directory used by the JVM for temporary files (java.io.tmpdir)<br><br>If you do not pass the "-Dcatalina.base=$CATALINA_BASE" argument to the<br>startup command, $CATALINA_BASE will default to the same value as $CATALINA_HOME,<br> which means that the same directory is used for all relative path resolutions.<br><br>The administration and manager web applications, which are defined in the<br>$CATALINA_BASE/conf/Catalina/localhost/admin.xml<br>and <br>$CATALINA_BASE/conf/Catalina/localhost/manager.xml files, will<br>not run in that configuration, unless either:<br>- The path specified in the docBase attribute of the Context element is made<br> absolute, and replaced respectively by $CATALINA_HOME/server/webapps/admin<br> and $CATALINA_HOME/server/webapps/manager<br>- Both web applications are copied or moved to $CATALINA_BASE, <br> and the path specified in the docBase attribute of the Context<br> element is modified appropriately.<br>- Both web applications are disabled by removing<br> $CATALINA_BASE/conf/Catalina/localhost/admin.xml<br> and<br> $CATALINA_BASE/conf/Catalina/localhost/manager.xml.<br><br><br>================<br>Troubleshooting<br>================<br><br>There are only really 3 things likely to go wrong during the stand-alone<br>Tomcat install:<br><br>(1) The most common hiccup is when another web server (or any process for that<br> matter) has laid claim to port 8080. This is the default HTTP port that<br> Tomcat attempts to bind to at startup. To change this, open the file:<br><br> $CATALINA_HOME/conf/server.xml<br><br> and search for '8080'. Change it to a port that isn't in use, and is<br> greater than 1024, as ports less than or equal to 1024 require superuser<br> access to bind under UNIX.<br><br> Restart Tomcat and you're in business. Be sure that you replace the "8080"<br> in the URL you're using to access Tomcat. For example, if you change the<br> port to 1977, you would request the URL http://localhost:1977/ in your browser.<br><br>(2) An "out of environment space" error when running the batch files in<br> Windows 95, 98, or ME operating systems.<br><br> Right-click on the STARTUP.BAT and SHUTDOWN.BAT files. Click on<br> "Properties", then on the "Memory" tab. For the "Initial environment" field,<br> enter in something like 4096.<br><br> After you click apply, Windows will create shortcuts which you can use<br> to start and stop the container.<br><br>(3) The 'localhost' machine isn't found. This could happen if you're behind a<br> proxy. If that's the case, make sure the proxy configuration for your<br> browser knows that you shouldn't be going through the proxy to access the<br> "localhost".<br><br> In Netscape, this is under Edit/Preferences -> Advanced/Proxies, and in<br> Internet Explorer, Tools -> Internet Options -> Connections -> LAN Settings.<br>

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值