问题描述:
启动war项目后打开网页输入对应网址,无法进入,报错
HTTP Status 500 - java.lang.LinkageError: loader constraint violation: loader org.apache.jasper.servlet.JasperLoader @664903b5 (instance of org.apache.jasper.servlet.JasperLoader, child of org.apache.catalina.loader.WebappClassLoader @3ca3fdd0 org.apache.catalina.loader.WebappClassLoader) wants to load interface javax.servlet.http.HttpServletRequest. A different interface with the same name was previously loaded by org.codehaus.plexus.classworlds.realm.ClassRealm @7dffda8b (instance of org.codehaus.plexus.classworlds.realm.ClassRealm, child of ‘bootstrap’).
错误原因:
在pom.xml配置javax.servlet时没有部署scope标签
问题解决:
在pom文件中的servlet依赖部分增加标签
<scope>provided</scope>