1

我一直在使用这两个函数来存储数据和验证数据。这两个函数是服务端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;
    }
}
4

0 回答 0