1

Spring 管理の JSF Bean に AOP を適用しようとしていますが、何らかの理由で AOP JSF を適用するとすぐに MethodNotFoundException がスローされます。

ここに私のコードがあります: Web.xml

<application>
<default-render-kit-id>org.apache.myfaces.trinidad.core</default-render-kit-id>
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>    
</application>

applicationContext.xml

 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:security="http://www.springframework.org/schema/security"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:aop="http://www.springframework.org/schema/aop"
 xmlns:tx="http://www.springframework.org/schema/tx"
 xsi:schemaLocation="http://www.springframework.org/schema/beans    
 http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
 http://www.springframework.org/schema/aop  
 http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
 http://www.springframework.org/schema/tx  
 http://www.springframework.org/schema/tx/spring-tx-3.2.xsd">

<aop:aspectj-autoproxy/>
 <bean id="loginAuditAspect" class="com.test.mobile.service.LoginAuditManagementAspect">
 <constructor-arg index="0">
<list>
<bean class="com.test.mobile.service.LoginAuditableResourceResolver" />
<bean class="com.test.mobile.service.LoggedInAuditableResourceResolver" />
<bean class="com.test.mobile.service.NavigationAuditableResourceResolver" />
</list>
</constructor-arg>
</bean>

   <bean id="loginService" class="com.test.mobile.service.MLoginServiceImpl" />  
   <bean id="memberService" class="com.test.mobile.service.MMemberServiceImpl" 
         scope="session">
    <property name="thpContext" ref="thpContext"></property>
    </bean> 

  <bean id="mMemberProfileBean" class="com.test.mobile.service.MMemberProfileBean" 
        scope="session">
  <property name="memberService" ref="memberService"></property>
  </bean>

  <bean id="testBean" class="com.test.mobile.service.TestBean" scope="session">
  </bean>
  </beans>

バッキング Bean:

 public class TestBean extends BaseBackingBean {
   private static final long serialVersionUID = 1L; 

   @Auditable(resourceName="LoggedIn",      
 resourceResolverClass=com.test.mobile.service.LoggedInAuditableResourceResolver.class)
public String getXxx() {

    return null;
}

}

春に管理されたJSF BeanにAOPロジックを適用するのを手伝ってくれる人はいますか

4

1 に答える 1

0

スタック トレースとアスペクトに関する情報を少なくとも投稿する必要があります。ただし、アスペクトを適用するだけでメソッドが失われている場合は、次を試してください。

<aop:aspectj-autoproxy proxy-target-class="true"/>

これは、CGLIB を使用して、jdk プロキシ (プロキシ インターフェイスのみ) の代わりにクラスをプロキシします。

于 2013-01-18T18:24:44.310 に答える