4.2.4. Find the JAR in the Previous Install
If the class is not found in a JAR packaged in a module defined by the server, find the JAR in your EAP5_HOME install or your prior server's
lib/
directory.
For example, if you see this
ClassNotFoundException
trace in the log:
Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/ClassValidator at java.lang.Class.getDeclaredMethods0(Native Method)Find the JAR containing this class by doing the following:
- Open a terminal and navigate to the
EAP5_HOME/
directory. - Issue the command:
grep 'org.hibernate.validator.ClassValidator' `find . \-name '*.jar'`
- You might see more than one result. In this case, the following result is the JAR we need:
Binary file ./jboss-eap-5.1/seam/lib/hibernate-validator.jar matches
- Copy this JAR to the application's
lib/
directory.If you find that you need a large number of JARs, it may be easier to define a module for the classes. For more information, refer to Modules in the chapter entitled Get Started Developing Applications in the Development Guide for JBoss EAP 6 on https://access.redhat.com/site/documentation/JBoss_Enterprise_Application_Platform/. - Rebuild and redeploy the application.