idea在maina方法运行出现错误:

Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main"

网上没找到,只有eclipse  的,自我思考

原因:

 <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${servlet.version}</version>
            <scope>provided</scope>
        </dependency>

因为javax.servlet 依赖没引来

解决

把红圈勾上就可以了

 

posted on 2018-12-02 15:42  JSBK  阅读(1204)  评论(0编辑  收藏  举报