Announcement Announcement Module
Collapse
No announcement yet.
Problem using <aop:config> Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem using <aop:config>

    Hello,

    I have a simple applicationContext file shown below:

    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans>
    <bean id="testBean" class="test.TestBeanImpl"></bean>
    <aop:config>
    </aop:config>
    </beans>
    When I load this application context, I get the following exception:

    Code:
    29-Oct-2008 18:01:59 org.springframework.context.support.AbstractApplicationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1c1ea29: display name [org.springframework.context.support.ClassPathXmlApplicationContext@1c1ea29]; startup date [Wed Oct 29 18:01:59 GMT 2008]; root of context hierarchy
    29-Oct-2008 18:01:59 org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [app.xml]
    29-Oct-2008 18:02:00 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory
    INFO: Bean factory for application context [org.springframework.context.support.ClassPathXmlApplicationContext@1c1ea29]: org.springframework.beans.factory.support.DefaultListableBeanFactory@16546ef
    29-Oct-2008 18:02:00 org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker postProcessAfterInitialization
    INFO: Bean 'org.springframework.aop.config.internalAutoProxyCreator' is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
    29-Oct-2008 18:02:00 org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
    INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@16546ef: defining beans [aBean,org.springframework.aop.config.internalAutoProxyCreator]; root of factory hierarchy
    29-Oct-2008 18:02:00 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
    INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@16546ef: defining beans [aBean,org.springframework.aop.config.internalAutoProxyCreator]; root of factory hierarchy
    Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'aBean' defined in class path resource [app.xml]: Instantiation of bean failed; nested exception is java.lang.AbstractMethodError: org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.determineConstructor(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Constructor;
    Caused by: java.lang.AbstractMethodError: org.springframework.aop.aspectj.autoproxy.AspectJAwareAdvisorAutoProxyCreator.determineConstructor(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Constructor;
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineConstructorFromBeanPostProcessors(AbstractAutowireCapableBeanFactory.java:741)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:714)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66)
        at test.Test.main(Test.java:10)
    If I remove <aop:config> tag, I don't get the error (in that case, there will be nothing left in the application context !)

    I am using Spring framework 2.5.5.

    Could you please let me know what is the problem ?

  • #2
    Hi Jayarama,

    I've faced the same problem in the past, this could be any issue with the JAR file imports. Please make sure you give priority to Spring JARs in the classpath. Hope it helps.

    Regards,
    Sripathi

    Comment


    • #3
      Problem Solved

      Hi Sripathi,

      That resolved the problem. Thanks for the quick response.

      Comment


      • #4
        it's seeems that you are using a wrong version of aspectjweaver.jar

        Comment

        Working...
        X