I keep getting JDOFatalUserException when i run the following code.
I was going to use my own uniqueIdKey but with the error tried Key
instead.
I have the singleton PMF and have followed the guides but not sure why
Im still getting this.
http://code.google.com/appengine/docs/java/datastore/overview.html
http://code.google.com/appengine/docs/java/datastore/dataclasses.html


@Override
        public String userRegister(String name, String passwordHash, String
email) {
                Date dt = new Date();
                String uniqueIdKey = String.valueOf(dt.getTime());

        Account e = new Account(uniqueIdKey, name, email,
passwordHash, new Date());
        PersistenceManager pm =
com.neostorm.taskplanner.server.PMF.get().getPersistenceManager();
        try {
            pm.makePersistent(e);
        } finally {
            pm.close();
        }

        //TEST
                String query = "select from " + Account.class.getName() + " 
where
login == '"+name+"'";
                List<Account> result;
                try {
                        result = (List<Account>) pm.newQuery(query).execute();
                } catch (javax.jdo.JDOFatalUserException e1) {
                        e1.printStackTrace();
                        return null;
                }
...
                //Restore Data to session.
                String sessionId = setupUserSession(uniqueIdKey);

                return sessionId;
}


This is the Account


import com.google.appengine.api.datastore.Key;

import java.util.Date;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable
public class Account {
    @PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
    @Persistent
        private String loginID;
    @Persistent
        private String login;
    @Persistent
        private String email;
    @Persistent
        private String passwordHash;
    @Persistent
    private Date date;

        public Account(String loginID,String login,String email,String
passwordHash, Date date){
                this.loginID = loginID;
                this.login = login;
                this.email = email;
                this.passwordHash = passwordHash;
                this.date = date;
        }
...
getters/setters
...
}

javax.jdo.JDOFatalUserException: Persistence Manager has been closed
        at
org.datanucleus.jdo.JDOPersistenceManager.assertIsOpen(JDOPersistenceManager.java:
2125)
        at
org.datanucleus.jdo.JDOPersistenceManager.newQuery(JDOPersistenceManager.java:
1247)
        at
org.datanucleus.jdo.JDOPersistenceManager.newQuery(JDOPersistenceManager.java:
1234)
        at
com.neostorm.taskplanner.server.IplanServiceImpl.userRegister(IplanServiceImpl.java:
337)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at
com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:
100)
        at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
562)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
188)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:
224)
        at
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:
62)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1093)
        at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
51)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
        at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
        at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
121)
        at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1084)
        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
360)
        at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
181)
        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
712)
        at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
405)
        at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
70)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
139)
        at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:352)
        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
139)
        at org.mortbay.jetty.Server.handle(Server.java:313)
        at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
506)
        at org.mortbay.jetty.HttpConnection
$RequestHandler.content(HttpConnection.java:844)
        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
        at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
        at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
396)
        at org.mortbay.thread.BoundedThreadPool
$PoolThread.run(BoundedThreadPool.java:442)

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to