我奋力而在GAE处理会议。我试图在会话中存储两个类和一个字符串。虽然在DEV环境下它运行良好,但在生产中,类和字符串不会在会话中持久化。这是没有得到保存为一个会话属性的类如下:会话数据在GAE(Java)的不坚持
@PersistenceCapable(detachable="true")
public class Agent implements Serializable{
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
@Persistent private String name; //Name of the Agency
@Element(dependent = "true")
private List<Contact> contacts = new ArrayList<Contact>();
@Element(dependent = "true")
private List<Agency> agencies = new ArrayList<Agency>();
@Persistent private List<Long> subAgents = new ArrayList<Long>();
@Persistent private Date createdOn = new Date();
}
我想再次提到它工作正常的开发环境,但对生产,我得到的值作为空。正如你所看到的,我已经让类实现了Serializable。但我认为这不是问题,因为我设置一个多个属性作为一个简单的字符串,也失败(我得到的属性值是零)。然而,会话被创建,因为我可以在后端看到它,并且还有一个会话持久化的类。
任何人有什么建议?提前致谢。
**明白了!其实我没有做过联系人和代理序列化的类。我做了他们,他们现在好了:) –