title: Exception in thread "main" javax.ejb.EJBException: java.io.StreamCorruptedException: Unexpected byte found when reading an object
body: <p>i have this class:</p>
  
  <pre><code>@Entity
  @Table(name="T_picture")
  
  public class Picture implements Serializable {
  
  
      private Integer idPicture;
      private String link;
      private Product product;
      private static final long serialVersionUID = 1L;....................}
  </code></pre>
  
  <p>i need to show the picture's list by product So, i have this method</p>
  
  <pre><code> @Override  public List&lt;Picture&gt; findByProduct(Product p) {         
      return 
      em.createQuery("select p from Picture p where
      s.product=:x",Picture.class).
                   setParameter("x",p)
                       .getResultList();  
   }
  </code></pre>
  
  <p>So when i run , i get this exception</p>
  
  <blockquote>
    <p>Exception in thread "main" javax.ejb.EJBException:
        java.io.StreamCorruptedException: Unexpected byte found when reading
        an object: 254    at
        org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:236
          at
         org.jboss.ejb.client.EJBInvocationHandler.doInvoke(EJBInvocationHandler.java:181</p>
  </blockquote>