Announcement Announcement Module
Collapse
No announcement yet.
Cannot locate BeanDefinitionParser for element [scoped-proxy] Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot locate BeanDefinitionParser for element [scoped-proxy]

    Here is my applicationContext.xml:

    <?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="http://www.springframework.org/schema/p"
    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/schem...-beans-2.5.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schem...ng-aop-2.5.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">

    <!--bean id="propertyConfigurer"
    class="org.springframework.beans.factory.config.Pr opertyPlaceholderConfigurer"
    p:location="/WEB-INF/jdbc.properties" />

    <bean id="dataSource"
    class="org.springframework.jdbc.datasource.DriverM anagerDataSource"
    p:driverClassName="${jdbc.driverClassName}"
    p:url="${jdbc.url}"
    p:username="${jdbc.username}"
    password="${jdbc.password}" /-->

    <!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc) -->
    <aop:scoped-proxy proxy-target-class="false"/>
    <bean id="sample" class="com.sample.Sample"/>
    <bean id="methodTimingAdvice"
    class="com.sample.MethodTimingAdvice" />
    <!-- Proxy Implementation Class -->
    <bean id = "timer"
    class = "org.springframework.aop.framework.ProxyFactoryBea n">

    <property name = "proxyInterfaces">
    <value>com.sample.SampleInf</value>
    </property>

    <property name = "interceptorNames">
    <list>
    <value>methodTimingAdvice</value>
    </list>
    </property>

    <property name = "target">
    <ref bean = "sample"/>
    </property>
    </bean>
    </beans>

    I'm using NetBeans, and i have included the following jars:
    cglib-nodep-2.1_3.jar
    asm-3.0_RC1.jar
    aopalliance.jar
    commons-logging.jar
    spring.jar

    When i try to run com.sample.Sample program, it is giving the following error:

    Aug 6, 2010 3:36:18 AM org.springframework.context.support.AbstractApplic ationContext prepareRefresh
    INFO: Refreshing org.springframework.context.support.ClassPathXmlAp plicationContext@13a328f: display name [org.springframework.context.support.ClassPathXmlAp plicationContext@13a328f]; startup date [Fri Aug 06 03:36:18 IST 2010]; root of context hierarchy
    Aug 6, 2010 3:36:18 AM org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [dispatcher-servlet.xml]
    Aug 6, 2010 3:36:21 AM org.springframework.beans.factory.xml.XmlBeanDefin itionReader loadBeanDefinitions
    INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
    Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefi nitionParsingException: Configuration problem: Cannot locate BeanDefinitionParser for element [scoped-proxy]
    Offending resource: class path resource [applicationContext.xml]
    at org.springframework.beans.factory.parsing.FailFast ProblemReporter.fatal(FailFastProblemReporter.java :59)
    at org.springframework.beans.factory.parsing.ReaderCo ntext.fatal(ReaderContext.java:68)
    at org.springframework.beans.factory.parsing.ReaderCo ntext.fatal(ReaderContext.java:55)
    at org.springframework.beans.factory.xml.NamespaceHan dlerSupport.findParserForElement(NamespaceHandlerS upport.java:79)
    at org.springframework.beans.factory.xml.NamespaceHan dlerSupport.parse(NamespaceHandlerSupport.java:69)
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1123)
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition ParserDelegate.java:1113)
    at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau ltBeanDefinitionDocumentReader.java:133)
    at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.registerBeanDefinitions(De faultBeanDefinitionDocumentReader.java:90)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.registerBeanDefinitions(XmlBeanDefinit ionReader.java:468)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.doLoadBeanDefinitions(XmlBeanDefinitio nReader.java:363)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:313)
    at org.springframework.beans.factory.xml.XmlBeanDefin itionReader.loadBeanDefinitions(XmlBeanDefinitionR eader.java:290)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:131)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:147)
    at org.springframework.beans.factory.support.Abstract BeanDefinitionReader.loadBeanDefinitions(AbstractB eanDefinitionReader.java:173)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:112)
    at org.springframework.context.support.AbstractXmlApp licationContext.loadBeanDefinitions(AbstractXmlApp licationContext.java:79)
    at org.springframework.context.support.AbstractRefres hableApplicationContext.refreshBeanFactory(Abstrac tRefreshableApplicationContext.java:101)
    at org.springframework.context.support.AbstractApplic ationContext.obtainFreshBeanFactory(AbstractApplic ationContext.java:394)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:324)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:122)
    at org.springframework.context.support.ClassPathXmlAp plicationContext.<init>(ClassPathXmlApplicationCon text.java:76)
    at com.sample.Test.main(Test.java:20)
    Java Result: 1


    I appreciate your help in resolving this issue

  • #2
    Please use [ code][/code ] tags when posting code ...

    aop scoped-proxy isn't a top level xml element. It is to be used as a sub element of the bean element.
    Last edited by Marten Deinum; Aug 9th, 2010, 03:49 AM.

    Comment


    • #3
      did you have an example?

      Comment

      Working...
      X