java.lang.IllegalAccessError

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.

  • I've created an application that tries to read entries from a MongoDB which were written with Log4j's NoSQL Appender. In a SpringBatch job which uses MongoItemReader the following query {code} { millis: { $gt : 1441000000 } } {code} causes this exception: Stacktrace: {code} java.lang.IllegalAccessError: tried to access class org.springframework.beans.PropertyMatches from class org.springframework.data.mapping.PropertyReferenceException at org.springframework.data.mapping.PropertyReferenceException.detectPotentialMatches(PropertyReferenceException.java:134) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyReferenceException.<init>(PropertyReferenceException.java:59) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:75) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.getPath(QueryMapper.java:843) ~[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.<init>(QueryMapper.java:735) ~[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.with(QueryMapper.java:746) ~[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.with(QueryMapper.java:692) ~[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedKeyword(QueryMapper.java:263) ~[QueryMapper.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObjectForField(QueryMapper.java:200) ~[QueryMapper.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObject(QueryMapper.java:123) ~[QueryMapper.class:?] at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1700) ~[spring-data-mongodb-1.8.0.RELEASE.jar:?] {code} When I patch the method getMappedKeyword as follows, the exception does not occur: {code} protected DBObject getMappedKeyword(Field property, Keyword keyword) { boolean needsAssociationConversion = property.isAssociation() && !keyword.isExists(); Object value = keyword.getValue(); Object convertedValue = value; // PATCH if (!isKeyword(keyword.getKey())) { convertedValue = needsAssociationConversion ? convertAssociation(value, property) : getMappedValue(property.with(keyword.getKey()), value); } return new BasicDBObject(keyword.key, convertedValue); } {code} Here's an excerpt from the batch configuration (full version: see attachment): {code} <bean id="itemReader" class="org.springframework.batch.item.data.MongoItemReader"> <property name="template" ref="mongoTemplate"/> <!-- This one causes the error --> <property name="query" value="{ millis: { $gt : 1441000000 } }"/> <!-- This one works --> <!-- <property name="query" value='{level: "INFO"}' /> --> <property name="sort> <map> <entry key="millis" value="#{T(org.springframework.data.domain.Sort.Direction).ASC}"/> </map> </property> <property name="collection" value="LOGGING"/> <property name="targetType" value="com.lpsolutions.springdatademo.domain.LogEntryEntity"/> </bean> {code}
    via by Stefan Kuehnel,
  • I've created an application that tries to read entries from a MongoDB which were written with Log4j's NoSQL Appender. In a SpringBatch job which uses MongoItemReader the following query {code} { millis: { $gt : 1441000000 } } {code} causes this exception: Stacktrace: {code} java.lang.IllegalAccessError: tried to access class org.springframework.beans.PropertyMatches from class org.springframework.data.mapping.PropertyReferenceException at org.springframework.data.mapping.PropertyReferenceException.detectPotentialMatches(PropertyReferenceException.java:134) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyReferenceException.<init>(PropertyReferenceException.java:59) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:75) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270) ~[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.getPath(QueryMapper.java:843) ~[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.<init>(QueryMapper.java:735) ~[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.with(QueryMapper.java:746) ~[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.with(QueryMapper.java:692) ~[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedKeyword(QueryMapper.java:263) ~[QueryMapper.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObjectForField(QueryMapper.java:200) ~[QueryMapper.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObject(QueryMapper.java:123) ~[QueryMapper.class:?] at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1700) ~[spring-data-mongodb-1.8.0.RELEASE.jar:?] {code} When I patch the method getMappedKeyword as follows, the exception does not occur: {code} protected DBObject getMappedKeyword(Field property, Keyword keyword) { boolean needsAssociationConversion = property.isAssociation() && !keyword.isExists(); Object value = keyword.getValue(); Object convertedValue = value; // PATCH if (!isKeyword(keyword.getKey())) { convertedValue = needsAssociationConversion ? convertAssociation(value, property) : getMappedValue(property.with(keyword.getKey()), value); } return new BasicDBObject(keyword.key, convertedValue); } {code} Here's an excerpt from the batch configuration (full version: see attachment): {code} <bean id="itemReader" class="org.springframework.batch.item.data.MongoItemReader"> <property name="template" ref="mongoTemplate"/> <!-- This one causes the error --> <property name="query" value="{ millis: { $gt : 1441000000 } }"/> <!-- This one works --> <!-- <property name="query" value='{level: "INFO"}' /> --> <property name="sort> <map> <entry key="millis" value="#{T(org.springframework.data.domain.Sort.Direction).ASC}"/> </map> </property> <property name="collection" value="LOGGING"/> <property name="targetType" value="com.lpsolutions.springdatademo.domain.LogEntryEntity"/> </bean> {code}
    via by Stefan Kuehnel,
  • IllegalAccessError Query Mongodb
    via Stack Overflow by http200
    ,
    • java.lang.IllegalAccessError: tried to access class org.springframework.beans.PropertyMatches from class org.springframework.data.mapping.PropertyReferenceException at org.springframework.data.mapping.PropertyReferenceException.detectPotentialMatches(PropertyReferenceException.java:134)[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyReferenceException.<init>(PropertyReferenceException.java:59)[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.<init>(PropertyPath.java:75)[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:327)[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.create(PropertyPath.java:307)[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mapping.PropertyPath.from(PropertyPath.java:270)[spring-data-commons-1.11.0.RELEASE.jar:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.getPath(QueryMapper.java:843)[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.<init>(QueryMapper.java:735)[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.with(QueryMapper.java:746)[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper$MetadataBackedField.with(QueryMapper.java:692)[QueryMapper$MetadataBackedField.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedKeyword(QueryMapper.java:263)[QueryMapper.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObjectForField(QueryMapper.java:200)[QueryMapper.class:?] at org.springframework.data.mongodb.core.convert.QueryMapper.getMappedObject(QueryMapper.java:123)[QueryMapper.class:?] at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1700)[spring-data-mongodb-1.8.0.RELEASE.jar:?]

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    2 more bugmates