[架构师之路]TOMCAT启动出错

本文介绍了多种Tomcat及Java应用程序中常见的错误及其解决方案,包括配置logging.properties来查看Tomcat错误日志、解决因jar包冲突导致的IncompatibleClassChangeError、定位Jetty单元测试中的错误原因等。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.看tomcat错误日记

  报错信息:StandardContext.startInternal One or more listeners failed to start. Full details will be found in t

  在项目的WEB-INF/classes目录下新建一个文件叫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 = ${catalina.base}/logs  
org.apache.juli.FileHandler.prefix = error-debug.  
  
java.util.logging.ConsoleHandler.level = FINE  
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter  

重新启动tomcat,便可以在tomcat的 logs目录下生产error开头的错误日记。


2.java.lang.IncompatibleClassChangeError: Class org.springframework.core.type.classreading.AnnotationMetadataReadingVisitor

原因是jar包冲突引起的。

spring-core.jar包里已经有了asm

固不用单独导入asm包


方案一:全部的spring引用换成3.4.2;这个版本里面core 有as-common文件夹

3.

http://www.imooc.com/wenda/detail/317567

把“,”变成"#"就可以解决


4. 

The valid characters are defined in RFC 7230 and RFC 3986 错误

http://blog.youkuaiyun.com/sunpeng_sp/article/details/58309190


5.项目在war打包后,jetty单元测试总是报下面的错误
--------------------------------------------------------------------------------------------------
HTTP ERROR 500
Problem accessing /customer/customer/toList. Reason: 
    Server Error


Caused by:
org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): com.sishuok.architecture1.customermgr.dao.CustomerDAO.getByConditionPage
at org.apache.ibatis.binding.MapperMethod$SqlCommand.<init>(MapperMethod.java:184)
at org.apache.ibatis.binding.MapperMethod.<init>(MapperMethod.java:38)
at org.apache.ibatis.binding.MapperProxy.cachedMapperMethod(MapperProxy.java:49)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:42)
at com.sun.proxy.$Proxy31.getByConditionPage(Unknown Source)
at com.sishuok.architecture1.common.service.BaseService.getByConditionPage(BaseService.java:37)
at com.sishuok.architecture1.customermgr.web.CustomerController.toList(CustomerController.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
-------------------------------------------------------------------------------------------------------
进过一个星期的调查调试发现在target下的map文件没有生产导致,不能映射出错;

终于找到该处错误,太开心了;被折磨好一阵子。

接下来看为啥有时候能生成的问题




6.maven的主项目和子模块在clean后,如果直接运行子模块会出现莫名的报错,

这时必须把项目用maven 强制update,错误就可以消失


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值