项目启动,仅报错 One or more listeners failed to start
,控制台没有详细的报错信息
28-Jan-2018 13:00:13.839 信息 [RMI TCP Connection(4)-127.0.0.1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
28-Jan-2018 13:00:15.909 严重 [RMI TCP Connection(4)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
28-Jan-2018 13:00:15.935 严重 [RMI TCP Connection(4)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors
[2018-01-28 01:00:15,957] Artifact ssh_crm_02: Error during artifact deployment. See server log for details.
28-Jan-2018 13:00:21.160 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/Users/null/apache-tomcat-8.5.23/webapps/manager]
28-Jan-2018 13:00:21.223 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/Users/null/apache-tomcat-8.5.23/webapps/manager] has finished in [61] ms
解决方案
-
在
classpath
下配置logging.properties
,内容如下:handlers = org.apache.juli.FileHandler, java.util.logging.ConsoleHandler
############################################################
Handler specific properties.
Describes specific configuration info for Handlers.
############################################################
org.apache.juli.FileHandler.level = FINE
org.apache.juli.FileHandler.directory = ../logs
org.apache.juli.FileHandler.prefix = error-debug.java.util.logging.ConsoleHandler.level = FINE
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter -
配置完成后,控制台显示详细的报错信息
Related cause: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseDictDao' defined in file [/Users/null/apache-tomcat-8.5.23/webapps/ssh_crm_02/WEB-INF/classes/com/dao/BaseDictDao.class]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: org.apache.ibatis.builder.BuilderException: Wrong namespace. Expected 'com.boot.dao.BaseDictDao' but found 'com.com.boot.dao.BaseDictDao'. at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202)
...
28-Jan-2018 13:15:33.503 严重 [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
28-Jan-2018 13:15:33.520 严重 [RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors -
根据报错信息,在
BaseDictDao.xml
中,发现namespace路径是com.com.boot.dao.BaseDictDao
<mapper namespace="com.com.boot.dao.BaseDictDao">
<select id="getDictListByTypeCode" parameterType="string" resultType="BaseDict">
SELECT * FROMbase_dict
WHERE dict_type_code=#{typeCode}
</select>
</mapper> -
原因是之前修改了包名,然后xml文件的
namespace
自动修改了 -
把路径修改回正确的路径
com.boot.dao.BaseDictDao
,然后项目正常启动
网友评论