facebook

XML Validation Issues: Spring & iBATIS [Closed]

  1. MyEclipse IDE
  2.  > 
  3. Java EE Development (EJB, JSP, Struts, XDoclet, etc.)
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #222462 Reply

    Rob
    Member

    Hi,

    This is a different issue as reported in an earlier thread. I currently have a Spring/iBATIS project in Eclipse 3.0.1 and MyEclipse 3.8.3. I have the project set up as a J2EE-Web/Struts project.

    For some reason, the MyEclipse parser is choking on the following:

    <bean id=”baseTransactionProxy” class=”org.springframework.transaction.interceptor.TransactionProxyFactoryBean” abstract=”true”>
    <property name=”transactionManager”><ref bean=”transactionManager”/></property>
    <property name=”transactionAttributes”>
    <props>
    <prop key=”insert*”>PROPAGATION_REQUIRED</prop>
    <prop key=”create*”>PROPAGATION_REQUIRED</prop>
    <prop key=”update*”>PROPAGATION_REQUIRED</prop>
    <prop key=”*”>PROPAGATION_REQUIRED,readOnly</prop>
    </props>
    </property>
    </bean>

    The Error: Attribute “abstract” must be declared for element type “bean”.

    …as you can see, the element is declared. The project deploys and works perfectly, and this in fact, is the applicationContext.xml from the jPetstore Demo.

    I am also getting a similar error on an sqlMap XML file. The same type of error where the parser is expecting an Attribute that is there in the code.

    This project works fine, and the ONLY problem I am having is with the project added as a STRUTS/Web project. Before I enabled Struts through MyEclipse, everything was fine….

    Thanks!

    Rob.

    #222464 Reply

    Scott Anderson
    Participant

    Rob,

    We’ve run down the issue around ‘abstract’ in this thread:
    http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-5392-highlight-spring+catalog+catalogue+abstract.html

    #222544 Reply

    Rob
    Member

    I have tried this fix, and have not seen any results.

    I am also having strange issues where the XML editor will put an error mark, saying “Missing closing quote”. There is no quote missing, and when I click on
    “MyEclipse” –> Run Validation, everything works fine.

    Why is the XML editor so buggy, and when can we expect some patches?

    Thanks.

    Rob.

    #222551 Reply

    Riyad Kalla
    Member

    Rob,
    Just to clarify, you followed this thread: http://www.myeclipseide.com/PNphpBB2+file-viewtopic-t-5331-highlight-spring+dtd+abstract.html and updated the Catalog entry for the DTD correct?

    If so, right click on your XML file > Open With and check that the “MyEclipse XML Editor” is the default editor; we are not aware of any outstanding bugs with the XML editor so the fact that you are getting so much flakiness makes me think this might be a setup issue. Can you check your log file for possible exceptions from the XML editor (workspace dir\.metadata\.log) to see if we can get to the bottom of this?

    #222555 Reply

    Rob
    Member

    Thanks. I verified the steps, and the MyEclipse Catalog entries are correct.

    Restarted Eclipse…

    I opened the file in the MyEclipse XML Editor (default), right-clicked on the document and ran “Validate XML File”: “The XML file is not valid. See the Problems view for a list of the validation errors.”

    I right-clicked on the file (in the explorer view), and selected MyEclipse –> Run Validation: “Validation of resource /proj_name/docroot/WEB-INF/applicationContext.xml is complete.”

    Through all this, ME displays the problem markers on the margin borders, and reports the error in the “Problems” View.

    There are no errors in the log file.

    #222556 Reply

    Riyad Kalla
    Member

    Strange, can you paste the file contents here so I can try it locally and file a bug with the problem if I find one? Please wrap the XML in code tags so it maintains format (hit Post Reply and use Code button to do it automatically)

    #222560 Reply

    Rob
    Member

    Here it is:

    
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    
        <!-- ========================= GENERAL DEFINITIONS ========================= --> 
        <bean id="propertyConfigurer" 
              class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> 
            <property name="locations">
                <list> 
                  <value>WEB-INF/mail.properties</value> 
                  <value>WEB-INF/jdbc.properties</value> 
                </list> 
            </property> 
        </bean>
    
    
        <!-- ========================= BUSINESS OBJECT DEFINITIONS ======================== -->
    
        <bean id="accountValidator" class="com.comerxia.idc.domain.logic.AccountValidator"/>
        <bean id="orderValidator" class="com.comerxia.idc.domain.logic.OrderValidator"/>
    
        <bean id="baseTransactionProxy" 
              abstract="true"
              class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean" > 
            <property name="transactionManager"><ref bean="transactionManager"/></property> 
            <property name="transactionAttributes">
                <props>
                    <prop key="insert*">PROPAGATION_REQUIRED</prop>
                    <prop key="create*">PROPAGATION_REQUIRED</prop>
                    <prop key="update*">PROPAGATION_REQUIRED</prop> 
                    <prop key="*">PROPAGATION_REQUIRED,readOnly</prop> 
                </props>
              </property> 
        </bean>
    
        <bean id="idc" parent="baseTransactionProxy">
            <property name="target">
                <bean class="com.comerxia.idc.domain.logic.IDCImpl">
                    <property name="merchantUserDao"><ref bean="merchantUserDao"/></property>
                    <property name="merchantDao"><ref bean="merchantDao"/></property>
                    <property name="merchantPODao"><ref bean="merchantPODao"/></property>
                    <property name="securityDao"><ref bean="securityDao"/></property> 
                    <property name="orderItemDao"><ref bean="orderItemDao"/></property>
                    <property name="orderDao"><ref bean="orderDao"/></property>
                    <property name="logDao"><ref bean="logDao"/></property> 
                </bean>
            </property>
        </bean>
    
    </beans>
    
    #222564 Reply

    Riyad Kalla
    Member

    Here is what I did:
    1) Pasted these contents into a brand new empty spring.xml file
    2) CTRL-S to save, validation error talking about ‘abstract’ popped up
    3) Tried right-click validate from tree, still failed.
    4) Followed instructions from post above to update the DTD in the catalog by adding a new user entry
    5) Hit OK on the preference dialog
    6) Right click > Validate XML file, validation was successful and problem marker was removed.

    Please paste the contents of your XML Catalog entry from the “User Specified Entry” section here so I can see if it differs from mine. I just followed the post exactly.

    #222696 Reply

    Rob
    Member

    OK, I got it working now. I triple-checked the KEY value in Catalog entery and found a trailing space (Damn the Cut & Paste Inventor !!! ).

    Now everything is validating. Thank you for your patience. 🙂

    #222697 Reply

    Riyad Kalla
    Member

    Glad it is working now

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: XML Validation Issues: Spring & iBATIS [Closed]

You must be logged in to post in the forum log in