I am trying to store images on GAE bigtable however I am getting an
error that the bean I'm trying to store is missing something. Well it
is an almost exact copy of other beans I am storing on bigtable with
no problems. Here is the error and please don't tell me that I need to
follow the error message advice, because I already do:
org.datanucleus.jdo.exceptions.ClassNotPersistenceCapableException:
The class "The class "net.compuroad.cerrado.server.CerradoImage" is
not persistable. This means that it either hasnt been enhanced, or
that the enhanced version of the file is not in the CLASSPATH (or is
hidden by an unenhanced version), or the Meta-Data/annotations for the
class are not found." is not persistable. This means that it either
hasnt been enhanced, or that the enhanced version of the file is not
in the CLASSPATH (or is hidden by an unenhanced version), or the Meta-
Data for the class is not found.
Below is the bean I am trying to persist:
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
import com.google.appengine.api.datastore.Blob;
import com.google.appengine.api.datastore.Key;
public class CerradoImage {
@PrimaryKey
@Persistent (valueStrategy = IdGeneratorStrategy.IDENTITY)
protected Key key;
@Persistent
protected Blob blob = null;
private String key = null;
@Persistent
protected String name = null;
@Persistent
protected String mimeType = null;
public CerradoImage() {
// TODO Auto-generated constructor stub
}
public CerradoImage(String name, String mimeType, Blob blob)
{
super();
this.blob = blob;
this.name = name;
this.mimeType = mimeType;
}
public Blob getBlob() {
return blob;
}
public void setBlob(Blob blob) {
this.blob = blob;
}
public Key getKey() {
return key;
}
public void setKey(Key key) {
this.key = key;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMimeType() {
return mimeType;
}
public void setMimeType(String mimeType) {
this.mimeType = mimeType;
}
}
And here is the call to bigtable:
....
while (iterator.hasNext()) {
final FileItemStream fis = iterator.next();
if (!fis.isFormField()) {
final String name = fis.getName();
final String mimeType =
fis.getContentType();
System.out.println("name: "+name+" -
mimeType: "+mimeType);
final InputStream is =
fis.openStream();
final Blob blob = new
Blob(IOUtils.toByteArray(is));
CerradoImage image = new
CerradoImage(name, mimeType, blob);
pm.makePersistent(image);
....
Thanks,
Wilson
--
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.