【问题标题】:503 Service Unavailable Google App Engine getting Null Pointer Exception503 Service Unavailable Google App Engine 获取空指针异常
【发布时间】:2014-08-31 18:26:39
【问题描述】:

我导航到localhost:8888/_ah/api/explorer 并调用一些端点的方法。 listEntities()findEntity() 照常运行,但是当我尝试 addEntity() 到数据存储时,我得到了

Aug 31, 2014 9:22:03 PM com.google.api.server.spi.SystemService invokeServiceMethod SEVERE: null java.lang.NullPointerException at org.datanucleus.api.jpa.JPAEntityManager.find(JPAEntityManager.java:318) at org.datanucleus.api.jpa.JPAEntityManager.find(JPAEntityManager.java:256)

我无法创建新实体,但我可以看到以前的实体。 我检查了我的 persistence.xml,但没有发现任何异常。

【问题讨论】:

  • 我认为你有注入 jpa 实体管理器依赖的问题。您需要使用无状态请求配置 jpa 实体管理器。

标签: google-app-engine google-cloud-datastore


【解决方案1】:

根据Entity 规范,我设法以某种方式解决了这个问题,除此之外,具有@Entity 注释的类必须定义一个我没有定义的无参数默认构造函数。我不知道这是否是问题,但问题已解决。

【讨论】:

    猜你喜欢
    • 2021-11-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-17
    • 1970-01-01
    • 1970-01-01
    • 2018-02-24
    • 1970-01-01
    相关资源
    最近更新 更多