java.lang.IllegalArgumentException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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}
    via by Alexandre Dutra,
    • 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)
    No Bugmate found.