我有一个这样定义的字段
@MappedSupperclass
public abstract class BaseItem {
...
@Lob @Basic(fetch=FetchType.EAGER)
private String description;
...
}
@Entity
public class Item extends BaseItem {
}
我正在使用 MySQL 5,desccription
字段类型为TEXT
.
在尝试读取 Item 类型的对象时,出现以下错误:
java.io.StreamCorruptedException: invalid stream header: 6576656E
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:782)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:279)
at org.datanucleus.store.rdbms.datatype.BlobImpl.getObject(BlobImpl.java:121)
at org.datanucleus.store.rdbms.mapping.AbstractLargeBinaryRDBMSMapping.getObjectForBytes(AbstractLargeBinaryRDBMSMapping.java:362)
at org.datanucleus.store.rdbms.mapping.AbstractLargeBinaryRDBMSMapping.getObject(AbstractLargeBinaryRDBMSMapping.java:395)
at org.datanucleus.store.mapped.mapping.AbstractContainerMapping.getObject(AbstractContainerMapping.java:228)
at org.datanucleus.store.rdbms.fieldmanager.ResultSetGetter.fetchObjectField(ResultSetGetter.java:176)
at org.datanucleus.state.AbstractStateManager.replacingObjectField(AbstractStateManager.java:2353)
...
您知道造成这种情况的可能原因是什么吗?
我正在使用 JDK6 和 DataNucleus 3.1.1。