java.lang.IllegalArgumentException: Column metaclass does not exist in table users

DataStax JIRA | Alexandre Dutra | 3 months ago
  1. 0

    From the [user mailing list|https://groups.google.com/a/lists.datastax.com/d/msg/java-driver-user/Hlf907jcWk0/CyXO2HGKCAAJ]: bq. We implement our @Table mappings as Groovy classes. This has worked fine with previous releases of the MappingManager thru release 3.0.3. With the latest 3.1.0 release, it appears MappingManager requires there to be a column defined for the Groovy MetaClass property. Comparing the source between 3.0.3 and 3.1.0, it looks like reflective inspection of the entity class has changed considerably within com.datastax.driver.mapping.AnnotationParser#parseEntity. The new 3.1.0 source utilizes com.datastax.driver.mapping.ReflectionUtils.scanFieldsAndProperties which picks up the MetaClass property. Creation of the Mapper fails since the actual table metadata does not include a corresponding column for the Groovy class's MetaClass. Indeed, a simple class such as {code} @Table(name = "users") class User { @PartitionKey @Column(name = "user_id") def UUID userId def String name } {code} Will fail with: {code} Exception in thread "main" java.lang.IllegalArgumentException: Column metaclass does not exist in table users at com.datastax.driver.mapping.AnnotationParser.parseEntity(AnnotationParser.java:131) at com.datastax.driver.mapping.MappingManager.getMapper(MappingManager.java:226) at com.datastax.driver.mapping.MappingManager.mapper(MappingManager.java:182) at com.datastax.driver.mapping.MappingManager$mapper.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125) at com.datastax.driver.mapping.User.main(User.groovy:42) {code} This is because Groovy adds a {{metaClass}} property to Groovy classes. The most simple fix is to explicitly exclude this property in {{ReflectionUtils}}. In the meanwhile, the following workaround seems to work: {code} @Transient def MetaClass metaClass = super.metaClass; {code}

    DataStax JIRA | 3 months ago | Alexandre Dutra
    java.lang.IllegalArgumentException: Column metaclass does not exist in table users
  2. 0

    Select all from one alias does not work

    GitHub | 5 months ago | vania-pooh
    java.lang.IllegalArgumentException: Table "i" does not exist
  3. 0

    Unable to populate data in listView from Database in Android

    Stack Overflow | 2 years ago
    java.lang.IllegalArgumentException: column '_id' does not exist
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    The column '_id' does not exist

    Stack Overflow | 2 years ago
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.drox.codesync/com.example.drox.codesync.MainScreenActivity}: java.lang.IllegalArgumentException: column '_id' does not exist
  6. 0

    how to access contacts in my android program

    Stack Overflow | 5 years ago | sajith
    java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=0, result=-1, data=Intent { dat=content://com.android.contacts/contacts/lookup/0r1-512D3F3D533B/1 flg=0x1 (has extras) }} to activity {task.list/task.list.Msgactivity}: java.lang.IllegalArgumentException: column 'data1' does not exist

    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.IllegalArgumentException

      Column metaclass does not exist in table users

      at com.datastax.driver.mapping.AnnotationParser.parseEntity()
    2. com.datastax.driver
      MappingManager$mapper.call
      1. com.datastax.driver.mapping.AnnotationParser.parseEntity(AnnotationParser.java:131)
      2. com.datastax.driver.mapping.MappingManager.getMapper(MappingManager.java:226)
      3. com.datastax.driver.mapping.MappingManager.mapper(MappingManager.java:182)
      4. com.datastax.driver.mapping.MappingManager$mapper.call(Unknown Source)
      4 frames
    3. Groovy
      AbstractCallSite.call
      1. org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
      2. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
      3. org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
      3 frames
    4. com.datastax.driver
      User.main
      1. com.datastax.driver.mapping.User.main(User.groovy:42)
      1 frame