User:Melancholie/Java/Batik

From OpenStreetMap Wiki
Jump to navigation Jump to search

Using Debian:

With version 1.6:

! You have a broken version (1.6) of your rasterizer. Problems with black tiles reported
[#1   0% tile-z13] Splitting stripe 0... SplitTiles: Black Tile encountered at lib/Tileset.pm line 1372.

With version 1.7:
See also: https://bugs.launchpad.net/ubuntu/+source/batik/+bug/314051 (should be fixed, but isn't for me (everything current))

[#1   0% captionless-z12] Rasterizing failed with runtime exception: Error running "/usr/bin/java": exited with value 1 at lib/SVG/Rasterize/Engine/Batik.pm line 339.                                                                                                                        
                                                                                                                                               
Rasterize command: "/usr/bin/java", "-Xms256M", "-Xmx256M", "-classpath", "/usr/share/java/xercesImpl.jar:/usr/share/java/batik.jar", "org.apache.batik.apps.rasterizer.Main", "-scriptSecurityOff", "-w", "256", "-h", "256", "-a", "0.000000,0.000000,878.906250,878.906250", "-d", "/tmp/12_3169_1711_UEOV0/captionless-z12-s0.png", "/tmp/12_3169_1711_UEOV0/captionless-z12.svg"                                                        
Rasterize engine STDOUT:About to transcode 1 SVG file(s)                                                                                       

Converting captionless-z12.svg to /tmp/12_3169_1711_UEOV0/captionless-z12-s0.png ... 
Rasterize engine STDERR:Exception in thread "main" java.lang.NoClassDefFoundError: org/w3c/dom/svg/SVGDocument
        at java.lang.ClassLoader.defineClass1(Native Method)                                                  
        at java.lang.ClassLoader.defineClass(ClassLoader.java:637)                                            
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:277)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
        at org.apache.batik.dom.svg.SVGDOMImplementation.createDocument(Unknown Source)
        at org.apache.batik.dom.util.SAXDocumentFactory.startElement(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
        at org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
        at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown Source)
        at org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown Source)
        at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
        at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
        at org.apache.batik.apps.rasterizer.SVGConverter.transcode(Unknown Source)
        at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown Source)
        at org.apache.batik.apps.rasterizer.Main.execute(Unknown Source)
        at org.apache.batik.apps.rasterizer.Main.main(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.w3c.dom.svg.SVGDocument
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
        ... 34 more

Exception in RenderSVG: Error running "/usr/bin/java": exited with value 1 at lib/SVG/Rasterize/Engine/Batik.pm line 339.
  • Downloaded all kind of jar files using findjar.com & Google, put them into /usr/share/java & ~/lib/SVG/Rasterize/Engine/Batik and linked them in /usr/bin/rasterizer, with no success, first :-(
[#1   0% captionless-z12] Rasterizing failed with runtime exception: Error running "/usr/bin/java": exited with value 1 at lib/SVG/Rasterize/Engine/Batik.pm line 339.

Rasterize command: "/usr/bin/java", "-Xms256M", "-Xmx256M", "-classpath", "/usr/share/java/xercesImpl.jar:/usr/share/java/batik.jar", "org.apache.batik.apps.rasterizer.Main", "-scriptSecurityOff", "-w", "256", "-h", "256", "-a", "0.000000,0.000000,878.906250,878.906250", "-d", "/tmp/12_3169_1711_Dg85a/captionless-z12-s0.png", "/tmp/12_3169_1711_Dg85a/captionless-z12.svg"
Rasterize engine STDERR:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/batik/apps/rasterizer/Main
Caused by: java.lang.ClassNotFoundException: org.apache.batik.apps.rasterizer.Main
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:336)
Could not find the main class: org.apache.batik.apps.rasterizer.Main. Program will exit.

Exception in RenderSVG: Error running "/usr/bin/java": exited with value 1 at lib/SVG/Rasterize/Engine/Batik.pm line 339.
    $self->jar_list([
        'xercesImpl.jar',
        'xml-apis-ext-1.3.04.jar', # <== added!
        'batik.jar'
        ]);

=> ... and now it works! :-) The only problem is that svn update will fail for Batik.pm, so it would have to be updated manually :-(