Я имею это исключение, когда я называюприложение enigine 1.9.18, СДО 3.1.3 java.lang.ClassCastException java.lang.Long не может быть приведен к java.lang.Double
jobInDatabase = pm.getObjectById(DAOJob.class, job.getKey());
Заставляет следующее исключение
java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Double
at com.eurekaapp.server.dao.mappedobjects.DAOJob.jdoReplaceField(DAOJob.java)
at com.eurekaapp.server.dao.mappedobjects.DAOJob.jdoReplaceFields(DAOJob.java)
at org.datanucleus.state.JDOStateManager.replaceFields(JDOStateManager.java:1935)
at org.datanucleus.state.JDOStateManager.replaceFields(JDOStateManager.java:1962)
at com.google.appengine.datanucleus.DatastorePersistenceHandler.fetchObject(DatastorePersistenceHandler.java:567)
at org.datanucleus.state.JDOStateManager.loadFieldsFromDatastore(JDOStateManager.java:1638)
at org.datanucleus.state.JDOStateManager.validate(JDOStateManager.java:3511)
at org.datanucleus.ObjectManagerImpl.findObject(ObjectManagerImpl.java:3379)
at org.datanucleus.api.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:1722)
at org.datanucleus.api.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:1740)
at com.eurekaapp.server.dao.GoogleCloud.getJob(GoogleCloud.java:712)
at com.eurekaapp.server.service.DAOServiceImpl.getJob(DAOServiceImpl.java:661)
at com.eurekaapp.server.api.client.AddJobEvent.doPost(AddJobEvent.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:125)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.JdbcMySqlConnectionCleanupFilter.doFilter(JdbcMySqlConnectionCleanupFilter.java:60)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:254)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:527)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:745)
Я не уверен, какое поле выбрасывает это исключение? Я 3 двойников в OBJ - вес 0 deliveryLongitude 0 deliveryLatitude 0
и остальных чисел тоскует. Это происходит только с одним объектом на данный момент.
Эти значения устанавливаются по умолчанию, если значение не передано. Если продолжить, возможно, если бы я установил эти значения по умолчанию для представления фактических удвоений, это устранило бы эту проблему.
Вот некоторые из журналов на сервере, ведущий к исключению:
I 12:16:05.092 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,091 DEBUG Request 6CDEEF07 class:doPost:45 - user.isParsingSuccessfull()
I 12:16:05.093 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,092 DEBUG Request 6CDEEF07 class:isReceivedVersionCorrect:1830 - isReceivedVersionCorrect(): starting
I 12:16:05.094 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,093 DEBUG Request 6CDEEF07 class:isReceivedVersionCorrect:1833 - isReceivedVersionCorrect(): try
I 12:16:05.095 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,094 DEBUG Request 6CDEEF07 class:isReceivedVersionCorrect:1837 - isReceivedVersionCorrect(): version correct, version[17]
I 12:16:05.096 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,095 DEBUG Request 6CDEEF07 class:isReceivedVersionCorrect:1846 - isReceivedVersionCorrect(): successfull true
I 12:16:05.097 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,096 DEBUG Request 6CDEEF07 class:doPost:47 - daoService.isReceivedVersionCorrect(passedJSONArray.getJSONObject(0))
I 12:16:05.098 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,097 DEBUG Request 6CDEEF07 class:doPost:49 - passedJSONArray[1]
I 12:16:05.099 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,098 DEBUG Request 6CDEEF07 class:isReceivedJobEventValid:1962 - isReceivedJobEventValid(): starting
I 12:16:05.100 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,099 DEBUG Request 6CDEEF07 class:isReceivedJobEventValid:1965 - isReceivedJobEventValid(): try
I 12:16:05.101 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,100 DEBUG Request 6CDEEF07 class:isReceivedJobEventValid:1989 - DAOJobEvent() jobEvent.setParsingSuccessfull(true); DAOJobEvent [key=null, localID=95, jobID=5351674944159744, eventType=11, eventTime=Sun Mar 22 19:07:08 UTC 2015, latitude=53.325, longitude=-6.32569, notes=This job has been finished automatically by the phone, storedEventTime=Mon Mar 23 12:16:05 UTC 2015, companyID=6037653766012928, userID=6, nanoTime=3020586876124620, sequence=null]
I 12:16:05.102 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,101 DEBUG Request 6CDEEF07 class:isReceivedJobEventValid:1996 - DAOJobEvent() returning
I 12:16:05.103 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,102 DEBUG Request 6CDEEF07 class:getJob:706 - getJob(): starting
I 12:16:05.104 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,103 DEBUG Request 6CDEEF07 Cache:debug:58 - Level 1 Cache of type "soft" initialised
I 12:16:05.105 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,104 DEBUG Request 6CDEEF07 Persistence:debug:58 - Object Manager "[email protected]" opened for datastore "[email protected]" with txn="[email protected]"
I 12:16:05.107 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,106 DEBUG Request 6CDEEF07 Cache:debug:58 - Object with id "com.eurekaapp.server.dao.mappedobjects.DAOJob:5351674944159744" not found in Level 1 cache [cache size = 0]
I 12:16:05.108 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,107 DEBUG Request 6CDEEF07 Cache:debug:58 - Object with id "com.eurekaapp.server.dao.mappedobjects.DAOJob:5351674944159744" not found in Level 2 cache
I 12:16:05.109 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,108 DEBUG Request 6CDEEF07 Cache:debug:58 - Object "[email protected]" (id="com.eurekaapp.server.dao.mappedobjects.DAOJob:5351674944159744") added to Level 1 cache (loadedFlags="[NNNNNNNNNNNNNNNNNNNNYNNNNNNNNNNNNNNNNNNNNNNN]")
I 12:16:05.181 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,109 DEBUG Request 6CDEEF07 Lifecycle:debug:58 - Object "[email protected]" (id="com.eurekaapp.server.dao.mappedobjects.DAOJob:5351674944159744") has a lifecycle change : "HOLLOW"->"P_NONTRANS"
I 12:16:05.182 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,181 DEBUG Request 6CDEEF07 Connection:debug:58 - Created ManagedConnection using DatastoreService = [email protected]
I 12:16:05.183 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,182 DEBUG Request 6CDEEF07 Connection:debug:58 - Connection added to the pool : com.google.appengine.datanu[email protected]11de9d0 for [email protected] in factory=ConnectionFactory:nontx[[email protected]f2b4dc]
I 12:16:05.185 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,184 DEBUG Request 6CDEEF07 Connection:debug:58 - Connection found in the pool : com.google.appengine.datanu[email protected]11de9d0 for [email protected] in factory=ConnectionFactory:nontx[[email protected]f2b4dc]
I 12:16:05.186 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,185 DEBUG Request 6CDEEF07 Native:debug:58 - Getting entity of kind DAOJob with key DAOJob(5351674944159744)
I 12:16:05.196 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,195 DEBUG Request 6CDEEF07 Retrieve:debug:58 - Fetching object "[email protected]" (id=5351674944159744) fields [acceptStatus,check1,check2,check3,check4,check5,collectionAddress,companyID,containerCode,customerName,customerref,deliveryLatitude,deliveryLongitude,deliveryaddress,deliverytime,enumStatus,groupID,instructions,jobType,jobTypeID,key,lastmodified,localID,notes,parsingSuccessfull,quantity1,quantity2,quantity3,quantity4,ref1,ref2,ref3,ref4,ref5,required_ItemCount,required_Note,required_POD,required_Signature,required_SignatureName,trailerCode,uniqueField,userID,vehicleCode,weight]
I 12:16:05.197 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,196 DEBUG Request 6CDEEF07 Retrieve:debug:58 - Object "[email protected]" (id="5351674944159744") being retrieved from AppEngine
I 12:16:05.199 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,197 DEBUG Request 6CDEEF07 Persistence:debug:58 - Object "[email protected]" (id="com.eurekaapp.server.dao.mappedobjects.DAOJob:5351674944159744") is having the value in field "deliverytime" replaced by a SCO wrapper
I 12:16:05.200 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,199 DEBUG Request 6CDEEF07 Persistence:debug:58 - Object "[email protected]" (id="com.eurekaapp.server.dao.mappedobjects.DAOJob:5351674944159744") is having the value in field "lastmodified" replaced by a SCO wrapper
I 12:16:05.201 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,200 DEBUG Request 6CDEEF07 Connection:debug:58 - Connection found in the pool : com.google.appengine.datanu[email protected]11de9d0 for [email protected] in factory=ConnectionFactory:nontx[[email protected]f2b4dc] but owner object closing so closing connection
I 12:16:05.202 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,201 DEBUG Request 6CDEEF07 Connection:debug:58 - Connection removed from the pool : com.google.appengine.datanu[email protected]11de9d0 for [email protected] in factory=ConnectionFactory:nontx[[email protected]f2b4dc]
I 12:16:05.203 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,202 DEBUG Request 6CDEEF07 Persistence:debug:58 - Disconnecting [email protected] from StateManager[[email protected], lifecycle=P_NONTRANS]
I 12:16:05.204 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,203 DEBUG Request 6CDEEF07 Cache:debug:58 - Object with id="com.eurekaapp.server.dao.mappedobjects.DAOJob:5351674944159744" being removed from Level 1 cache [current cache size = 1]
I 12:16:05.205 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,204 DEBUG Request 6CDEEF07 Cache:debug:58 - Level 1 Cache cleared
I 12:16:05.206 [s~server-test-/17.383086902326406416].<stdout>: 12:16:05,205 DEBUG Request 6CDEEF07 Persistence:debug:58 - Object Manager "[email protected]" closed
-Любых предложения?
я вручную пошел в и обновленный двойных значения в хранилище данных 0.0 и сохраненный его. – Killesk
Нет, не работает. – Killesk
Установили ли вы тип «плавать» при обновлении этих значений? Кроме того, не забудьте очистить кеш. –