Announcement Announcement Module
Collapse
No announcement yet.
probleme when adding aop in my application context Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • probleme when adding aop in my application context

    Hi everybody i have probleme when adding aop in my application context !!!

    applicationContext.xml of spring :
    Code:
    <?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:aop="http://www.springframework.org/schema/aop"
    	xmlns:tx="http://www.springframework.org/schema/tx"
    	xmlns:jaxws="http://cxf.apache.org/jaxws"
    	xsi:schemaLocation="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.xsd
    		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
    		http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
    
    
    
    	  <jaxws:client id="HWclient"
    	         serviceClass="services.HelloWorld"
    	         address="http://localhost:63081/hello">
    	  </jaxws:client>
    	  
    
    	  
    	          
    	<bean name="/LoginAction" class="Struts.LoginAction">
    		<property name="wsservice" ref="WsService"></property>
    		<property name="HWclient" ref="HWclient"></property>
    	</bean>
    	
       	<bean id="WsService" 
                    class="DamService.WsServiceImp" >  
       		<property name="wsdao" ref="wsdao" />
       	</bean>	
    
    
       	<bean id="wsdao" 
                    class="DamDAO.WsDaoImp" >
       		<property name="hibernateTemplate"  ref="hibernateTemplate"></property>
       	</bean>
    	 
    	<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">
    		<property name="sessionFactory" ref="sessionFactory" />
    	</bean>
    	
    	<bean id="sessionFactory"
    		class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    		<property name="configLocation" value="classpath:hibernate.cfg.xml">
    		</property>
    	</bean>	   	
    
       <bean id="txManager"
             class="org.springframework.orm.hibernate3.HibernateTransactionManager">
         <property name="sessionFactory" ref="sessionFactory" />
       </bean>
        
       <tx:advice id="serviceTxAdvice" transaction-manager="txManager">
         <tx:attributes>
           <tx:method name="find*" propagation="REQUIRED" read-only="true" />
           <tx:method name="save*" propagation="REQUIRED" />
           <tx:method name="*" propagation="REQUIRED" />
         </tx:attributes>
       </tx:advice>
       
       <aop:config >
         <aop:pointcut id="serviceMethods"
             expression="execution(*DamService.*ServiceImp.*(..))" />
         <aop:advisor advice-ref="serviceTxAdvice" pointcut-ref="serviceMethods" />
       </aop:config>
       	
    		 	
    </beans>
    exception :

    Code:
    avr. 13, 2012 1:07:10 AM org.apache.catalina.core.StandardContext listenerStart
    Grave: Exception lors de l'envoi de l'évènement contexte initialisé (context initialized) à l'instance de classe d'écoute (listener) org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'HWclient': BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Cannot resolve reference to bean 'serviceMethods' while setting bean property 'pointcut'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceMethods': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/BCException
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:452)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
    	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:567)
    	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
    	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
    	at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:282)
    	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:204)
    	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
    	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
            ....
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.support.DefaultBeanFactoryPointcutAdvisor#0': Cannot resolve reference to bean 'serviceMethods' while setting bean property 'pointcut'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceMethods': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/BCException
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
    	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
    ......
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:848)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.resolveBeforeInstantiation(AbstractAutowireCapableBeanFactory.java:820)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:446)
    	... 20 more
    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceMethods': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: org/aspectj/weaver/BCException
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:965)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:911)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:485)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:312)
    	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
    	at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
    	... 36 more
    Caused by: java.lang.NoClassDefFoundError: org/aspectj/weaver/BCException
    	at java.lang.Class.getDeclaredConstructors0(Native Method)
    	at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    	at java.lang.Class.getConstructor0(Unknown Source)
    	at java.lang.Class.getDeclaredConstructor(Unknown Source)
    	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:65)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:958)
    	... 42 more
    Caused by: java.lang.ClassNotFoundException: org.aspectj.weaver.BCException
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)
    	at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
    	... 48 more
    
    avr. 13, 2012 1:07:10 AM org.apache.catalina.core.StandardContext startInternal
    Grave: Error listenerStart
    avr. 13, 2012 1:07:10 AM org.apache.catalina.core.StandardContext startInternal
    Grave: Erreur de démarrage du contexte [/Beta] suite aux erreurs précédentes
    avr. 13, 2012 1:07:10 AM org.apache.catalina.core.ApplicationContext log
    Infos: Closing Spring root WebApplicationContext
    avr. 13, 2012 1:07:10 AM org.apache.coyote.AbstractProtocol start
    Infos: Starting ProtocolHandler ["http-bio-8081"]
    avr. 13, 2012 1:07:10 AM org.apache.coyote.AbstractProtocol start
    Infos: Starting ProtocolHandler ["ajp-bio-8007"]
    avr. 13, 2012 1:07:10 AM org.apache.catalina.startup.Catalina start
    Infos: Server startup in 5344 ms
    Last edited by yous18; Apr 13th, 2012, 05:46 AM.

  • #2
    i solved the probleme i just need to add jars in my lib (webinf/lib)
    aspectjrt.jar
    aspectjweaver.jar

    Comment

    Working...
    X