【问题标题】:ClassNotFoundException when I try to deploy to Tomcat / tc Server in Eclipse / STS当我尝试在 Eclipse / STS 中部署到 Tomcat / tc 服务器时出现 ClassNotFoundException
【发布时间】:2012-12-18 03:50:23
【问题描述】:

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

如果有帮助,这是我的log output

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

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

【问题讨论】:

    标签: eclipse tomcat maven m2eclipse eclipse-wtp


    【解决方案1】:

    我找到了解决方法: 我注意到我的依赖层次结构中有两次 hibernate-core:4.1.1.Final ,所以我尝试了一些东西,并在我的依赖管理节点中指定了最新版本的 hibernate-core 解决了我的问题。

    我不知道为什么。我只能假设 hibernate-core:4.1.1 的两个副本造成了某种歧义,即使我的外部 Maven/Tomcat 可以理解,m2eclipse 或 WTP 也无法理解。我非常感谢任何人可能拥有的任何解释或更好的修复。谢谢。

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

    【讨论】:

    • 4.1.2.Final 也解决了这个问题,并且在从 4.1.1.Final 迁移时不太可能中断
    猜你喜欢
    • 2014-02-03
    • 1970-01-01
    • 1970-01-01
    • 2012-10-18
    • 1970-01-01
    • 2014-05-01
    • 1970-01-01
    • 2013-04-26
    • 1970-01-01
    相关资源
    最近更新 更多