Sunday, 15 September 2013

java - "Cycle found" with Spring Data Mongo 1.5 -



java - "Cycle found" with Spring Data Mongo 1.5 -

i have project running spring info mongodb 1.4.2. tried update 1.5.0 , error during autowiring (extract) :

caused by: org.springframework.data.mongodb.core.index.mongopersistententityindexresolver$cyclicpropertyreferenceexception: found cycle field 'rules' in type 'filter' path 'filter.rules' @ org.springframework.data.mongodb.core.index.mongopersistententityindexresolver$cycleguard.protect(mongopersistententityindexresolver.java:370) ~[spring-data-mongodb-1.5.0.release.jar:na] @ org.springframework.data.mongodb.core.index.mongopersistententityindexresolver$2.dowithpersistentproperty(mongopersistententityindexresolver.java:144) ~[spring-data-mongodb-1.5.0.release.jar:na] @ org.springframework.data.mongodb.core.index.mongopersistententityindexresolver$2.dowithpersistentproperty(mongopersistententityindexresolver.java:138) ~[spring-data-mongodb-1.5.0.release.jar:na] @ org.springframework.data.mapping.model.basicpersistententity.dowithproperties(basicpersistententity.java:294) ~[spring-data-commons-1.8.0.release.jar:na]

i have repository "rulesdao" extending "mongorepository". manages entity named "rule". entity has basic fields , "filter" field. , filter class contains list of filter (which can empty).

@document(collection="rules") public class rule { @id private string id; private string name; // other fields private filter filter; } public class filter { // groups private string condition; private list<filter> rules = new arraylist<filter>(); // query private string field; private string value; }

("rules" not perfect name, has named way mvc binding)

so filter.rules property interpreted cycle isn't ! (well in understanding of term "cycle")

is bug in release or there new "flag" usecase ?

thanks

for background story, filter class can either leaf or node of tree used build complex criteria, builded json of jquery plugin of mines http://mistic100.github.io/jquery-querybuilder

the given types contain strcuture potentially causing infinite loops while trying resolve index info and/or reading values store. during startup domain types generic type info of collections inspected. points out cycle mentioned in resulting error.

rule -> filter -> filter.rules ^ | | | +----------------+

though error should not prevent container starting - should printed log. maybe addtionally ran datamongo-949 , want give current 1.5.1-snapshot spin.

please sense free open ticket.

java spring spring-data spring-data-mongodb

No comments:

Post a Comment