Reputation: 237
I am new to java and fo trying to convert a fo file to pdf I copied java from this link, but I am getting the error below:
Transforming... log4j:WARN No appenders could be found for logger (org.apache.fop.util.ContentHandlerFactoryRegistry). log4j:WARN Please initialize the log4j system properly. Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/avalon/framework/configuration/ConfigurationException at org.apache.fop.apps.FopFactory.(FopFactory.java:165) at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:190) at fop.ExampleFO2PDF.(ExampleFO2PDF.java:73) at fop.ExampleFO2PDF.main(ExampleFO2PDF.java:156) Caused by: java.lang.ClassNotFoundException: org.apache.avalon.framework.configuration.ConfigurationException at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 4 more
Upvotes: 0
Views: 1669
Reputation: 57159
You are trying to embed FOP. But you have not added Avalon to the classpath (as some have already suggested), or you have the wrong version. See also:
fop-0.95 doesn't work with avalon-framework-4.3.3. Fop 1.x has been fixed in the meantime to work with avalon-framework, but it has another critical bug that prevents the creation of pdf files.
Bottom line of all these threads (and many more) is: the (correct) Avalon is not found. Fix that, and you should solve your issue.
Upvotes: 0