IDEA Maven搭建的Web项目出现ClassNotFoundException
2017-08-21 14:45
399 查看
问题描述:
Maven搭建的JavaWeb项目jsp+servlet, 用fastjson解析json的时候居然出现ClassNotFoundExcpetion:com/fastjson/JSON。但是奇怪的是Maven中有添加fastjson的依赖,后台测试解析数据是没问题的,但是只要一起tomcat就报错。
原因:
jar包并没有添加到web-inf/lib目录下
打开Project Structure->artifact界面
发现jar包并没有没添加进去 双击即可
由于我创建的Web项目并没用直接只用web archetype,所有有时候回出现jar包没有被自动添加进去,所有以后建议还是用archetype创建,或者自定义archetype并且配置好路径
Maven搭建的JavaWeb项目jsp+servlet, 用fastjson解析json的时候居然出现ClassNotFoundExcpetion:com/fastjson/JSON。但是奇怪的是Maven中有添加fastjson的依赖,后台测试解析数据是没问题的,但是只要一起tomcat就报错。
原因:
jar包并没有添加到web-inf/lib目录下
打开Project Structure->artifact界面
发现jar包并没有没添加进去 双击即可
由于我创建的Web项目并没用直接只用web archetype,所有有时候回出现jar包没有被自动添加进去,所有以后建议还是用archetype创建,或者自定义archetype并且配置好路径
相关文章推荐
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- MyEclipse maven web项目junit测试出现ClassNotFoundException
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- 我的maven项目出现java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- Maven工程启动报错:maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoad
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- 部署maven项目出现错:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- Java---当由Maven搭建的Web项目报java.lang.ClassNotFoundException: org.springframework.web异常
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- 搭建项目Maven+springMVC+hibernate时,JUnit测试出现报ClassNotFoundException错误的解决
- maven项目下JSTL表达式联系出现java.lang.ClassNotFoundException: org.apache.jsp.WEB_002dINF.jsp.index_jsp
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- 【转】maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
- 遇到问题---maven---启动项目出现出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoa
- maven 项目出现 java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener