You are not logged in.
I use fop as part of a build script for a project I'm working on. Today, I noticed that part of my build was not working. I figured that something must be wrong with the fop package I downloaded for use in the project, but then I noticed the same error is happening with fop as installed via pacman. The only thing I can think of that would have made a difference was the fairly recent jdk update. Searching for this paticular error brings up results from over the last few years, but none of them seem to have any resolution. They refer to it as a "warning," but it is definitely stopping execution of fop.
[winslow@COOLERMASTER ~]$ fop -h
/usr/bin/fop [script options] [FOP options]
Script Options:
--help, -h print this message and FOP help
--noconfig suppress sourcing of /etc/fop.conf,
$HOME/.fop/fop.conf, and $HOME/.foprc
configuration files
--execdebug print FOP exec line generated by this
launch script
Apr 18, 2015 12:14:07 AM org.apache.fop.fo.extensions.svg.SVGElementMapping initialize
SEVERE: Error while initializing the Batik SVG extensions
java.lang.NoClassDefFoundError: org/apache/batik/util/XMLResourceDescriptor
at org.apache.fop.fo.extensions.svg.SVGElementMapping.initialize(SVGElementMapping.java:83)
at org.apache.fop.fo.ElementMapping.getTable(ElementMapping.java:54)
at org.apache.fop.fo.ElementMappingRegistry.addElementMapping(ElementMappingRegistry.java:119)
at org.apache.fop.fo.ElementMappingRegistry.addElementMapping(ElementMappingRegistry.java:98)
at org.apache.fop.fo.ElementMappingRegistry.setupDefaultMappings(ElementMappingRegistry.java:79)
at org.apache.fop.fo.ElementMappingRegistry.<init>(ElementMappingRegistry.java:66)
at org.apache.fop.apps.FopFactory.<init>(FopFactory.java:166)
at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:190)
at org.apache.fop.cli.CommandLineOptions.<init>(CommandLineOptions.java:124)
at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:208)
Caused by: java.lang.ClassNotFoundException: org.apache.batik.util.XMLResourceDescriptor
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/batik/bridge/UserAgentAdapter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
at java.lang.Class.getConstructor0(Class.java:3075)
at java.lang.Class.newInstance(Class.java:412)
at org.apache.xmlgraphics.util.Service.providers(Service.java:85)
at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.discoverClasspathImplementations(ImageImplRegistry.java:119)
at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.<init>(ImageImplRegistry.java:79)
at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.<init>(ImageImplRegistry.java:88)
at org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry.getDefaultInstance(ImageImplRegistry.java:97)
at org.apache.xmlgraphics.image.loader.ImageManager.<init>(ImageManager.java:63)
at org.apache.fop.apps.FopFactory.<init>(FopFactory.java:178)
at org.apache.fop.apps.FopFactory.newInstance(FopFactory.java:190)
at org.apache.fop.cli.CommandLineOptions.<init>(CommandLineOptions.java:124)
at org.apache.fop.cli.Main.startFOP(Main.java:160)
at org.apache.fop.cli.Main.main(Main.java:208)
Caused by: java.lang.ClassNotFoundException: org.apache.batik.bridge.UserAgentAdapter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 27 more
I tried using both jdk7 and jdk8, but the result is the same.
[winslow@COOLERMASTER ~]$ archlinux-java status
Available Java environments:
java-7-openjdk
java-8-openjdk (default)
[winslow@COOLERMASTER ~]$ pacman -Qi fop java-batik jdk7-openjdk jdk8-openjdk
Name : fop
Version : 1.1-2
Description : XSL-FO implementation in Java.
Architecture : any
URL : http://xmlgraphics.apache.org/fop/
Licenses : APACHE
Groups : None
Provides : None
Depends On : java-xmlgraphics-commons java-commons-logging java-commons-io java-batik
java-avalon-framework
Optional Deps : None
Required By : None
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 3.42 MiB
Packager : Lukas Fleischer <archlinux@cryptocrack.de>
Build Date : Thu 03 Jul 2014 12:04:13 AM PDT
Install Date : Thu 03 Jul 2014 06:40:51 PM PDT
Install Reason : Explicitly installed
Install Script : No
Validated By : Signature
Name : java-batik
Version : 1.8-1
Description : SVG library for Java.
Architecture : any
URL : http://xmlgraphics.apache.org/batik/
Licenses : APACHE
Groups : None
Provides : None
Depends On : java-runtime java-commons-io java-commons-logging java-xmlgraphics-commons
Optional Deps : None
Required By : fop
Optional For : None
Conflicts With : None
Replaces : None
Installed Size : 9.86 MiB
Packager : Lukas Fleischer <archlinux@cryptocrack.de>
Build Date : Sat 04 Apr 2015 01:22:18 AM PDT
Install Date : Sat 18 Apr 2015 12:15:28 AM PDT ( I tried reinstalling this package, hence the date )
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Name : jdk7-openjdk
Version : 7.u79_2.5.5-1
Description : OpenJDK Java 7 development kit
Architecture : x86_64
URL : http://icedtea.classpath.org
Licenses : custom
Groups : None
Provides : java-environment=7 java-environment-openjdk=7
Depends On : java-environment-common jre7-openjdk=7.u79_2.5.5-1
Optional Deps : None
Required By : apache-ant eclipse intellij-idea-community-edition kdebindings-kross-java
maven netbeans pycharm-community
Optional For : libreoffice-still subversion texlive-latexextra
Conflicts With : None
Replaces : openjdk6 jdk7-openjdk-wm
Installed Size : 19.47 MiB
Packager : Guillaume ALAUX <guillaume@archlinux.org>
Build Date : Wed 15 Apr 2015 05:49:16 AM PDT
Install Date : Thu 16 Apr 2015 11:28:50 PM PDT
Install Reason : Installed as a dependency for another package
Install Script : Yes
Validated By : Signature
Name : jdk8-openjdk
Version : 8.u40-1
Description : OpenJDK Java 8 development kit
Architecture : x86_64
URL : http://openjdk.java.net/
Licenses : custom
Groups : None
Provides : java-environment=8 java-environment-openjdk=8
Depends On : java-environment-common jre8-openjdk=8.u40-1
Optional Deps : None
Required By : apache-ant eclipse intellij-idea-community-edition kdebindings-kross-java
maven netbeans pycharm-community
Optional For : libreoffice-still subversion texlive-latexextra
Conflicts With : None
Replaces : jdk8-openjdk-wm
Installed Size : 37.71 MiB
Packager : Guillaume ALAUX <guillaume@archlinux.org>
Build Date : Sun 15 Mar 2015 02:43:37 AM PDT
Install Date : Sun 15 Mar 2015 11:03:52 AM PDT
Install Reason : Explicitly installed
Install Script : Yes
Validated By : Signature
Offline
I ran into the same problem and had to roll java-batik back to 1.7-12.
Offline
Thought I would update this just in case anyone stumbles upon it.
With the latest version of fop and batik it almost worked out of the box. Just had to link xml-apis-ext.jar -> xml-apis-ext-1.3.04.jar in /usr/share/java/batik.
For reasons I don't know, they have started to include the version in the file names but not in /etc/fop.conf.
Offline