title: How to instantiate the LAZY relationship prior to serialization?
body: <p>I have just created and joined 3 new tables. Before creating them everything was working fine so I do believe the root cause is coming from their creation. Now when runned in the browser I receive this error: </p>
  
  <blockquote>
    <p><strong>org.apache.jasper.JasperException: Exception</strong> [EclipseLink-7242]
    (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd):
    <strong>org.eclipse.persistence.exceptions.ValidationException
        Exception Description:</strong> An attempt was made to traverse a relationship using indirection that had a null Session.  This often
    occurs when an entity with an uninstantiated LAZY relationship is
    serialized and that lazy relationship is traversed after
    serialization.  To avoid this issue, instantiate the LAZY relationship
    prior to serialization.</p>
  </blockquote>
  
  <p>How does one instantiate the LAZY relationship prior to serialization anyway? I've been looking all over the web but I still haven't found real working solutions...</p>
  
  <p>I also receive this other error message:</p>
  
  <blockquote>
    <p><strong>Exception [EclipseLink-4002] (Eclipse Persistence Services -
    2.5.2.v20140319-9ad6abd):</strong> org.eclipse.persistence.exceptions.DatabaseException </p>
    
    <p><strong>Internal Exception:</strong> com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:
    Unknown column 't1.rating' in 'field list' Error Code: 1054 Call:
    SELECT t1.id, t1.description, t1.last_update, t1.name, t1.price,
    t1.rating FROM category_has_product t0, product t1 WHERE
    ((t0.category_id = ?) AND (t1.id = t0.product_id))    bind => [1
    parameter bound] Query: ReadAllQuery(name="productCollection"
    referenceClass=Product sql="SELECT t1.id, t1.description,
    t1.last_update, t1.name, t1.price, t1.rating FROM category_has_product
    t0, product t1 WHERE ((t0.category_id = ?) AND (t1.id =
    t0.product_id))")</p>
    
    <p><strong>root cause</strong></p>
    
    <p>com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown
    column 't1.rating' in 'field list'</p>
  </blockquote>
  
  <p>What do all those errors mean? I don't understand because all the columns and the rows are perfectly well mapped... It says it canno't find certain columns... I have checked all my tables over and over and I really don't understand what could possibly be wrong... Everything seems fine... A little help would be very much appreciated! Thanks</p>
  
  <p>Besides I use the following for the app:
  Netbeans
  Glassfish
  Mysql
  Most pages in jsp</p>