gwt-rpc +应用引擎 +使用restlet持久化会抛出异常

发布于 2024-11-02 07:36:36 字数 1626 浏览 4 评论 0原文

我试图为 GWT + GAE 重建 Restlet 示例应用程序 (

到目前为止一切都很顺利。 “Put”正在通过应用程序引擎,但当我尝试使用 JPA 持久化对象时,出现以下异常:

Caused by: org.datanucleus.exceptions.ClassNotResolvedException: Class "de.fr1zle.shoplist.web.gae.client.ShoppingListRessourceProxy" was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
    at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:250)
    at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:415)
    at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:767)
    ... 79 more

如您所见,datanucleus 在从 persistence.xml 加载信息时以某种方式尝试访问 GWT 代理类。 我在 ServerRessource 中使用以下内容:

@Put
public void putShoppingList(ShoppingList shoppingList) {
    ShoppingListDOA shoppingListDOA = new ShoppingListDOA(shoppingList);
    EntityManagerFactory emf = Persistence
            .createEntityManagerFactory("transactions-optional");
    try {
        EntityManager entityManager = emf.createEntityManager();
        EntityTransaction transaction = entityManager.getTransaction();
        transaction.begin();
        entityManager.persist(shoppingListDOA);
        entityManager.flush();
        transaction.commit();
        entityManager.close();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (emf != null)
            emf.close();
    }
}

我以某种方式感觉 DataNucleus 也增强了代理类,尽管我更改了它的属性以使其不这样做。

使用:GAE 1.4.2(也尝试过1.4.3),GWT 2.2 和 Restlet 2.1m3

我在这里遗漏了一点吗?感谢您的帮助:-)

提前致谢!

弗尔兹勒

I was trying to rebuild the Restlet sample Application for GWT + GAE ( http://wiki.restlet.org/docs_2.1/13-restlet/21-restlet/318-restlet/303-restlet.html ) .
I changed it a bit, since I am planning something diffrent but I thought it would be a good start.

It was going okish until now. The "Put" was coming through to app engine but when i tried to persist the Objects using JPA i get the following Exception:

Caused by: org.datanucleus.exceptions.ClassNotResolvedException: Class "de.fr1zle.shoplist.web.gae.client.ShoppingListRessourceProxy" was not found in the CLASSPATH. Please check your specification and your CLASSPATH.
    at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:250)
    at org.datanucleus.JDOClassLoaderResolver.classForName(JDOClassLoaderResolver.java:415)
    at org.datanucleus.metadata.MetaDataManager.loadPersistenceUnit(MetaDataManager.java:767)
    ... 79 more

As you can see, datanucleus somehow tries to access the GWT Proxy class when loading the info from the persistence.xml.
I use the following in my ServerRessource:

@Put
public void putShoppingList(ShoppingList shoppingList) {
    ShoppingListDOA shoppingListDOA = new ShoppingListDOA(shoppingList);
    EntityManagerFactory emf = Persistence
            .createEntityManagerFactory("transactions-optional");
    try {
        EntityManager entityManager = emf.createEntityManager();
        EntityTransaction transaction = entityManager.getTransaction();
        transaction.begin();
        entityManager.persist(shoppingListDOA);
        entityManager.flush();
        transaction.commit();
        entityManager.close();
    } catch (Exception e) {
        e.printStackTrace();
    } finally {
        if (emf != null)
            emf.close();
    }
}

I somehow have the feeling that DataNucleus enhances the Proxy Class, too although I changed the properites for it to not do so.

Using: GAE 1.4.2 (tried 1.4.3, too) , GWT 2.2 and Restlet 2.1m3

Am I missing a point here? Your help is appricated :-)

Thanks in advance!

fr1zle

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文