Announcement Announcement Module
Collapse
No announcement yet.
abstract bean Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • abstract bean

    Hi,

    I have a config file that's based on the new JPetStore applicationContext.xml. I received an error:

    Code:
    org.xml.sax.SAXParseException: Attribute "abstract" must be declared for element type "bean".
    Am I missing something obvious? Thanks!

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http&#58;//www.springframework.org/dtd/spring-beans.dtd">
    
    <beans>
     <!-- data source, transaction manager etc  omitted -->
    
        <bean id="baseTransactionProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" abstract="true" >
            <property name="transactionManager">
                <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
                    <property name="dataSource"><ref local="dataSource"/></property>
                </bean>
            </property>
            <property name="transactionAttributes">
                <props>
                    <prop key="insert*">PROPAGATION_REQUIRED</prop>
                    <prop key="update*">PROPAGATION_REQUIRED</prop>
                    <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
                </props>
            </property>
        </bean>
    
        <bean id="proxiedProdDao" parent="baseTransactionProxy">
            <property name="target">
                <ref bean="productDao"/>
            </property>
        </bean>
    
    	<bean id="productDao" class="org.springframework.samples.jpetstore.dao.MrPersister.MPProductDao">
    		<property name="dataSource"><ref local="dataSource"/></property>
    	</bean>
    </beans>

  • #2
    This will only work in Spring 1.1. However, the spring-beans.dtd file on springframework.org appears to be out of date, and doesn't have this new attribute. We'll get it fixed promptly.

    Comment


    • #3
      The dtd on www.springframework.org/dtd/spring-beans.dtd is the one that is in the latest 1.1 release. Are you looking at a cached version?

      Comment


      • #4
        Of course I was my fault! Too many copies of Spring hanging around...

        I absolutely love the new "abstract" feature. My config file looks much cleaner now. Thanks guys!

        Comment


        • #5
          I had this same problem with MyEclipse. It appears to have its own versions of the Spring dtd at these locations:

          C:\Program Files\MyEclipse\eclipse\plugins\com.ibm.webtooling .system.dtds_13.8.1\dtds\spring-beans.dtd
          C:\Program Files\MyEclipse\eclipse\plugins\com.genuitec.eclip se.xmen_3.8.1\dtd\http___www.springframework.org_d td_spring-beans.dtd

          Replacing them with the latest version fixed the problem.

          Comment

          Working...
          X