It's all about the answers!

Ask a question

download artifact of type image using java??


vidyadhar Bhutaki (112) | asked Sep 16 '16, 7:32 a.m.
edited Sep 17 '16, 4:20 a.m.
Hello,
i have a module in rm, which has many artifacts. one of the artifact is a image and i want to download the image to my local using java.
assuming that i have the artifact url with me could any one please share on how i can download artifact which is an image.

or if i have an URL of the resource(jpg file here), how can i download it??
when tried to get it via getresource as Bufferedimage i get following error;

java.lang.RuntimeException: A javax.ws.rs.ext.MessageBodyReader implementation was not found for class java.awt.image.BufferedImage type and image/jpeg;charset=UTF-8 media type.  Verify that all entity providers are correctly registered.  Add a custom javax.ws.rs.ext.MessageBodyReader provider to handle the type and media type if a JAX-RS entity provider does not currently exist.

if i try directly using url.openConnection() i get authorization error.

please help

One answer



permanent link
haseeb alam (91) | answered Dec 06 '23, 6:41 a.m.
How can I resolve the 'avax.ws.rs.ext.MessageBodyReader error when trying to download an image artifact using Java from a module in RM? I've encountered this issue while attempting to use 'getresource' for a JPEG file, resulting in the mentioned runtime exception. Additionally, when using url.openConnection(), I'm facing an authorization error. 
Any insights on resolving these challenges would be appreciated.

Thanks!

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.