java.lang.NoClassDefFoundError: com/itextpdf/text/DocumentException

The previous answer told you that a jar was missing, which was not a bad guess because the error message clearly says one of the iText classes couldn't be found.

Unfortunately, that error message is misleading. Java also says it can't find a class if there's any ambiguity. This is the case if you have more than one iText jar in your CLASSPATH.

You've made the problem worse by adding yet another iText jar to your CLASSPATH. Now you have a problem that is caused by having two different versions of iText available for the JVM in your weblogic instance.

Search all the CLASSPATHs, don't forget the server CLASSPATH, and you'll discover that D:\itextpdf-5.3.4.jar isn't the only place where weblogic goes looking for the PdfWriter class. Remove all iText jars from your CLASSPATH until you have only one left.


You need to put in the classpath of your web application and not your systems classpath.

And the easiest way to put the jar files on the classpath so that your server can get it at run time is :

PUT THE itextpdf-5.3.4.jar inside the

YOUR_WEBAPP_ROOT --> WEB-INF --> lib folder

so now your jar file should appear here

YOUR_WEBAPP_ROOT --> WEB-INF --> lib --> itextpdf-5.3.4.jar


Add your libraries to your war, inside WEB-INF/lib folder.