Show Table of Contents
4.2.4. 在以前的安装里查找 JAR
如果在服务器定义的模块里的 JAR 中没有找到这个类,请到 EAP5_HOME 版本或之前服务器的
lib/ 目录里查找这个 JAR。
例如,如果您在日志里看到
ClassNotFoundException跟踪信息:
Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/ClassValidator at java.lang.Class.getDeclaredMethods0(Native Method)通过下列步骤来查找包含这个类的 JAR:
- 打开一个终端窗口并进入
EAP5_HOME/目录。 - 执行这个命令:
grep 'org.hibernate.validator.ClassValidator' `find . \-name '*.jar'` - 您可能会看到多个结果。在这个例子里,下面的结果就是我们需要的 JAR:
Binary file ./jboss-eap-5.1/seam/lib/hibernate-validator.jar matches
- 将这个 JAR 复制到
lib/目录。如果您发现您需要大量的 JAR,为这些类定义一个模块可能更加便利。关于更多的信息,请参考 https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/ 上的《JBoss EAP 6 部署指南》里的『开发企业级应用程序起步』章节中的『模块』 。 - 重建和重部署这个应用程序。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.