在DataStore中存储数据时无法初始化类server.PMF

时间:2012-06-11 12:40:31

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

我一直在使用这两个函数来存储数据和验证数据。这两个函数是服务器端Eclipse中的GWT-RPC服务方法:

public String greetServer(String mail,String pass) 
{
    User e;
    PersistenceManager pm1 = PMF.get().getPersistenceManager();

    try
    {
        e = pm1.getObjectById(User.class, mail);
    } finally {
        pm1.close();
    }

    if (e.getPassword()==pass)
    {
        return "valid";
    }
        else return "invalid";
}

public String UserRegister(String data[])
{       
    PersistenceManager pm2 = PMF.get().getPersistenceManager();
    Date d1=new Date();
    User u1=new User(data[0],data[1],data[2],data[3],d1);

    try {
        pm2.makePersistent(u1);
    } finally {
        pm2.close();
    }

    return "done";
}

谷歌App Engine出现以下错误:

error java.lang.NoClassDefFoundError: Could not initialize class pathname/server.PMF

我该如何解决这个问题?

我正在使用以下PMF课程:

package com.google.gwt.sample.login.server;

import java.util.logging.Logger;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

public final class PMF {     
    private static final PersistenceManagerFactory pmfInstance = JDOHelper.getPersistenceManagerFactory("transactions-optional");

    public static synchronized PersistenceManagerFactory get() {        
        return pmfInstance;
    }
}

0 个答案:

没有答案