3

I am using JDO API 3 with google app engine 1.9.15.

using javax.jdo.PersistenceManager, javax.jdo.Query, javax.jdo.Transaction for queries.

SO basically i am doing relational mapping in my JDO entity. My JDO entity is like

@PersistenceCapable
public class MyEntity {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;

@Persistent
private String name;

@Persistent
private Boolean isCheck;

@Persistent(mappedBy = "myEntity",defaultFetchGroup="true")
@Element(dependent="true")
private Set<MyObject> myObject;

//Getters and setters of attributes
}

I get my entities with below query:

 //pm is object of persistence manager    
    Query query =  pm.newQuery(MyEntity.class);
    //Object array is null because i want all the entities
    Object value[] = new Object[0];
    //Error occurred here while excutting for first time in new session
    List result = (List) query.executeWithArray(value);
    return result;

So when i tried to get my entity by Id it will give exception message like

com.utility.ErrorHandler errorHandler: Exception message : Identifier isCheck is unresolved (not a static field)
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler: Error in class DataAccessLayer
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler:  
org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:519)
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler:  
org.datanucleus.api.jdo.JDOQuery.executeWithArray(JDOQuery.java:321)
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler:  
com.datastore.DataAccessLayer.searchObjects(DataAccessLayer.java:213)
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler:  
com.businessaccesslayer.Manager.getIsCheckAppPolicies(Manager.java:216)
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler:  
com.login.user.ViolationManager.checkViolationPolicyOnLogin(ViolationManager.java:86)
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler:  
com.login.user.ViolationManager.checkViolationPolicyOnUser(ViolationManager.java:46)
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler:  
com.samlapp.user.AuthenticateUser.doPost(AuthenticateUser.java:73)
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler:  
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler:  
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
W 2015-10-28 03:49:06.516
com.utility.ErrorHandler errorHandler:  
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
W 2015-10-28 03:49:06.516

Stack trace while getting list of object

com.utility.ErrorHandler errorHandler: Exception message : Found Meta-Data for class com.MyEntity  but this class is not enhanced!! Please enhance the class before running DataNucleus.
W 2015-10-28 10:24:20.865
com.utility.ErrorHandler errorHandler: Error in class DataAccessLayer
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:519)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.datanucleus.api.jdo.JDOQuery.executeWithArray(JDOQuery.java:321)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.datastore.DataAccessLayer.searchObjects(DataAccessLayer.java:213)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.businessaccesslayer.Manager.getAllAppPolicies(Manager.java:177)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.controls.admin.GetAppPolicyList.doGet(GetAppPolicyList.java:70)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.featurebase.admin.FeatureStatusFilter.doFilter(FeatureStatusFilter.java:136)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.filter.MultiAdminFilter.doFilter(MultiAdminFilter.java:400)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.owasp.csrfguard.CsrfGuardFilter.doFilter(CsrfGuardFilter.java:88)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.filter.ErrorHandlerFilter.doFilter(ErrorHandlerFilter.java:41)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.filter.ClickjackFilter.doFilter(ClickjackFilter.java:26)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.filter.XSSFilter.doFilter(XSSFilter.java:56)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:37)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
W 2015-10-28 10:24:20.866
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:260)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.Server.handle(Server.java:326)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:78)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:147)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:457)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.tracing.CurrentContext.runInContext(CurrentContext.java:230)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:235)
W 2015-10-28 10:24:20.867
com.utility.ErrorHandler errorHandler:  
 java.lang.Thread.run(Thread.java:745)

But this exceptions is inconsistent.

Also My classes are enhance already still when I tried to access list of object first time from new session it gives following Exception :

Exception message : Found Meta-Data for class com.MyEntity but this class is not enhanced!! Please enhance the class before running DataNucleus.

So once i refresh page it will return results.I am facing this issue since last 7-8 months please help me with this.

There are lots of question about this on SO without answer.I report this issue on google support Google issue link also add as issue on Github

SimonJ
  • 21,076
  • 1
  • 35
  • 50
Harshal Patil
  • 6,659
  • 8
  • 41
  • 57
  • which version of DataNucleus you are using? – Swap L Oct 27 '15 at 09:36
  • @SwapL I am using DataNucleus version 3.0 – Harshal Patil Oct 27 '15 at 09:38
  • 1
    Any exception has a stack trace. Sadly you don't post yours. If a class is not enhanced then do as the message says ... enhance it – Neil Stockton Oct 27 '15 at 09:50
  • @NeilStockton Read carefully and then make statement. I already clear the thing that classes are already enhance still i am facing this problem. and this behavior is inconsistent. I put the important stack trace over here so no need to put all the exception stack. – Harshal Patil Oct 27 '15 at 10:02
  • 1
    I did "read carefully". It doesn't give a message that a class is not enhanced unless it is not enhanced. You can check enhancement using "javap". There is no stack trace in your post and if you don't put it then you present inadequate information and won't get much of an answer ... your choice. – Neil Stockton Oct 27 '15 at 10:04
  • @NeilStockton Check Updated question – Harshal Patil Oct 27 '15 at 10:11
  • which is still INADEQUATE in saying where that message comes from. e.printStackTrace prints it all out ... so do that and post it here. – Neil Stockton Oct 27 '15 at 10:13
  • Maybe you're in the process of executing some query, so the most basic info is WHAT is the query – Neil Stockton Oct 27 '15 at 10:17
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/93469/discussion-between-harshal-patil-and-neil-stockton). – Harshal Patil Oct 27 '15 at 10:18
  • It accept null also. I did generic method for that if parameters are not there still we get all the results using executeWithArray. My code is working properly it gives error only first time when new browser session created. You can check full stack trace in question. – Harshal Patil Oct 29 '15 at 07:14
  • No that is NOT the FULL stack trace. You see getJDOExceptionForNucleusException? Well that means there is a NESTED exception which you have ignored. – Neil Stockton Oct 29 '15 at 07:23

0 Answers0