工作日志:java.lang.noclassdeffounderror com/google/gson/gson 问题解决方案
pox.xml配置:
<dependency
>
<groupId
>com
.google
.code
.gson
</groupId
>
<artifactId
>gson
</artifactId
>
<version
>2.2.4</version
>
<scope
>compile
</scope
>
</dependency
>
从图片里可以看出jar包导入正常,纠结了半天,最后发现是Tomcat打包时没有把gson的jar包整合进去。以下是解决方法: 在File的Project structure,点击Artifact设置war包资源 选中所需依赖包,put即可。重新启动就会发现错误消失了。
菜鸡方案仅供参考!
转载请注明原文地址: https://win8.8miu.com/read-5664.html