gral icon indicating copy to clipboard operation
gral copied to clipboard

In a headless linux environment svg fails

Open bonron opened this issue 6 years ago • 2 comments

An IllegalArgumentException is thrown with the following stack trace:

java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at de.erichseifert.gral.io.plots.DrawableWriterFactory.get(SourceFile:81) ...(My API stack)... Caused by: java.lang.IllegalArgumentException: Unsupported file format: image/svg+xml at de.erichseifert.gral.io.plots.VectorWriter.(SourceFile:132) ... 38 more java.lang.IllegalArgumentException: Unsupported MIME type: image/svg+xml at de.erichseifert.gral.io.plots.DrawableWriterFactory.get(SourceFile:104) ...(My API stack)...

the message from the Exception is :

Unsupported MIME type: image/svg+xml

To reproduce use a headless server or docker image (make sure it is actually headless)

This is how I used the writer (note that it works perfectly fine on windows): try { DrawableWriter writer = DrawableWriterFactory.getInstance().get("image/svg+xml"); writer.write(plot, outputStream, 1450, 538); } catch (IOException e) { e.printStackTrace(); }

bonron avatar Feb 12 '20 09:02 bonron

This is likely related to issue https://github.com/eseifert/gral/issues/145

bonron avatar Feb 12 '20 09:02 bonron

Thanks for reporting this. I’ll have a look into it as soon as I can.

eseifert avatar Feb 12 '20 10:02 eseifert