使用maven集成tomcat8插件后使用tomcat8:run运行web项目,
访问请求时即报此异常(完整异常):
HTTP Status 500 - java.lang.LinkageError: loader constraint violation: when resolving method “org.apache.jasper.runtime.InstanceManagerFactory.getInstanceManager(Ljavax/servlet/ServletConfig;)Lorg/apache/tomcat/InstanceManager;” the class loader (instance of org/apache/jasper/servlet/JasperLoader) of the current class, org/apache/jsp/index_jsp, and the class loader (instance of org/codehaus/plexus/classworlds/realm/ClassRealm) for the method’s defining class, org/apache/jasper/runtime/InstanceManagerFactory, have different Class objects for the type org/apache/tomcat/InstanceManager used in the signature
提示大致意思是jar包冲突,而我相关的servlet与jsp的依赖的scope属性都是设的provided,在网上搜了很多解决办法后也无解。
后估计是版本原因造成,各种下降版本都无法解决,除了将tomcat8换为
在使用Maven集成Tomcat8插件并尝试通过`tomcat8:run`运行web应用时,遇到了HTTP Status 500错误,具体表现为`java.lang.LinkageError: loader constraint violation`。尽管尝试了调整servlet与jsp依赖的scope属性、更改Tomcat版本等方法,问题依然存在。最终发现,通过使用`tomcat8:run-war`命令,问题得到解决,但具体原因未明。期待有经验的开发者分享见解。
订阅专栏 解锁全文

2315

被折叠的 条评论
为什么被折叠?



