Closed mukoki closed 3 years ago
Excluding fop (and sub-dependency xalan) from batik dependency seems to fix the problem. Anyway, we should document why we stick to 1.6 version of batik which is very old. Alternatives could be : 1/a newer version of batik, 2/ a lighter library like jfreesvg
is it possible that this "only" occured in your IDE? the packaging didn't change after your patch. how did you retrieve the stack? just tested with OpenJUMP-20210520-r4890(c393bdc)-PLUS (the commit before your fix) and save as SVG works fine (File->Save View->Image->SVG)
let me fix the pom to add only the batik jars and dependencies we actually pack to PLUS see https://github.com/openjump-gis/openjump/blob/d3a7cdeda2729857161ccae470f7bbeace0b8881/etc/mvn/cmp_plus.xml#L11-L19
also please post complete stacks, just in case.
finally - file search reveals batikis merely used in in "BitmapVertexStyle.java", "SaveImageAsSVGPlugIn.java", "AdditionalResultsIO.java". if we fix those references to use recent batik or another dependency we're set :)
This is possible that it only happens in my IDE. I noticed that the error comes from a xalan library which is located in my local .m2 repository. Also this is exactly the same xalan library which is referenced in the pom (transitive) dependencies described by my maven plugin. I did not pay attention that this library is excluded from the distribution in cmp_plus. Is there any reason to filter dependencies there rather than in the main maven. I suppose it maybe useful when we want different distro include a different set of dependencies.
check https://github.com/openjump-gis/openjump/commit/b0eaa5c4fae1cf087e0865a9f97701e01e027160 as to why the bug happens. essentially jre is preferring a provided Xalan over the built in one but older Xalans unfortunately are buggy. hence your evaluation was totally on point :)
additionally limited batik and it's transitive imports now.
please test and close this ticket if all is as expected!
Fixed
The plugin can't save a raster anymore. Ends with
javax.xml.transform.TransformerException: java.io.FileNotFoundException: file:\D:\TMP\test.tif.aux.xml (La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte) at org.apache.xalan.transformer.TransformerIdentityImpl.createResultContentHandler(TransformerIdentityImpl.java:263) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:296) at org.openjump.core.rasterimage.GDALPamDataset.writeStatistics(GDALPamDataset.java:137) at org.openjump.core.rasterimage.TiffUtilsV2.createStatsXml(TiffUtilsV2.java:566)
Maybe related to an old version of xalan library