一、tomcat启动时报错: java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener 解决方法: 1.右键点击项目--选择Properties 选择Deployment Assembly,在右边点击Add按钮,在弹出的窗口中选择Java Build Path Entries。 2.点击Next,选择Maven Dependencies 3.点击Finish,然后可以看到已经把Maven Dependencies添加到Web应用结构中了。 参考自:http://chenzhou123520.iteye.com/blog/1836987 二、访问URL时404 警告: No mapping found for HTTP request with URI [/bus/test] in DispatcherServlet with name 'dispatcher' 解决方法: 在xxx_servlet.xml中添加 <mvc:default-servlet-handler/> 一行代码,成功解决。、 三、实现Comparator接口时抛出异常 错误:Comparison method violates its general contract 解决方法:JDK7中Collections.sort()方法实现中,如果两个值是相等的,需要在compare方法中返回0,否则可能会在排序时抛出异常。 四、LRUMap找不到异常 错误:java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LRUMap 解决方法:在commons-collections-2.1.1.jar包中找到了LRUMap.class文件但他没在map文件夹下而是直接放在了collections下。后来换了个包commons-collections-3.1.jar.问题解决。