The Event class has two fields which are persisted as a serialized
object.
Both of these fields has a serialId. I don't know what the problem is
and
what should I do to use my application again and not to loose my
database.
The Event class:
package bt.web.reminder.database;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import bt.common.time.TimeInterval;
import bt.common.time.TimeMask;
import com.google.appengine.api.datastore.Key;
@PersistenceCapable(identityType = IdentityType.APPLICATION,
detachable="true")
public class Event implements Serializable {
private static final long serialVersionUID = 3869735293371199817L;
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
protected Key key;
@Persistent
protected Account account;
@Persistent
protected String title;
@Persistent
protected String description;
@Persistent
protected String eventType;
@Persistent(serialized = "true")
protected TimeMask timeMask;
@Persistent(serialized = "true")
protected List<TimeInterval> remindings;
@Persistent
protected Date created;
@Persistent
protected Date lastReminded;
public Event(Account account, String title, String description,
String eventType, TimeMask timeMask, List<TimeInterval> remindings) {
this.account = account;
this.title = title;
this.description = description;
this.eventType = eventType;
this.timeMask = timeMask;
this.remindings = remindings;
this.created = new Date(System.currentTimeMillis());
this.lastReminded = null;
}
public long getId() {
return key.getId();
}
public Account getAccount() {
return account;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getEventType() {
return eventType;
}
public void setEventType(String eventType) {
this.eventType = eventType;
}
public TimeMask getTimeMask() {
return timeMask;
}
public void setTimeMask(TimeMask timeMask) {
this.timeMask = timeMask;
}
public List<TimeInterval> getRemindings() {
return remindings;
}
public void setRemindings(List<TimeInterval> remindings) {
this.remindings = remindings;
}
public Date getCreated() {
return created;
}
public Date getLastReminded() {
return lastReminded;
}
public void setLastReminded(Date lastReminded) {
this.lastReminded = lastReminded;
}
@Override
public int hashCode() {
return new Long(getId()).hashCode();
}
@Override
public boolean equals(Object o) {
if (o == null || !(o instanceof Event))
return false;
Event event = (Event)o;
return getId() == event.getId();
}
}
On dec. 3, 23:11, "Ikai L (Google)" <[email protected]> wrote:
> What does the class you are trying to persist look like?
>
>
>
>
>
> On Wed, Dec 2, 2009 at 1:23 AM, bartatamas <[email protected]> wrote:
> > Hi!
>
> > I've deployed a new version of my web application and it doesn't work
> > now because of this exception:
>
> > Uncaught exception from servlet
> > Received ClassNotFoundException deserializing a byte array.
> > org.datanucleus.exceptions.NucleusException: Received
> > ClassNotFoundException deserializing a byte array.
> > at
> > org.datanucleus.store.appengine.SerializationManager$1.deserialize
> > (SerializationManager.java:146)
> > at org.datanucleus.store.appengine.SerializationManager.deserialize
> > (SerializationManager.java:171)
> > at
> > org.datanucleus.store.appengine.DatastoreFieldManager.deserializeFieldValue
> > (DatastoreFieldManager.java:321)
> > at
> > org.datanucleus.store.appengine.DatastoreFieldManager.fetchObjectField
> > (DatastoreFieldManager.java:297)
> > at org.datanucleus.state.AbstractStateManager.replacingObjectField
> > (AbstractStateManager.java:1197)
> > at bt.web.reminder.database.Event.jdoReplaceField(Event.java)
> > at bt.web.reminder.database.Event.jdoReplaceFields(Event.java)
> > at org.datanucleus.state.JDOStateManagerImpl.replaceFields
> > (JDOStateManagerImpl.java:2772)
> > at org.datanucleus.state.JDOStateManagerImpl.replaceFields
> > (JDOStateManagerImpl.java:2791)
> > at
> > org.datanucleus.store.appengine.DatastorePersistenceHandler.fetchObject
> > (DatastorePersistenceHandler.java:443)
> > at org.datanucleus.state.JDOStateManagerImpl.loadUnloadedFields
> > (JDOStateManagerImpl.java:1560)
> > at org.datanucleus.jdo.state.Hollow.transitionRetrieve(Hollow.java:
> > 161)
> > at org.datanucleus.state.AbstractStateManager.retrieve
> > (AbstractStateManager.java:484)
> > at org.datanucleus.state.JDOStateManagerImpl.preSerialize
> > (JDOStateManagerImpl.java:4455)
> > at bt.web.reminder.database.Event.jdoPreSerialize(Event.java)
> > at bt.web.reminder.database.Event.writeObject(Event.java)
> > at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > at java.lang.reflect.Method.invoke(Unknown Source)
> > at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
> > at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> > at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> > at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > at java.io.ObjectOutputStream.writeObject(Unknown Source)
> > at java.util.ArrayList.writeObject(Unknown Source)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > at java.lang.reflect.Method.invoke(Unknown Source)
> > at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
> > at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> > at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> > at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
> > at java.io.ObjectOutputStream.defaultWriteObject(Unknown Source)
> > at bt.web.reminder.database.Account.writeObject(Account.java)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > at java.lang.reflect.Method.invoke(Unknown Source)
> > at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
> > at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> > at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> > at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > at java.io.ObjectOutputStream.writeObject(Unknown Source)
> > at java.util.HashMap.writeObject(Unknown Source)
> > at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
> > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > at java.lang.reflect.Method.invoke(Unknown Source)
> > at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source)
> > at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
> > at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
> > at java.io.ObjectOutputStream.writeObject0(Unknown Source)
> > at java.io.ObjectOutputStream.writeObject(Unknown Source)
> > at com.google.appengine.api.memcache.MemcacheSerialization.serialize
> > (MemcacheSerialization.java:257)
> > at com.google.appengine.api.memcache.MemcacheServiceImpl.put
> > (MemcacheServiceImpl.java:314)
> > at com.google.appengine.api.memcache.stdimpl.GCache.put(GCache.java:
> > 164)
>
> > Do you know what should I do? What does this message mean:
>
> > Caused by: java.lang.ClassNotFoundException
> > Unexpected exception from servlet:
> > org.datanucleus.exceptions.NucleusException: Received
> > ClassNotFoundException deserializing a byte array.
>
> > I think there should be an other exception what is not logged by
> > SerializationManager.
>
> > Thanks, Tamás
>
> > --
>
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<google-appengine%2Bunsubscrib
> > [email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine?hl=en.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.