Announcement Announcement Module
Collapse
No announcement yet.
AspectJ plugin used for MongoDB cross-store results in code with serialization issues Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • AspectJ plugin used for MongoDB cross-store results in code with serialization issues

    This is a copy of a posting I made in the general Spring Data forum. Since I didn't get any responses there, I thought there may be more people in this forum that could help me out.

    I'm trying to use spring data with mongo-db cross-store functionality in wicket. NotSerializable errors occur in Apache Wicket because the aspectj maven plugin weaves member variables into my domain objects. What can I do to resolve this?

    I figure I need to either get the plugin to generate these variables as transient, or get apache wicket to somehow ignore those member variables. Anybody have any clues? Ideas?

    Here's a sample of a woven class that I've decompiled. Notice the fields marked as @Transient. These are great for JPA, but when trying to use this object in Wicket, horrible horrible serialization errors occur because classes such as ChangeSet are not serializable.


    Code:
    @Entity(name="com.xxxxx.tm.request.model.Client")
    @Table(name="tm_client")
    public class Client
      implements Serializable, DocumentBacked
    {
      private static final long serialVersionUID = VersionUtil.getSerialVersionUID();
    
      @Id
      @GeneratedValue
      private int id;
    
      @Column(unique=true, length=255, nullable=false)
      private String name;
      private boolean active;
    
      @OneToMany(targetEntity=ClientInfoName.class, fetch=FetchType.LAZY, cascade={javax.persistence.CascadeType.ALL}, mappedBy="id.client")
      private Set<ClientInfoName> clientInfoNames;
    
      @Transient
      public ChangeSet ajc$interField$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$changeSet;
    
      @Transient
      public ChangeSetPersister ajc$interField$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdChangeSetPersister;
    
      @Transient
      public ChangeSetBackedTransactionSynchronization ajc$interField$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdTransactionSynchronization;
    
      public Client()
      {
        MongoDocumentBacking.ajc$interFieldInit$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$changeSet(this); MongoDocumentBacking.ajc$interFieldInit$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdChangeSetPersister(this); MongoDocumentBacking.ajc$interFieldInit$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdTransactionSynchronization(this); MongoDocumentBacking.aspectOf().ajc$before$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$2$adf21a1(this);
      }
    
      public Client(String name)
      {
        MongoDocumentBacking.ajc$interFieldInit$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$changeSet(this); MongoDocumentBacking.ajc$interFieldInit$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdChangeSetPersister(this); MongoDocumentBacking.ajc$interFieldInit$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdTransactionSynchronization(this); MongoDocumentBacking.aspectOf().ajc$before$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$2$adf21a1(this);
    
        this.name = name;
      }
    
      public int getId()
      {
        return this.id;
      }
    
      public void setId(int id)
      {
        this.id = id;
      }
    
      public String getName()
      {
        return this.name;
      }
    
      public void setName(String name)
      {
        this.name = name;
      }
    
      public boolean isActive()
      {
        return this.active;
      }
    
      public void setActive(boolean active)
      {
        this.active = active;
      }
    
      public Set<ClientInfoName> getClientInfoNames()
      {
        if (this.clientInfoNames == null)
        {
          this.clientInfoNames = new HashSet();
        }
    
        return this.clientInfoNames;
      }
    
      public void setClientInfoNames(Set<ClientInfoName> clientInfoNames)
      {
        this.clientInfoNames = clientInfoNames;
      }
    
      public String toString()
      {
        return ToStringBuilder.reflectionToString(this);
      }
    
      public int hashCode()
      {
        return new HashCodeBuilder(1, 31).append(getId()).toHashCode();
      }
    
      public boolean equals(Object obj)
      {
        if ((obj != null) && (obj instanceof Client))
        {
          if (obj == this)
          {
            return true;
          }
    
          Client client = (Client)obj;
    
          return new EqualsBuilder().append(getId(), 
            client.getId()).isEquals();
        }
    
        return false;
      }
    
      public void flush()
      {
        MongoDocumentBacking.ajc$interMethod$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$flush(this); } 
      public ChangeSet getChangeSet() { return MongoDocumentBacking.ajc$interMethod$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$getChangeSet(this); } 
      public Object get_persistent_id() { return MongoDocumentBacking.ajc$interMethod$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$get_persistent_id(this); } 
      @PostLoad
      public void itdPostLoad() { MongoDocumentBacking.ajc$interMethod$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdPostLoad(this); } 
      @PostPersist
      public void itdPostPersist() { MongoDocumentBacking.ajc$interMethod$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdPostPersist(this); } 
      @PostRemove
      public void itdPostRemove() { MongoDocumentBacking.ajc$interMethod$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdPostRemove(this); } 
      @PostUpdate
      public void itdPostUpdate() { MongoDocumentBacking.ajc$interMethod$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdPostUpdate(this); } 
      @PreUpdate
      public void itdPreUpdate() { MongoDocumentBacking.ajc$interMethod$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$itdPreUpdate(this); } 
      public void setChangeSet(ChangeSet paramChangeSet) { MongoDocumentBacking.ajc$interMethod$org_springframework_data_mongodb_crossstore_MongoDocumentBacking$org_springframework_data_mongodb_crossstore_DocumentBacked$setChangeSet(this, paramChangeSet); }
    
    }
Working...
X