title: Display database blob images in <p:graphicImage> inside <ui:repeat>
body: <p>I'm using PrimeFaces 3.2 on JBoss 7.1.1.</p>
  
  <p>I am trying to display an image which is stored in a BLOB in a MySQL database in <code>&lt;ui:repeat&gt;</code>. The image is stored in a <code>byte[]</code> and then converted to a <code>StreamedContent</code> as follows:</p>
  
  <pre><code>InputStream stream = new ByteArrayInputStream(ingredient.getImage());
  ingredient.setJsfImage(new DefaultStreamedContent(stream, "image/jpg"));
  </code></pre>
  
  <p>Then I am trying to display it in a Facelet as follows:</p>
  
  <pre><code>&lt;ui:repeat var="ingredient" value="#{formBean.ingredientResultSet}"&gt;
      &lt;p:panel id="resultsPanel" header="#{ingredient.location.shopName}"&gt;
          &lt;p:graphicImage value="#{ingredient.jsfImage}" alt="No picture set" /&gt;
  ...
  </code></pre>
  
  <p>However, when loading the page, I get the following error in JBoss:</p>
  
  <blockquote>
    <p>SEVERE [org.primefaces.application.PrimeResourceHandler] (http--127.0.0.1-8080-12) Error in streaming dynamic resource.</p>
  </blockquote>
  
  <p>How is this caused and how can I solve it?</p>