eclipse - Spring Security ACL Domains Error: The type xxx is already defined -
i using eclipse, grails 2.4.5 , spring security acl plugin. created domain classes manage acl data command:
s2-create-acl-domains
after these domains have been generated eclipse reports classes have been defined.
the error log shows:
in buildconfig.groovy
have:
compile ":spring-security-core:2.0-rc5" runtime ':spring-security-acl:2.0-rc2'
is there way fix eclipse not show errors? beside error code running fine.
edit: here classes generated grails s2-create-acl-domains
. did not change except in aclobjectidentity
objectid type long string.
here classes have been generated:
aclclass
:
package grails.plugin.springsecurity.acl class aclclass { string classname @override string tostring() { "aclclass id $id, classname $classname" } static mapping = { classname column: 'class' version false } static constraints = { classname unique: true, blank: false } }
aclobjectidentity
:
package grails.plugin.springsecurity.acl class aclobjectidentity extends abstractaclobjectidentity { string objectid @override string tostring() { "aclobjectidentity id $id, aclclass $aclclass.classname, " + "objectid $objectid, entriesinheriting $entriesinheriting" } static mapping = { version false aclclass column: 'object_id_class' owner column: 'owner_sid' parent column: 'parent_object' objectid column: 'object_id_identity' } static constraints = { objectid unique: 'aclclass' } }
aclsid
:
package grails.plugin.springsecurity.acl class aclsid { string sid boolean principal @override string tostring() { "aclsid id $id, sid $sid, principal $principal" } static mapping = { version false } static constraints = { principal unique: 'sid' sid blank: false, size: 1..255 } }
aclentry
:
package grails.plugin.springsecurity.acl class aclentry { aclobjectidentity aclobjectidentity int aceorder aclsid sid int mask boolean granting boolean auditsuccess boolean auditfailure @override string tostring() { "aclentry id $id, aceorder $aceorder, mask $mask, granting $granting, " + "aclobjectidentity $aclobjectidentity" } static mapping = { version false sid column: 'sid' aclobjectidentity column: 'acl_object_identity' } static constraints = { aceorder unique: 'aclobjectidentity' } }
edit: still have no solution problem!!!
groovy has 2 ways treat .groovy file:
- as script : in case can not have class same name file. can recognize script file, if there code outside class statement in file (other imports), script
- as class definition file: of course in java have class definition same name file.
what happening in script case if there code executed in file groovy needs containing class code. groovy implicitly create containing class name of file.
so if have file called aclentry.groovy has code in isn't inside class definition, groovy create implicit containing class called aclentry. means script file aclentry.groovy can not contain class called aclentry because duplicate class definition, error.
if, on other hand, in file aclentry.groovy define class aclentry (and number of other classes), groovy treat file collection of class definitions, there no implicit containing class, , there no problem having class called aclentry inside class definition file aclentry.groovy.
you might want check if case in groovy files.
Comments
Post a Comment