Note that there are some explanatory texts on larger screens.

plurals
  1. POEntity is not weaved. Eclipselink 2.1 + Dynamic Weaving
    primarykey
    data
    text
    <p>I have a Java EE application that is running on tomcat with a couple of entity classes and using eclipselink 2.1 and jpa 2.0. The entities are EmailNotification and EmailNotificationQueueRow.</p> <pre><code>@Entity public class EmailNotification implements Serializable, IEntity&lt;Integer&gt; { private static final long serialVersionUID = 1L; @Id @GeneratedValue(strategy = GenerationType.AUTO, generator = "emailGen") @SequenceGenerator(name = "emailGen", sequenceName = "SQ_EMAIL_NOTIFICATIONS", allocationSize=1) @Basic(optional = false) @Column(name = "EMAIL_ID") private Integer emailId; @Basic(optional = false) @Column(name = "EMAIL_SUBJECT") private String emailSubject; @Basic(optional = false) @Column(name = "EMAIL_BODY") private String emailBody; @Basic(optional = false) @Column(name = "SENT_FROM_EMAIL_ADDRESS") private String sentFromEmailAddress; @Column(name = "SEND_TO_ORG_ID") private Integer sendToOrgId; @Column(name = "SEND_TO_EMAIL_ADDRESS") private String sendToEmailAddress; @Column(name = "CARBON_COPY_ORG_ID") private Integer carbonCopyOrgId; @Column(name = "CARBON_COPY_EMAIL_ADDRESS") private String carbonCopyEmailAddress; @Column(name = "BCC_ORG_ID") private Integer bccOrgId; @Column(name = "BCC_EMAIL_ADDRESS") private String bccEmailAddress; @Column(name = "PROJECT_ID") private Integer projectId; //getters and setters } </code></pre> <hr> <pre><code>@Entity public class EmailNotificationQueueRow implements Serializable, IEntity&lt;Integer&gt; { private static final long serialVersionUID = 1L; @Id @Basic(optional = false) @Column(name = "EMAIL_QUEUE_ID") private Integer emailQueueId; @Basic(optional = false) @Column(name = "EMAIL_ID") private int emailId; @Basic(optional = false) @Column(name = "REQUEST_DATE") @Temporal(TemporalType.TIMESTAMP) private Date requestDate; @Basic(optional = false) @Column(name = "MESSAGE_SENT_FLAG") private String messageSentFlag; @Column(name = "MESSAGE_SENT_DATE") @Temporal(TemporalType.TIMESTAMP) private Date messageSentDate; @JoinColumn(name = "EMAIL_ID", referencedColumnName = "EMAIL_ID", updatable = false, insertable = false) @OneToOne(fetch = FetchType.LAZY) private EmailNotification emailNotification; //getters and setters } </code></pre> <p>Whenever I set the relationship of the emailNotification variable to FetchType.LAZY (as above) the class is not woven. It is registered for weaving but never is. </p> <p>The log is below. The EmailNotification entity is weaved but not the EmailNotificationQueueRow entity. Any ideas?</p> <pre><code>[EL Config]: 2011-02-15 14:21:13.642--ServerSession(1191324)--Thread(Thread[main,5,main]) --The access type for the persistent class [class persistence.model.EmailNotification] is set to [FIELD]. [EL Config]: 2011-02-15 14:21:13.674--ServerSession(1191324)--Thread(Thread[main,5,main]) --The access type for the persistent class [class persistence.model.EmailNotificationQueueRow] is set to [FIELD]. [EL Config]: 2011-02-15 14:21:13.674--ServerSession(1191324)--Thread(Thread[main,5,main]) --The target entity (reference) class for the one to one mapping element [field emailNotification] is being defaulted to: class persistence.model.EmailNotification. [EL Config]: 2011-02-15 14:21:13.689--ServerSession(1191324)--Thread(Thread[main,5,main]) --The alias name for the entity class [class persistence.model.EmailNotification] is being defaulted to: EmailNotification. [EL Config]: 2011-02-15 14:21:13.72--ServerSession(1191324)--Thread(Thread[main,5,main]) --The alias name for the entity class [class persistence.model.EmailNotificationQueueRow] is being defaulted to: EmailNotificationQueueRow. [EL Finer]: 2011-02-15 14:21:13.736--ServerSession(1191324)--Thread(Thread[main,5,main]) --Class [persistence.model.EmailNotification] registered to be processed by weaver. [EL Finer]: 2011-02-15 14:21:13.799--ServerSession(1191324)--Thread(Thread[main,5,main]) --Class [persistence.model.EmailNotificationQueueRow] registered to be processed by weaver. [EL Finest]: 2011-02-15 14:21:13.799--ServerSession(1191324)--Thread(Thread[main,5,main]) --End predeploying Persistence Unit iDMS_Persistence_Unit; session file:/C:/idms/build/web/WEB-INF/classes/_iDMS_Persistence_Unit; state Predeployed; factoryCount 1 [EL Finest]: 2011-02-15 14:21:13.908--ServerSession(1191324)--Thread(Thread[main,5,main]) --Begin weaver class transformer processing class [persistence/model/EmailNotification]. [EL Finest]: 2011-02-15 14:21:13.924--ServerSession(1191324)--Thread(Thread[main,5,main]) --Weaved persistence (PersistenceEntity) [persistence/model/EmailNotification]. [EL Finest]: 2011-02-15 14:21:13.924--ServerSession(1191324)--Thread(Thread[main,5,main]) --Weaved change tracking (ChangeTracker) [persistence/model/EmailNotification]. [EL Finest]: 2011-02-15 14:21:13.986--ServerSession(1191324)--Thread(Thread[main,5,main]) --Weaved fetch groups (FetchGroupTracker) [persistence/model/EmailNotification]. [EL Finest]: 2011-02-15 14:21:13.986--ServerSession(1191324)--Thread(Thread[main,5,main]) --End weaver class transformer processing class [persistence/model/EmailNotification]. </code></pre> <p>persistence.xml</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;persistence version="1.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_1_0.xsd"&gt; &lt;persistence-unit name="iDMS_Persistence_Unit" transaction-type="JTA"&gt; &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt; &lt;jta-data-source&gt;jdbc/dms&lt;/jta-data-source&gt; &lt;class&gt;persistence.model.EmailNotification&lt;/class&gt; &lt;class&gt;persistence.model.EmailNotificationQueueRow&lt;/class&gt; &lt;exclude-unlisted-classes&gt;true&lt;/exclude-unlisted-classes&gt; &lt;properties&gt; &lt;property name="eclipselink.weaving" value="true"/&gt; &lt;property name="eclipselink.cache.shared.default" value="false"/&gt; &lt;property name="eclipselink.logging.level" value="FINEST"/&gt; &lt;/properties&gt; &lt;/persistence-unit&gt; &lt;/persistence&gt; </code></pre> <p><strong>Update</strong></p> <p>I am using the eclipselink javaagent string to start up tomcat. Also there are other OneToOne mappings that are lazy loaded in my project that get weaved. Its only this one class (EmailNotificationQueueRow) that doesn't get weaved.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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