1.过滤器启动异常
报错:10-Jun-2021 18:21:40.315 严重 [RMI TCP Connection(3)-127.0.0.1] org.apache.catalina.core.StandardContext.filterStart 启动过滤器异常
java.lang.ClassNotFoundException: org.springframework.web.filter.CharacterEncodingFilter
解决:在project-structure中的Artifacts中的以下界面
WEB-INF下添加lib目录,导入所有的jar包
2021-06-21:在未使用模板的情况下添加web app框架支持,又出现上述问题,执行解决方法后依然未解决。(out目录的WEB-INF下有lib目录)
修复bug过程:
1.在web.xml中吧过滤器注释掉,tomcat可以执行
2.调用spring的filter类,可以执行
org.springframework.web.filter.CharacterEncodingFilter
3.发现生成的classes里面一个包都没有
4.在java目录下写一个test.java文件,重新运行,classes下也没有该文件
未完。。
二、初始化异常,bean创建异常
web.xml中dispatcherServlet的初始化错了
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springmvc-servlet.xml</param-value>
</init-param>
应该绑定applicationContext.xml
三、out包下只有一个包:
和上一次的项目对比,发现.iml中多出一块内容
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
删除后重新编译,问题解决,还多了个target目录
有时找不到错误就清理缓存重开。。。有可能是idea的bug
Parameter ‘newPassword’ not found. Available parameters are [arg1, arg0, param1, param2]
多个参数传入sql的话,要用@Param注解参数,不然可能会报错