Note that there are some explanatory texts on larger screens.

plurals
  1. POStreaming video with Jersey
    text
    copied!<p>i'm currently trying to stream a video file over Jersey REST service and get a mysterious exception on returning the response:</p> <pre><code>ERROR WebApplicationImpl - The RuntimeException could not be mapped to a response, re-throwing to the HTTP container java.lang.NullPointerException at com.sun.jersey.core.util.KeyComparatorHashMap$Entry.hashCode(KeyComparatorHashMap.java:735) at java.util.HashMap.getEntry(HashMap.java:344) at java.util.HashMap.containsKey(HashMap.java:335) at java.util.HashSet.contains(HashSet.java:184) at com.sun.jersey.server.linking.impl.RefProcessor.processLinks(RefProcessor.java:85) at com.sun.jersey.server.linking.impl.RefProcessor.processMember(RefProcessor.java:120) at com.sun.jersey.server.linking.impl.RefProcessor.processLinks(RefProcessor.java:113) at com.sun.jersey.server.linking.impl.RefProcessor.processMember(RefProcessor.java:120) at com.sun.jersey.server.linking.impl.RefProcessor.processLinks(RefProcessor.java:113) at com.sun.jersey.server.linking.impl.RefProcessor.processMember(RefProcessor.java:120) .... </code></pre> <p>The code creating the response looks like follows:</p> <pre><code>return Response.ok( new StreamingOutput( ) { @Override public void write( OutputStream output ) throws WebApplicationException { PrintWriter out = new PrintWriter( output ); out.println( "Foo" ); out.close( ); } }, MediaType.MULTIPART_FORM_DATA ).build( ); </code></pre> <p>(I already deleted additional range headers and stuff). I have several breakpoints in the StreamingOutput.write() method, but none seems to be reached. I have a second rest method returning the video as complete entity which works.</p> <p>So, has anybody an ideo what the exception means and what can i improve? Thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload