自定义注解日志功能与shrio框架冲突的问题

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:tx="http://www.springframework.org/schema/tx" xmlns:mvc="http://www.springframework.org/schema/mvc"
        xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                http://www.springframework.org/schema/aop
        http://www.springframework.org/schema/aop/spring-aop-4.0.xsd 
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.3.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.3.xsd">
    <context:component-scan base-package="com.keduox.lobs.action" />
        <aop:aspectj-autoproxy />   
             
    <mvc:annotation-driven>
        <mvc:message-converters>
            <bean class="org.springframework.http.converter.StringHttpMessageConverter">
                <property name="defaultCharset" value="UTF-8" />
            bean>
            <bean
                class="com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter4" />
        mvc:message-converters>
    mvc:annotation-driven>

    <mvc:default-servlet-handler />
    <bean id="fastJsonpResponseBodyAdvice"
        class="com.alibaba.fastjson.support.spring.FastJsonpResponseBodyAdvice">
        <constructor-arg>
            <list>
                <value>callbackvalue>
                <value>jsonpvalue>
            list>
        constructor-arg>
    bean>
        
    <bean id="viewResolver"
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        
        <property name="prefix" value="/WEB-INF/" />
        
        <property name="suffix" value=".jsp" />
    bean>
     
    <mvc:resources location="/css/" mapping="/css/**" />
    <mvc:resources location="/js/" mapping="/js/**" />
    <mvc:resources location="/images/" mapping="/images/**" />
    
         



     
    
      
    

    
    
    <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor">bean>
    
       
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">  
        <property name="securityManager" ref="securityManager"/>  
    bean> 
    
    
    
    
    <bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor">
        <property name="proxyTargetClass" value="true" />
    bean>
    <bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
        <property name="securityManager" ref="securityManager" />
    bean>

    <bean id="exceptionHandler" class="com.keduox.lobs.handler.BaseExceptionHandler"/>  
 
beans>
        

在这个配置文件中

原本

 
      是没有注释掉的

 

如果使用自定义注解那么就要启用

 
但是启用这个之后shiro就不能正常工作了
后来发现是:AspectJ与Shiro不兼容和Spring二次代理错误的问题
解决办法在下面的博客链接中
http://alanli7991.github.io/2016/10/21/%E5%88%87%E9%9D%A2%E7%BC%96%E7%A8%8B%E4%B8%89AspectJ%E4%B8%8EShiro%E4%B8%8D%E5%85%BC%E5%AE%B9%E5%92%8CSpring%E4%BA%8C%E6%AC%A1%E4%BB%A3%E7%90%86%E9%94%99%E8%AF%AF%E5%88%86%E6%9E%90/?utm_source=tuicool&utm_medium=referral

http://www.tuicool.com/articles/NRBraev

转载于:https://www.cnblogs.com/rocky-AGE-24/p/7053338.html

你可能感兴趣的:(自定义注解日志功能与shrio框架冲突的问题)