当我尝试在Eclipse / STS中部署到Tomcat / tc Server时,ClassNotFoundException [英] ClassNotFoundException when I try to deploy to Tomcat / tc Server in Eclipse / STS

查看:207
本文介绍了当我尝试在Eclipse / STS中部署到Tomcat / tc Server时,ClassNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Eclipse / STS的新手,我正在部署到Tomcat / tcServer。我的项目构建得很好,并且在Netbeans中部署到Tomcat,并直接连接到Tomcat,但它不会在Eclipse中部署到Tomcat或tc Server。我得到一个ClassNotFoundException为org.hibernate.HibernateException,我知道是包含在pom。



这是我的日志输出如果它有帮助。



同样在标记视图中,我看到以下构建路径问题:

 存档为必需库:'〜/ .m2 / repository / org / hibernate / hibernate-core / 4.1.1.Final / hibernate-项目'flamespass-web-dev'中的core-4.1.1.Final.pom'无法读取或不是有效的ZIP文件

$ b $我发现一个工作:
我注意到我有hibernate-core:4.1.1.Final在我的依赖层次结构两次,所以我尝试了一些事情,并指定了最新版本的hibernate-core在我的dependencyManagement节点修复了我的问题。



我不知道为什么。我只能假设hibernate-core的两个副本:4.1.1正在创建某种模糊性,即使我的外部Maven / Tomcat可以使用m2eclipse或者WTP也不能理解。我真的很感激任何人可能有任何解释或更好的解决方案。谢谢。

  ... 
< / dependencies>
< dependencyManagement>
<依赖关系>
<依赖关系>
< groupId> org.hibernate< / groupId>
< artifactId> hibernate-core< / artifactId>
< version> 4.1.9.Final< / version>
< / dependency>
< / dependencies>
< / dependencyManagement>


I'm new to Eclipse/STS, and I am having deploying to Tomcat / tcServer. My project builds just fine and deploys to Tomcat fine both in Netbeans and directly to Tomcat, but it will not deploy to Tomcat or tc Server in Eclipse. I get a ClassNotFoundException for org.hibernate.HibernateException, which I know is on the included in the pom.

Here's my log output if it helps.

Also in the markers view, I see the following build path problem:

Archive for required library: '~/.m2/repository/org/hibernate/hibernate-core/4.1.1.Final/hibernate-core-4.1.1.Final.pom' in project 'flamespass-web-dev' cannot be read or is not a valid ZIP file

解决方案

I found a work around: I noticed that I had hibernate-core:4.1.1.Final in my Dependency Hierarchy twice, so I tried a few things, and specifying the newest version of hibernate-core in my dependencyManagement node fixed my problem.

I am not sure why. I can only assume that the two copies of hibernate-core:4.1.1 were creating some sort of ambiguity that m2eclipse or WTP couldn't understand even though my external Maven/Tomcat could. I would really appreciate any explanation or better fixes anyone may have. Thanks.

    ...
</dependencies>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.hibernate</groupId>
            <artifactId>hibernate-core</artifactId>
            <version>4.1.9.Final</version>
        </dependency>
    </dependencies>
</dependencyManagement>

这篇关于当我尝试在Eclipse / STS中部署到Tomcat / tc Server时,ClassNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆