Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In a headless linux environment svg fails #181

Open
bonron opened this issue Feb 12, 2020 · 2 comments
Open

In a headless linux environment svg fails #181

bonron opened this issue Feb 12, 2020 · 2 comments

Comments

@bonron
Copy link

bonron commented Feb 12, 2020

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
Copy link
Author

bonron commented Feb 12, 2020

This is likely related to issue #145

@eseifert
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants