by Eabin 26 Mar 00:21
NPE when using transient Lists

Hey Rob,

i just tested 0.9.6, but it throws a NPE:
Caused by: javax.persistence.PersistenceException: Can not find descriptor [null] for tk.eabin.event.Event.doParticipants
at com.avaje.ebean.server.deploy.BeanDescriptorFactory.getTargetDescriptor(BeanDescriptorFactory.java:247)
at com.avaje.ebean.server.deploy.BeanDescriptorFactory.checkMappedBy(BeanDescriptorFactory.java:408)
at com.avaje.ebean.server.deploy.BeanDescriptorFactory.checkMappedBy(BeanDescriptorFactory.java:233)
at com.avaje.ebean.server.deploy.BeanDescriptorFactory.deriveCircularInfo(BeanDescriptorFactory.java:216)
at com.avaje.ebean.server.deploy.BeanDescriptorFactory.createDescriptor(BeanDescriptorFactory.java:196)
at com.avaje.ebean.server.deploy.BeanDescriptorCacheFactory.deployBeanDescriptors(BeanDescriptorCacheFactory.java:212)
at com.avaje.ebean.server.deploy.BeanDescriptorCacheFactory.initialiseAll(BeanDescriptorCacheFactory.java:121)
at com.avaje.ebean.server.deploy.DeploymentManager.<init>(DeploymentManager.java:89)
at com.avaje.ebean.server.plugin.PluginCore.<init>(PluginCore.java:35)
at com.avaje.ebean.server.plugin.PluginFactory.createPluginCore(PluginFactory.java:72)
at com.avaje.ebean.server.plugin.PluginFactory.create(PluginFactory.java:55)
at com.avaje.ebean.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:112)
at com.avaje.ebean.server.core.DefaultServerFactory.createServer(DefaultServerFactory.java:1)
at com.avaje.ebean.Ebean$ServerManager.getWithCreate(Ebean.java:213)
at com.avaje.ebean.Ebean$ServerManager.get(Ebean.java:200)
at com.avaje.ebean.Ebean$ServerManager.access$1(Ebean.java:190)
at com.avaje.ebean.Ebean.<clinit>(Ebean.java:116)
... 55 more


the object in question does have a List of objects of another Entity, and a getter for that list - but the List is @Transient:

public class Event implements EditableObject {
@Id
private Long id;
@Column(name="startdate")
private UnixTimestamp startDate;
@Column(name="enddate")
private UnixTimestamp endDate;
@Column(name="cdate")
private UnixTimestamp creationDate;
@ManyToOne
@JoinColumn(name="creator_id")
private User creator;
@Column(name="minpeople")
private int minPeople = 1;
private String comment;
@ManyToOne
@JoinColumn(name="category_id")
private Category category;
@ManyToOne
@JoinColumn(name="location_id")
private Location location;
private boolean canceled = false;
private String reason;
private boolean deleted = false;
@OneToMany
@OrderBy("cdate")
private List<Comment> comments;
@Transient
private List<Participant> doParticipants;
@Transient
private List<Participant> nonParticipants;
@Transient
private List<Participant> maybeParticipants;
@OneToMany
private Set<Participant> participants;

@Transient
private boolean selected;

private transient final static Calendar calendar = Calendar.getInstance();
.
.
.
public List<Participant> getDoParticipants() {
splitParticipants();
return doParticipants;
}


--------------------------------------------------------------------

is this a regression? it worked fine with 0.9.3.

as always: thanks for your work,
regards, eabin

btw: i like the new login form. it actually works :)

26 Mar 07:01
by Rob

I'll have a look. Yeah, actually being able to log in - not a bad feature :)

26 Mar 07:35
by Rob

Yes its a regression :( Basically since 0.9.5 I have kept the transient properties because they where useful for SqlSelect. However, in doing so some code that previously assumed properties where all non-transient is broken. Hence your stack trace.

I'll build a fixed version.

26 Mar 08:08
by Rob

Logged bug http://www.avaje.org/bugdetail-44.html

Uploaded 0.9.6a which includes a fix for this bug and 2 others. This should be downloadable from sourceforge soon (needs to propergate around the sourceforge download sites).

Try that version and let me know. I did reproduce and it fixed the issue on my setup so I'm expecting that to fix it.

27 Mar 00:42
by Rob

testing the website... had a glitch which stopped it working.

Create a New Topic

Title:
Body:
 
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse