Announcement Announcement Module
Collapse
No announcement yet.
"id cannot be zero" on google appEngine Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • "id cannot be zero" on google appEngine

    I got the exception "id cannot be zero" from google appEngine when a new record is going to be inserted.
    The application is gwt + spring roo. The gwt work is done by me, not generated by spring roo. It works fine before I switch it to google app engine.

    The code about id was generated by spring roo.

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long Item.id;

    The id will be populated by the database. The google appEngine does not allow id to be zero. How does it work? Thanks,


    Caused by: java.lang.IllegalArgumentException: id cannot be zero
    at com.google.appengine.api.datastore.KeyFactory.crea teKey(KeyFactory.java:44)
    at com.google.appengine.api.datastore.KeyFactory.crea teKey(KeyFactory.java:31)
    at org.datanucleus.store.appengine.DatastoreFieldMana ger.storePrimaryKey(DatastoreFieldManager.java:760 )
    at org.datanucleus.store.appengine.DatastoreFieldMana ger.storeObjectField(DatastoreFieldManager.java:78 4)
    at org.datanucleus.state.AbstractStateManager.provide dObjectField(AbstractStateManager.java:1037)
    at my.alarm.domain.Item.jdoProvideField(Item.java)
    at my.alarm.domain.Item.jdoProvideFields(Item.java)
    at org.datanucleus.state.JDOStateManagerImpl.provideF ields(JDOStateManagerImpl.java:2715)
    at org.datanucleus.store.appengine.DatastorePersisten ceHandler.insertPreProcess(DatastorePersistenceHan dler.java:341)
    at org.datanucleus.store.appengine.DatastorePersisten ceHandler.insertObjects(DatastorePersistenceHandle r.java:251)
    at org.datanucleus.store.appengine.DatastorePersisten ceHandler.insertObject(DatastorePersistenceHandler .java:240)
    at org.datanucleus.state.JDOStateManagerImpl.internal MakePersistent(JDOStateManagerImpl.java:3185)
    at org.datanucleus.state.JDOStateManagerImpl.flush(JD OStateManagerImpl.java:4513)
    at org.datanucleus.ObjectManagerImpl.flushInternal(Ob jectManagerImpl.java:2814)
    at org.datanucleus.ObjectManagerImpl.flush(ObjectMana gerImpl.java:2754)
    at org.datanucleus.ObjectManagerImpl.preCommit(Object ManagerImpl.java:2893)
    at org.datanucleus.TransactionImpl.internalPreCommit( TransactionImpl.java:369)
    at org.datanucleus.TransactionImpl.commit(Transaction Impl.java:256)
    at org.datanucleus.jpa.EntityTransactionImpl.commit(E ntityTransactionImpl.java:104)
    at org.datanucleus.store.appengine.jpa.DatastoreEntit yTransactionImpl.commit(DatastoreEntityTransaction Impl.java:55)
    at org.springframework.orm.jpa.JpaTransactionManager. doCommit(JpaTransactionManager.java:467)

  • #2
    any body knows ?

    Comment

    Working...
    X