java.lang.ClassCastException: java.sql.Timestamp cannot be cast to [Ljava.lang.Object; at java.text.MessageFormat.format(MessageFormat.java: 836)

  1. 0

    ClassCastException

    javaprogrammingforums.com | 3 months ago
    java.lang.ClassCastException: java.sql.Timestamp cannot be cast to [Ljava.lang.Object; at java.text.MessageFormat.format(MessageFormat.java: 836)
  2. 0

    ClassCastException when converting from String to Object.. why?

    Stack Overflow | 6 years ago | Adnan Bhatti
    java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;
  3. 0

    Hi, Working on some plugin dev for JIRA 5. Our UserVoice integration uses active objects. When [the AO 0.18.x Upgrade Guide|https://developer.atlassian.com/display/AO/AO+0.18.x+Upgrade+Guide] was documented last fall, we decided to wait until RC3 to refactor the couple of tables. This week I was able to begin said, as far as we can tell from the [removed types|https://developer.atlassian.com/display/AO/AO+0.18.x+Upgrade+Guide#AO0.18.xUpgradeGuide-RemovedTypes] section, we need to refactor instances of java.sql.Timestamp to instead use java.sql.Date with our ao Entity classes. This change appears pretty trivial, but we're running into ClassCastExceptions that appear to be generated by the AO library. This is when running the new code against a clean install. So, I'm wondering if there's something missing in my understanding of what you're expecting us to refactor? Here are some relevant code chunks: *The refactored entity that's having a problem* {code} package com.appfusions.jira.uservoice.entity; import java.sql.Date; import net.java.ao.Entity; import net.java.ao.Preload; @Preload public interface CommentMap extends Entity { long getJiraCommentId(); void setJiraCommentId(long id); int getUserVoiceMappingId(); void setUserVoiceMappingId(int id); Date getLastUpdateTime(); void setLastUpdateTime(Date time); } {code} *code that triggers the exception.* {code} CommentMap[] mappings = ao.find(CommentMap.class, "USER_VOICE_MAPPING_ID = ?", message.getId()); ... Object lastUpdateObj = mappings[0].getLastUpdateTime(); {code} *The Stack trace* {code} [INFO] [talledLocalContainer] 2012-01-31 12:07:47,015 ERROR [com.atlassian.jira.service.ServiceRunner] - <An error occured while trying to run service 'UserVoice Service'. java.sql.Timestamp cannot be cast to java.sql.Date> [INFO] [talledLocalContainer] java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.sql.Date [INFO] [talledLocalContainer] at $Proxy1422.getLastUpdateTime(Unknown Source) [INFO] [talledLocalContainer] at com.appfusions.jira.uservoice.manager.impl.DefaultUserVoiceTicketManager.isMappedMessageNewer(DefaultUserVoiceTicketManager.java:122) [INFO] [talledLocalContainer] at com.appfusions.jira.uservoice.service.sync.UserVoiceHelpdeskSyncController.doSync(UserVoiceHelpdeskSyncController.java:124) [INFO] [talledLocalContainer] at com.appfusions.jira.uservoice.service.UserVoiceSyncService.run(UserVoiceSyncService.java:44) [INFO] [talledLocalContainer] at com.atlassian.jira.service.JiraServiceContainerImpl.run(JiraServiceContainerImpl.java:61) {code} *We're setting the version of JIRA and the AO library version in the pom like so:* {code} <jira.version>5.0-rc3</jira.version> <ao.version>0.19.3</ao.version> {code} I chose 0.19.3 because that appears to be the latest version of the AO library. We have run atlas-clean and used a fresh data set, new configuration, etc. between tests, so I do not think it could be old tables. They are blown away every time. Oddly nothing bad seems to happen when we call setLastUpdateTime. Any ideas what we're doing wrong? Or is this a bug? Thanks!

    Ecosystem JIRA | 5 years ago | Laura Kolker [AppFusions]
    java.lang.ClassCastException: java.sql.Timestamp cannot be cast to java.sql.Date
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Entity with java.util.Date column gives ClassCastException in BIRT

    objectdb.com | 1 year ago
    java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Timestamp
  6. 0

    java.lang.ClassCastException: java.sql.Timestamp cannot be cast to org.apache.hadoop.hive.serde2.io.TimestampWritable at org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableTimestampObjectInspector.getPrimitiveJavaObject(WritableTimestampObjectInspector.java:38) at org.apache.hadoop.hive.serde2.objectinspector.primitive.WritableTimestampObjectInspector.getPrimitiveJavaObject(WritableTimestampObjectInspector.java:24) at com.mongodb.hadoop.hive.BSONSerDe.serializePrimitive(BSONSerDe.java:590) at com.mongodb.hadoop.hive.BSONSerDe.serializeObject(BSONSerDe.java:463) at com.mongodb.hadoop.hive.BSONSerDe.serializeStruct(BSONSerDe.java:532) at com.mongodb.hadoop.hive.BSONSerDe.serialize(BSONSerDe.java:451) at com.mongodb.hadoop.hive.BSONSerDeTest.helpSerialize(BSONSerDeTest.java:79) at com.mongodb.hadoop.hive.BSONSerDeTest.testDates(BSONSerDeTest.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:80) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:47) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355) at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)

    JIRA | 3 years ago | Justin Lee
    java.lang.ClassCastException: java.sql.Timestamp cannot be cast to org.apache.hadoop.hive.serde2.io.TimestampWritable

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      java.sql.Timestamp cannot be cast to [Ljava.lang.Object; at java.text.MessageFormat.format(MessageFormat.java: 836)

      at java.text.Format.format()
    2. Java RT
      Format.format
      1. java.text.Format.format(Format.java:140)
      1 frame