Q:

Spring-Security sec:authorize Tag is not working

I recently updated a Springsource-Project to get it working on Tomcat7 and Hibernate 3.5.x.
It seems that it's almost done, but when I get to a jsp-Page where the sec:authorize Tag is defined, an exception is thrown:
> Jul 22, 2014 12:42:42 PM org.apache.catalina.core.StandardWrapperValve
> invoke Schwerwiegend: Servlet.service() for servlet [partsorder] in
> context with path [/partsorder] threw exception
> [/WEB-INF/jsp/application/details.jsp (line: 157, column: 0) Unable to
> load tag handler class
> "org.springframework.security.taglibs.authz.AuthorizeTag" for tag
> "sec:authorize"] with root cause org.apache.jasper.JasperException:
> /WEB-INF/jsp/application/details.jsp (line: 157, column: 0) Unable to
> load tag handler class
> "org.springframework.security.taglibs.authz.AuthorizeTag" for tag
> "sec:authorize"   at
> org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:42)
>   at
> org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:443)
>   at
> org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:199)
>   at org.apache.jasper.compiler.Parser.parseCustomTag(Parser.java:1226)
>   at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1452)
>   at org.apache.jasper.compiler.Parser.parse(Parser.java:138)     at
> org.apache.jasper.compiler.ParserController.doParse(ParserController.java:242)
>   at
> org.apache.jasper.compiler.ParserController.parse(ParserController.java:102)
>   at
> org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)
>   at org.apache.jasper.compiler.Compiler.compile(Compiler.java:373)   at
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:353)    at
> org.apache.jasper.compiler.Compiler.compile(Compiler.java:340)    at
> org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:657)
>   at
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:357)
>   at
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
>   at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
>   at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>   at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
>   at
> org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:748)
>   at
> org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:486)
>   at
> org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:411)
>   at
> org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:338)
>   at
> org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:209)
>   at
> org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:267)
>   at
> org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1225)
>   at
> org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1012)
>   at
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
>   at
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
>   at
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
>   at
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:852)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:620)     at
> org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)     at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
>   at
> org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
>   at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
>   at
> org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:177)
>   at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
>   at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
>   at
> org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
>   at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
>   at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
>   at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
>   at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
>   at
> org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
>   at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   at
> org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
>   at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   at
> org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103)
>   at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   at
> org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)
>   at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   at
> org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154)
>   at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   at
> org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)
>   at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   at
> org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:94)
>   at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   at
> org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)
>   at
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
>   at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   at
> org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
>   at
> org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
>   at
> org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
>   at
> org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
>   at
> org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
>   at
> org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
>   at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
>   at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
>   at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
>   at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
>   at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
>   at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
>   at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
>   at
> com.bmw.authenticator.extranet.catalina.ExtranetValve.invoke(ExtranetValve.java:175)
>   at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
>   at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
>   at
> org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
>   at
> org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
>   at
> org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2441)
>   at
> org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2430)
>   at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>   at java.lang.Thread.run(Thread.java:745)

my dependencies:
    <hibernateEjb3PersistenceVersion>1.0.2.GA</hibernateEjb3PersistenceVersion>
    <hibernateEntityManagerVersion>3.6.5.Final</hibernateEntityManagerVersion>
    <hibernateValidatorVersion>5.0.3.Final</hibernateValidatorVersion>
    <hibernateVersion>3.5.4-Final</hibernateVersion>
    <hibernateCoreVersion>3.6.5.Final</hibernateCoreVersion>
    <hsqldbVersion>1.8.0.10</hsqldbVersion>
    <httpUnitVersion>1.6.2</httpUnitVersion>
    <javaxMailVersion>1.4.1</javaxMailVersion>
    <!-- javaxPersistenceVersion>1.0.1.Final</javaxPersistenceVersion> -->
    <javaxValidationVersion>1.1.0.Final</javaxValidationVersion>
    <jasperVersion>7.0.34</jasperVersion><!-- 6.0.18 -->
    <jettyVersion>6.1.16</jettyVersion>
    <junitVersion>4.7</junitVersion>
    <log4jVersion>1.2.15</log4jVersion>
    <mavenSurefirePluginVersion>2.4.3</mavenSurefirePluginVersion>
    <mavenJettyPluginVersion>6.1.15</mavenJettyPluginVersion>
    <oracleJdbcDriverVersion>10.2.0.3.0</oracleJdbcDriverVersion>
    <slf4jJclVersion>1.6.1</slf4jJclVersion>
    <springVersion>4.0.2.RELEASE</springVersion>
    <springJsVersion>2.4.0.RELEASE</springJsVersion>
    <springSecurityVersion>3.2.4.RELEASE</springSecurityVersion>
    <xalanVersion>2.7.0</xalanVersion>
    <servletApiVersion>3.1.0</servletApiVersion>
    <jspApiVersion>2.2</jspApiVersion>
    <jstlVersion>1.2</jstlVersion>
    <taglibsVersion>1.1.2</taglibsVersion>
    <elVersion>2.2.4</elVersion>

Can someone help me out?

A:

Ok looks like i have cleared the issue:
i edited the security.tld:
instead of:
<tag>
    <name>authorize</name>
    <tag-class>org.springframework.security.taglibs.authz.AuthorizeTag</tag-class>
    <description>
        A tag which outputs the body of the tag if the configured access expression
        evaluates to true for the currently authenticated principal.
    </description>

I have changed the tag-class to:
<tag-class>org.springframework.security.taglibs.authz.JspAuthorizeTag</tag-class>

this works fine for me, as for now the sec:authorize tab is recognized.

