Maven中使用tomcat:run 出现错误 org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException...
最近跟著視頻做項目(網上電商商城),看著視頻中老師配置完之后,tomcat:run 就啟動了,但是自己的tomcat:run啟動的時候出現了如下錯誤:
項目正常啟動,但是無法在瀏覽器中打開,報的錯是?org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException
一開始我以為是jsp頁面無法編譯,因為jsp頁面的顯示方式也是類似于文本文件,這跟我們平時看到的有綠色標簽的jsp頁面不一樣,于是就在網上能夠編譯jsp頁面的方法;
經過各種嘗試發現沒有任何效果,然后轉換了一下思路,可能不是編譯的問題,而是tomcat:run的問題,于是再次搜了一下這個錯誤的解決辦法;終于找到一位大神的帖子:
解決方法如下:
1: 在web項目的pom文件中增加tomcat7配置
<build>
<plugins>
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.2</version>
<configuration>
<port>9999</port>
<uriEncoding>UTF-8</uriEncoding>
</configuration>
</plugin>
</plugins>
</build>
2. 啟動tomcat插件,不過這次的命令不是tomcat:run ?而是tomcat7:run 因為前者不會調用tomcat7;
然后就看到了期待已久的頁面:
?
?引用博客:http://blog.csdn.net/franck_lou/article/details/78352864 ? ?
轉載于:https://www.cnblogs.com/zx947240023/p/8149196.html
總結
以上是生活随笔為你收集整理的Maven中使用tomcat:run 出现错误 org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: bzoj 2436: [Noi2011]
- 下一篇: 深入C#数据类型