Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoClassDefFoundError: org/apache/avalon/framework/configuration/ConfigurationException

In my code, I use fop.jar to read pdf file but I get error from log file:

EXCEPTION]
java.lang.NoClassDefFoundError: org/apache/avalon/framework/configuration/ConfigurationException
at GetPagePdf.<init>(GetPayStubPdf.java:36)

in my code line 36:

private FopFactory fopFactory = FopFactory.newInstance();

I research on website, they answer I miss avalonframework.jar but i don't know how to use jar file. Please help me to give some ideas.

like image 846
Phạm Quốc Bảo Avatar asked Jul 15 '26 06:07

Phạm Quốc Bảo


1 Answers

The Formatting Object project (fop.jar) has dependencies that must also be placed into your classpath. The class that is throwing the NoClassDefFoundError is part of the avalon-framework-api.jar and avalon-framework-impl.jar.

The dependencies as I know of them if you are using fop version 2.1

  1. avalon-framework-api 4.3.1
  2. avalon-framework-impl 4.3.1
  3. batik-anim 1.8
  4. batik-awt-util 1.8
  5. batik-bridge 1.8
  6. batik-css 1.8
  7. batik-dom 1.8
  8. batik-ext 1.8
  9. batik-extension 1.8
  10. batik-gvt 1.8
  11. batik-parser 1.8
  12. batik-script 1.8
  13. batik-svg-dom 1.8
  14. batik-svggen 1.8
  15. batik-transcoder 1.8
  16. batik-util 1.8
  17. batik-xml 1.8
  18. commons-io 2.5
  19. commons-logging 1.0.4
  20. xalan 2.7.0
  21. xml-apis 1.0.b2
  22. xml-apis-ext 1.3.04
  23. xmlgraphics-commons 2.1

If you find all of these then put them into your classpath then you should be able to run FOP.

like image 131
JRSofty Avatar answered Jul 17 '26 17:07

JRSofty



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!