java.lang.ClassCastException

java.lang.Long cannot be cast to > java.lang.String at > org.datanucleus.store.appengine.DatastoreFieldManager.fetchObjectField > (DatastoreFieldManager.java:307) at org.datanucleus.state.AbstractStateManager.replacingObjectField > (AbstractStateManager.java:1197) at com.shekhar.interview.entity.Question.jdoReplaceField > (Question.java) at com.shekhar.interview.entity.Question.jdoReplaceFields > (Question.java) at org.datanucleus.state.JDOStateManagerImpl.replaceFields > (JDOStateManagerImpl.java:2772) at org.datanucleus.state.JDOStateManagerImpl.replaceFields > (JDOStateManagerImpl.java:2791) at > org.datanucleus.store.appengine.DatastorePersistenceHandler.fetchObject > (DatastorePersistenceHandler.java:349) at org.datanucleus.store.appengine.query.DatastoreQuery.entityToPojo > (DatastoreQuery.java:384) at org.datanucleus.store.appengine.query.DatastoreQuery.entityToPojo > (DatastoreQuery.java:345) at org.datanucleus.store.appengine.query.DatastoreQuery.access$700 > (DatastoreQuery.java:96) at org.datanucleus.store.appengine.query.DatastoreQuery$5.apply > (DatastoreQuery.java:454) at org.datanucleus.store.appengine.query.DatastoreQuery$5.apply > (DatastoreQuery.java:453) at > org.datanucleus.store.appengine.query.StreamingQueryResult.resolveNext > (StreamingQueryResult.java:137) at org.datanucleus.store.appengine.query.StreamingQueryResult.size > (StreamingQueryResult.java:174)

Samebug tips0

There are no available Samebug tips for this exception. If you know how to solve this issue, help other users by writing a short tip.

Don't give up yet. Paste your full stack trace to get a solution.

Solutions on the web19718

  • java.lang.Long cannot be cast to > java.lang.String at > org.datanucleus.store.appengine.DatastoreFieldManager.fetchObjectField > (DatastoreFieldManager.java:307) at org.datanucleus.state.AbstractStateManager.replacingObjectField
  • java.lang.Long cannot be cast to java.lang.String at org.datanucleus.store.appengine.DatastoreFieldManager.getIdForObject(DatastoreFieldManager.java:565) at org.datanucleus.store.appengine.DatastoreFieldManager.getParentKeyFromExternalFKMappings
  • java.lang.Long cannot be cast to com.goldbeans.module.security.domain.User at com.goldbeans.module.security.service.spring.UserServiceImplTest $FilteredUser.matches(UserServiceImplTest.java:258) at
  • Stack trace

    • java.lang.ClassCastException: java.lang.Long cannot be cast to > java.lang.String at > org.datanucleus.store.appengine.DatastoreFieldManager.fetchObjectField > (DatastoreFieldManager.java:307) at org.datanucleus.state.AbstractStateManager.replacingObjectField > (AbstractStateManager.java:1197) at com.shekhar.interview.entity.Question.jdoReplaceField > (Question.java) at com.shekhar.interview.entity.Question.jdoReplaceFields > (Question.java) at org.datanucleus.state.JDOStateManagerImpl.replaceFields > (JDOStateManagerImpl.java:2772) at org.datanucleus.state.JDOStateManagerImpl.replaceFields > (JDOStateManagerImpl.java:2791) at > org.datanucleus.store.appengine.DatastorePersistenceHandler.fetchObject > (DatastorePersistenceHandler.java:349) at org.datanucleus.store.appengine.query.DatastoreQuery.entityToPojo > (DatastoreQuery.java:384) at org.datanucleus.store.appengine.query.DatastoreQuery.entityToPojo > (DatastoreQuery.java:345) at org.datanucleus.store.appengine.query.DatastoreQuery.access$700 > (DatastoreQuery.java:96) at org.datanucleus.store.appengine.query.DatastoreQuery$5.apply > (DatastoreQuery.java:454) at org.datanucleus.store.appengine.query.DatastoreQuery$5.apply > (DatastoreQuery.java:453) at > org.datanucleus.store.appengine.query.StreamingQueryResult.resolveNext > (StreamingQueryResult.java:137) at org.datanucleus.store.appengine.query.StreamingQueryResult.size > (StreamingQueryResult.java:174) at com.shekhar.interview.dao.QuestionDAO.findAll(QuestionDAO.java:45)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You’re the first here who have seen this exception.