Java eclipse中Tomcat服务器发布问题

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18164582/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 22:57:35  来源:igfitidea点击:

Tomcat Server Publishing issue in eclipse

javaeclipsetomcattomcat7

提问by Subodh Joshi

When i am trying to start the server i am getting below exception

当我尝试启动服务器时,我遇到了异常

Could not publish to the server.java.lang.IndexOutOfBoundsException

Technologies

技术

JSF2,Primefaces3.5,Tomcat7,Java7,GSON2.2.4

JSF2、Primefaces3.5、Tomcat7、Java7、GSON2.2.4

Oprating System

操作系统

Ubuntu13+

Ubuntu13+

IDE

集成开发环境

eclipse Kepler

日食开普勒

I just noticed when i am removing GSON2.2.4.jar then everything working fine but after adding this jar nothing working and even server not started.

我刚刚注意到,当我删除 GSON2.2.4.jar 时,一切正常,但在添加此 jar 后没有任何工作,甚至服务器没有启动。

enter image description here

在此处输入图片说明

采纳答案by Subodh Joshi

I found the issue when i am adding this in pom.xml

我在 pom.xml 中添加这个时发现了这个问题

 <dependency>
        <groupId>com.google.code.gson</groupId>
        <artifactId>gson</artifactId>
        <version>2.2.4</version>
    </dependency>

its creating this issue when i run mvn installi got this error

它在我运行时创建了这个问题mvn install我收到了这个错误

[ERROR] error: error reading /home/hariom/.m2/repository/com/google/code/gson/gson/2.2.4/gson-2.2.4.jar; invalid LOC header (bad signature)

So i replaced this dependency with this one

所以我用这个替换了这个依赖

    <dependency>
    <groupId>com.google.code.gson</groupId>
    <artifactId>gson</artifactId>
    <version>2.2.2</version>
</dependency>

now everything works fine.

现在一切正常。

回答by Yekatandilburg

. I have just got the same problem . I fixed it updating the pom dependencies from the pom.xml file

. 我刚刚遇到了同样的问题。我修复了它从 pom.xml 文件更新 pom 依赖项