Announcement Announcement Module
Collapse
No announcement yet.
ACL Configuration with SpEL - NullPointer Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ACL Configuration with SpEL - NullPointer

    Hello all,

    I'm fairly new to Spring (and Spring Security) - currently reading the unofficial book. (Excuses in advance )

    I tried setting up ACL for a dummy application, however - it does not seems to work ... I want to make use of the hasPermission() checks and SpEL.

    However, when I deploy this configuration/application on Tomcat7, I receive a NullPointer Exception.

    My application context: http://pastebin.com/tkHgbKWM
    The stacktrace: http://pastebin.com/6M4gFV4H

    Any ideas? What am I doing wrong? What am I missing?

    Thank you in advance,
    Maarten

  • #2
    The NullPointerException occurs when trying to initialize SortedResourcesFactoryBean for ResourceDatabasePopulator which is created with the embedded-database tag. I would double check that acl-schema.sql is available on the classpath.

    PS: In the future please post configuration and stacktraces to the forums using the code tags rather than using pastebin. This is preferred so that when others try to search the forums for answers it is more easily found.

    Comment


    • #3
      I believe the nullpointer was a missing maven dependency. I managed to get past it anyway.

      However, right now I receive a runtime Exception for my @PreAuthorize annotation
      "An Authentication object was not found in the SecurityContext"

      I think this exception is normal, however - I also believe it should turn into an access denied as soon as I configure anonymous authorization. I think I did this, but the exception is not going away.

      I attached my full project, to make it easier to look at my code/configuration.

      Any ideas?

      Kind regards,
      Maarten

      edit: I just wanted to point out that STS is complaining about deprecated warnings on my <http> namespace configuration.

      Comment


      • #4
        I managed to fix it after a long night of sleep.

        Didnt have a springSecurityFilterChain configured in my web.xml, once I did that - it all started working.

        Thank you all!
        Maarten

        Comment

        Working...
        X