2013-04-24 2 views
0

Spring 3.2 기반 애플리케이션에서 Perf4j를 설정해야합니다. 나는 다음 봄 XML 구성 내용이 있습니다Perf4j Spring beans의 Profiled annotation ... jmsConnectionFactory의 오류

Exception sending context initialized event to listener instance of class 
    org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsTemplate' defined in class path resource [service-common-context.xml]: Cannot resolve reference to bean 'jmsConnectionFactory' while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsConnectionFactory': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: error Type referred to is not an annotation type: org.perf4j.aop.Profiled 

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jmsConnectionFactory': Post-processing of the FactoryBean's object failed; nested exception is java.lang.IllegalArgumentException: error Type referred to is not an annotation type: org.perf4j.aop.Profiled 
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:165) [spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] 
    at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:102) [spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1443) [spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:249) [spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] 
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194) [spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] 
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:323) [spring-beans-3.2.0.RELEASE.jar:3.2.0.RELEASE] 

프로파일 링 주석이 : 나는 7.1.0.Final AS JBoss에서의 응용 프로그램을 배포 다음과 같은 오류가

<?xml version="1.0" encoding="UTF-8"?> 
<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:p="http://www.springframework.org/schema/p" 
xmlns:aop="http://www.springframework.org/schema/aop" 
xmlns:jee="http://www.springframework.org/schema/jee" 
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd 
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.1.xsd 
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd 
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> 

<context:component-scan base-package="com.xxx.yyy.services" /> 

<jee:jndi-lookup id="jmsConnectionFactory" jndi-name="java:/JmsXA" lookup-on-startup="true"/> 

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate"> 
    <property name="connectionFactory" ref="jmsConnectionFactory"/> 
    <property name="deliveryPersistent" value="false"/> 
    <property name="receiveTimeout" value="30000"/> 
</bean> 

<bean id="eventConsumer" class="com.motive.kmp.event.JmsEventConsumer"/> 

<bean id="eventProducer" class="com.motive.kmp.event.JmsEventProducer"> 
    <constructor-arg ref="jmsTemplate"/> 
</bean> 


<aop:aspectj-autoproxy> 
     <aop:include name="timingAspect" /> 
</aop:aspectj-autoproxy> 

<bean id="timingAspect" class="org.perf4j.slf4j.aop.TimingAspect" /> 

을 서비스 bean 메소드에 적용됩니다. Profiled 주석이 실제로 사용되는 Bean 목록을 지정하는 방법이 있습니까?

미리 감사드립니다.

답변

0

JMS 자원에 대한 jee : jndi-lookup 정의를 변경 한 후 : 프록시 인터페이스를 지정하면 문제가 해결됩니다.

<jee:jndi-lookup id="jmsConnectionFactory" 
       jndi-name="java:/JmsXA" 
       lookup-on-startup="true" 
       proxy-interface="javax.jms.ConnectionFactory"/> 
관련 문제