title: JDO Exception: Identifier unresolved(Not a static fields)
body: <blockquote>
    <p>i am making an object persistent using JDO. I have run code numerous times. At times, i get things persisted without any error. At times, i receive the following errors.</p>
    
    <ol>
    <li>org.datanucleus.exceptions.NucleusUserException</li>
    <li>javax.jdo.JDOUserException</li>
    </ol>
    
    <p>I dont understand why it runs successfully sometimes and why it fails sometimes. These happens very randomly. My application is validating new User during signUp. Here goes my code.</p>
  </blockquote>
  
  <pre><code>&gt; ##    User.java(entity being persisted) ##
  
  
   @Entity
   @PersistenceCapable
  
   public class User {
  
  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  public String userName;
  
  @Persistent
  private String name, password, city, bikeModel, age;
  
  public User(){
  
  }
  public User(String name, String uname, String pswd, String age, String city, String bike){
      this.name=name;
      this.userName=uname;
      this.password=pswd;
      this.age=age;
      this.city=city;
      this.bikeModel=bike;
  }
  
  public String getUserName() {
      return userName;
  }
  //rest of the getters
  }
  
  
  
      //Getting SignUp form values
      String name=req.getParameter("name1");
      String uname=req.getParameter("uname1");
      String pswd=req.getParameter("pswd1");
      String age=req.getParameter("age");
      String city=req.getParameter("city");
      String bike=req.getParameter("bike");
  
              //PeristenceManager instance
              PersistenceManager pm = PMF.get().getPersistenceManager();
  
              //Creating instance for persistent entity class
       User newEntry=new User(name,uname,pswd,age,city,bike);
  
              //Query to match the userName entered in form and that of the dataStore user
      Query q = pm.newQuery(User.class);
      q.setFilter("userName == userNameParam");
      q.declareParameters("String userNameParam");
              try{
        List&lt;User&gt; results = (List&lt;User&gt;) q.execute(uname);
        if (!results.isEmpty()) {
                  //if userName is found in DataStore
              resp.sendRedirect("invalidUser.html");  
        } else{
               //If userName is not found in dataStore
            pm.makePersistent(newEntry);          
            resp.sendRedirect("success.html");
            return;
        }
       }**strong text**
      finally{
  
          System.out.println("Finally!");
      }
  </code></pre>
  
  <p><strong><em>error logs:</em></strong></p>
  
  <pre><code>com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler: Exception message : Identifier Status is unresolved (not a static field)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler: Error in class DataAccessLayer
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:519)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.datanucleus.api.jdo.JDOQuery.executeWithArray(JDOQuery.java:321)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.cloudcodes.gcontrol.datastore.DataAccessLayer.searchObjects(DataAccessLayer.java:213)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.cloudcodes.gcontrol.businessaccesslayer.GLoginManager.getNewPasswordCSVs(GLoginManager.java:24202)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.cloudcodes.gcontrol.backends.ReadPasswordCSVFile.doGet(ReadPasswordCSVFile.java:71)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:37)
  
  
   com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:50)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:260)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.Server.handle(Server.java:326)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:78)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:148)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:504)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:446)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:453)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.tracing.CurrentContext.runInContext(CurrentContext.java:276)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:312)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:304)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:450)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:235)
  com.cloudcodes.gcontrol.utility.ErrorHandler errorHandler:  
   java.lang.Thread.run(Thread.java:745)
  </code></pre>