java.lang.NoSuchMethodError: org.springframework.faces.security.FaceletsAuthorizeTag.setIfAllGranted(Ljava/lang/String;)V

Spring JIRA | Christian Kleinewächter | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    NoSuchMethodError: FaceletsAuthorizeTag.setIfAllGranted

    Stack Overflow | 2 years ago | bwright
    java.lang.NoSuchMethodError: org.springframework.faces.security.FaceletsAuthorizeTag.setIfAllGranted(Ljava/lang/String;)V
  2. 0

    Using the sec:authorize tag from spring-faces 2.4.1 combined with spring-security 4.0.1 fails because the properties ifAnyGranted, ifAllGranted and ifNotGranted have been removed from spring-security. This happens even if these properties are not used: Example: {code} <sec:authorize access="hasRole('ROLE_FOO')" > <p:menuitem value="Protected" url="index.xhtml" icon="ui-icon-home" /> </sec:authorize> {code} leads to {code} java.lang.NoSuchMethodError: org.springframework.faces.security.FaceletsAuthorizeTag.setIfAllGranted(Ljava/lang/String;)V at org.springframework.faces.security.FaceletsAuthorizeTag.<init>(FaceletsAuthorizeTag.java:55) at org.springframework.faces.security.FaceletsAuthorizeTagHandler.apply(FaceletsAuthorizeTagHandler.java:74) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) {code} This happens because the constructor calls the removed methods on the parent: {code} public FaceletsAuthorizeTag(FaceletContext faceletContext, TagAttribute access, TagAttribute url, TagAttribute method, TagAttribute ifAllGranted, TagAttribute ifAnyGranted, TagAttribute ifNotGranted) { ... setIfAllGranted(getAttributeValue(faceletContext, ifAllGranted, true)); setIfAnyGranted(getAttributeValue(faceletContext, ifAnyGranted, true)); setIfNotGranted(getAttributeValue(faceletContext, ifNotGranted, true)); } {code}

    Spring JIRA | 2 years ago | Christian Kleinewächter
    java.lang.NoSuchMethodError: org.springframework.faces.security.FaceletsAuthorizeTag.setIfAllGranted(Ljava/lang/String;)V
  3. 0

    Using the sec:authorize tag from spring-faces 2.4.1 combined with spring-security 4.0.1 fails because the properties ifAnyGranted, ifAllGranted and ifNotGranted have been removed from spring-security. This happens even if these properties are not used: Example: {code} <sec:authorize access="hasRole('ROLE_FOO')" > <p:menuitem value="Protected" url="index.xhtml" icon="ui-icon-home" /> </sec:authorize> {code} leads to {code} java.lang.NoSuchMethodError: org.springframework.faces.security.FaceletsAuthorizeTag.setIfAllGranted(Ljava/lang/String;)V at org.springframework.faces.security.FaceletsAuthorizeTag.<init>(FaceletsAuthorizeTag.java:55) at org.springframework.faces.security.FaceletsAuthorizeTagHandler.apply(FaceletsAuthorizeTagHandler.java:74) at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95) at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203) at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120) at javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137) {code} This happens because the constructor calls the removed methods on the parent: {code} public FaceletsAuthorizeTag(FaceletContext faceletContext, TagAttribute access, TagAttribute url, TagAttribute method, TagAttribute ifAllGranted, TagAttribute ifAnyGranted, TagAttribute ifNotGranted) { ... setIfAllGranted(getAttributeValue(faceletContext, ifAllGranted, true)); setIfAnyGranted(getAttributeValue(faceletContext, ifAnyGranted, true)); setIfNotGranted(getAttributeValue(faceletContext, ifNotGranted, true)); } {code}

    Spring JIRA | 2 years ago | Christian Kleinewächter
    java.lang.NoSuchMethodError: org.springframework.faces.security.FaceletsAuthorizeTag.setIfAllGranted(Ljava/lang/String;)V
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoSuchMethodError

      org.springframework.faces.security.FaceletsAuthorizeTag.setIfAllGranted(Ljava/lang/String;)V

      at org.springframework.faces.security.FaceletsAuthorizeTag.<init>()
    2. org.springframework.faces
      FaceletsAuthorizeTagHandler.apply
      1. org.springframework.faces.security.FaceletsAuthorizeTag.<init>(FaceletsAuthorizeTag.java:55)
      2. org.springframework.faces.security.FaceletsAuthorizeTagHandler.apply(FaceletsAuthorizeTagHandler.java:74)
      2 frames
    3. JavaEE 7
      DelegatingMetaTagHandler.applyNextHandler
      1. javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:95)
      2. javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
      2 frames
    4. JSF
      ComponentTagHandlerDelegateImpl.apply
      1. com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:203)
      1 frame
    5. JavaEE 7
      DelegatingMetaTagHandler.applyNextHandler
      1. javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
      2. javax.faces.view.facelets.DelegatingMetaTagHandler.applyNextHandler(DelegatingMetaTagHandler.java:137)
      2 frames