Announcement Announcement Module
Collapse
No announcement yet.
NotFoundException from JDBCMutableAclService.createAcl.. unable to find cause Page Title Module
Move Remove Collapse
This topic is closed
X
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NotFoundException from JDBCMutableAclService.createAcl.. unable to find cause

    Hello,

    I've been working on this task for too long to abandon the idea of using Spring Security to achieve it, but I wish that the community will provide with some support that will help reduce the regret that I have for choosing Spring Security. Enough ranting and now let's get to the point.

    I'm trying to create an ACL by using JDBCMutableAclService.createAcl as follows:

    Code:
    	public void addPermission(IWFArtifact securedObject, Sid recipient, Permission permission,
    			Class clazz) {
    		ObjectIdentity oid = new ObjectIdentityImpl(clazz.getCanonicalName(), securedObject.getId());
    		this.addPermission(oid, recipient, permission);
    	}
    	
    	@Override
    	@Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.READ_UNCOMMITTED, readOnly = false)
    	public void addPermission(ObjectIdentity oid, Sid recipient, Permission permission) {
    		SpringSecurityUtils.assureThreadLocalAuthSet();
    		
    		MutableAcl acl;
    		
    		try {
    			acl = this.mutableAclService.createAcl(oid);
    		} catch (AlreadyExistsException e) {
    			acl = (MutableAcl) this.mutableAclService.readAclById(oid);
    		}
    // try {
    // acl = (MutableAcl) this.mutableAclService.readAclById(oid);
    // } catch (NotFoundException nfe) {
    // acl = this.mutableAclService.createAcl(oid);
    // }
    		
    		acl.insertAce(acl.getEntries().length, permission, recipient, true);
    		this.mutableAclService.updateAcl(acl);
    		
    	}
    The call throws a NotFoundException from the line:
    Code:
            // Retrieve the ACL via superclass (ensures cache registration, proper retrieval etc)
            Acl acl = readAclById(objectIdentity);
    I believe this is caused by something related to Transactional, and that's why I have tested with many TransactionDefinition attributes. I have also doubted the annotation and tried with declarative transaction definition, but still with no luck.

    One important point is that I have used the statement used to insert the oid in the database earlier in the method directly on the database and it worked, and also threw a unique constraint exception at me when it tried to insert it in the method.

    I'm using Spring Security 2.0.8 and IceFaces 1.8 (which doesn't support spring 3.0 but definetely supprorts 2.0.x, specially when I keep caling SpringSecurityUtils.assureThreadLocalAuthSet()). My AppServer is Tomcat 6.0, and my DB Server is MySQL 6.0

    I wish to get back a reply soon because I need to get this task off my way

  • #2
    Any help people!! PLEASE!!

    Comment


    • #3
      Post the full stack trace - of course the exact line you indicate wouldn't throw an exception, so we won't be able to determine what's wrong. Have you stepped through this code in a debugger?

      Comment


      • #4
        Yes I did trace the application in a debugger. I am trying get you the stack trace, but now it doesn't even get to that line and crashes in the one before it
        Code:
        // Create the acl_object_identity row
                createObjectIdentity(objectIdentity, sid);
        complaining that the procedure identity doesn't exist in my database... which is true.. but why does it need it while I am using MySQL, and an autoincrement field, not PostgreSQL.

        Comment


        • #5
          Mask XX does not have a registered permission

          Originally posted by pmularien View Post
          Post the full stack trace - of course the exact line you indicate wouldn't throw an exception, so we won't be able to determine what's wrong. Have you stepped through this code in a debugger?
          pmularein,

          Thank you very much for your attention and reply, but unfortunately I can't get you the stack trace.. things go quite differently now, from one error to another and I don't know what is happening but I am fixing those errors as they appear.. I really have no idea how could the same program run so differntly like this... that is really bad!


          The problem that I'm stuck at right now is that I call registerPermissionsForClass(MyClassWithCustomPermi ssions.class) and I see that it registers them but then it complains that the mask doesn't have a registered permission when it is doing CreateFromInt for one of my custom permissions. Any clues about that? Is it a compatibility issue with IceFaces?

          I am totally confused and would appreciate any clues!

          Comment


          • #6
            From problem to problem and now I got it running but not working

            Hello, I just wanted to say that this thread could be closed because I've kept solviong one strange problem after the other, and now I got it running BUT NOR WORKING AS IT SHOULD.. my current problem is one that I couldn't solve and it has its own thread:
            http://forum.springsource.org/showth...118#post300118

            Comment

            Working...
            X