title: How to enable weaving in EclipseLink?
body: <p>I receive the following warning on the GlassFish terminal while deploying an application that has lazy fetching in entities,</p>
  
  <blockquote>
    <p>WARNING:   Reverting the lazy setting on the <code>OneToOne</code> or <code>ManyToOne</code>
    attribute <code>[zoneTable]</code> for the entity class <code>[class entity.ZoneCharge]</code>
    since weaving was not enabled or did not occur.</p>
  </blockquote>
  
  <p>for whatever entities are listed in the project.</p>
  
  <p>My <code>persistence.xml</code> file looks something like the following.</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="2.0" 
               xmlns="http://java.sun.com/xml/ns/persistence"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://java.sun.com/xml/ns/persistence"
               http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"&gt;
  
      &lt;persistence-unit name="Project-ejbPU" transaction-type="JTA"&gt;
          &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
          &lt;jta-data-source&gt;jdbc/pool&lt;/jta-data-source&gt;
  
          &lt;class&gt;entity.ZoneTable&lt;/class&gt;
          &lt;!--Other classes--&gt;
          &lt;exclude-unlisted-classes&gt;false&lt;/exclude-unlisted-classes&gt;
  
          &lt;properties&gt;
              &lt;property name="eclipselink.weaving" value="static"/&gt;
              &lt;property name="eclipselink.target-server" value="SunAS9"/&gt;
              &lt;property name="eclipselink.logging.parameters" value="true"/&gt;
              &lt;property name="eclipselink.logging.level.sql" value="FINEST"/&gt;
              &lt;property name="eclipselink.logging.level" value="FINEST" /&gt;
              &lt;property name="eclipselink.logging.level" value="WARNING"/&gt;
              &lt;property name="eclipselink.logging.level.cache" value="FINEST"/&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>The <code>ZoneTable</code> class looks like,</p>
  
  <pre><code>@Entity
  @Table(name = "zone_table", catalog = "projectdb", schema = "")
  public class ZoneTable implements Serializable {
  
      private static final long serialVersionUID = 1L;
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "zone_id")
      private Long zoneId;
  
      @Column(name = "zone_name")
      private String zoneName;
  
      @OneToMany(mappedBy = "zoneTable", fetch = FetchType.LAZY)
      private Set&lt;ZoneCharge&gt; zoneChargeSet;
  
      //Setters and getters.
  }
  </code></pre>
  
  <p>Here lazy fetching works even with remote EJBs but I think, it is considered eager because of the above warning.</p>
  
  <p>How to enable weaving (or some other way) to avoid this warning?</p>
  
  <p>When I enter this command as mentioned <a href="http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Advanced_JPA_Development/Performance/Weaving/Static_Weaving#Table_19-32" rel="nofollow">here</a>,</p>
  
  <pre><code>java org.eclipse.persistence.tools.weaving.jpa.StaticWeave
  </code></pre>
  
  <p>on the command line, I get the following error.</p>
  
  <blockquote>
    <p>Error: could not find or load main classorg.eclipse.persistence.tools.weaving.jpa.StaticWeave</p>
  </blockquote>
  
  <p>What are the ways to overcome this warning?</p>