Results 1 to 5 of 5

Thread: Valldation error from Spring IDE Plugin

  1. #1
    Join Date
    Nov 2004
    Posts
    159

    Default Valldation error from Spring IDE Plugin

    I've installed spring IDE plug-in in Eclipse. I add the two config files in my project(applicationContext-hibernate.xml and dataAccess-local.xml) to the Spring IDE Projects.

    When i opened the dataAccess-Local.xml file in Eclipse, there's a problem marker but i DON'T see the corresponding error message in the 'Problems' task view. It seems to look correct.

    Could someone please point out why i'm NOT seeing the corresponding error message and also what's wrong with this config file?

    Thanks!

    Code:
    <beans>
    
    	<!-- ========================= RESOURCE DEFINITIONS ========================= -->
    
    	<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
    		<property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property>
    		<property name="url"><value>jdbc&#58;mysql&#58;//localhost&#58;3306/rmtdb</value></property>
    		<property name="username"><value>rmtuser</value></property>
    		<property name="password"><value>rmtuser</value></property>
    	</bean>
    
    	<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
    		<property name="dataSource"><ref local="dataSource"/></property>
    ** *		<property name="mappingLocations"> 
     * ** ** *<list> 
     * ** ** ** *<value>/META-INF/**/*.hbm.xml<value> 
     * ** ** *</list> 
     * ** * </property> 
     
    		<property name="hibernateProperties">
    			<props>
    				<prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop>
    			</props>
    		</property>
    	</bean>
    	
    	<!-- ========================= DAO DEFINITIONS&#58; Hibernate IMPLEMENTATIONS ========================= -->
    
    	<bean id="requirementDao" class="com.apple.irmt.dao.Hibernate.HibernateRequirementDao">
    		<property name="dataSource"><ref local="dataSource"/></property>
    	</bean>
    
    	<bean id="projectDao" class="com.apple.irmt.dao.Hibernate.HibernateProjectDao">
    		<property name="dataSource"><ref local="dataSource"/></property>
    	</bean>
    
    	<bean id="ResourceDao" class="com.apple.irmt.dao.Hibernate.HibernateResourceDao">
    		<property name="dataSource"><ref local="dataSource"/></property>
    	</bean>
    
    
    </beans>

  2. #2
    Join Date
    Nov 2004
    Posts
    159

    Default

    My other config file applicationContext-hibernate.xml is as follows:

    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>
    	<!--
    		- A parent bean definition which is a base definition for transaction proxies.
    		- It's marked as abstract, since it's not supposed to be instantiated itself.
    		- We set shared transaction attributes here, following our naming patterns.
    		- The attributes can still be overridden in child bean definitions.
        -->
    	<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="update*">PROPAGATION_REQUIRED</prop>
    				<prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
    			</props>
    		</property>
    	</bean>
    
    	<!--
    	  - RMT primary business object &#40;default implementation&#41;, as an inner bean wrapped
    		- by an outer transactional proxy. The two bean definitions could have been separate,
    		- but this is cleaner as there is no need to ever access the unwrapped object.
    		-->
    	<bean id="RMT" parent="baseTransactionProxy">
    		<property name="target">
    			<bean class="com.apple.irmt.domain.logic.iRMTImpl">
    				<property name="projectDao"><ref bean="projectDao"/></property>
    				<property name="requirementDao"><ref bean="requirementDao"/></property>
    				<property name="resourceDao"><ref bean="resourceDao"/></property>
    			</bean>
    		</property>
    	</bean>
    
    </beans>

  3. #3
    Join Date
    Nov 2004
    Posts
    159

    Default

    After reading some posts regarding this problem, i modified my dataAccess-local.xml file as follows: I'm getting exception now. Could someone please let me know what's the problem?

    Thanks!

    Code:
    	<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
    		<property name="dataSource"><ref local="dataSource"/></property>
            <property name="mappingLocations">* *
     * ** ** *  <value>/META-INF/**/*.hbm.xml</value> 
     * ** * </property> 
     *		<property name="hibernateProperties">
    			<props>
    				<prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop>
    			</props>
    		</property>
    	</bean> 
    
    
    I'm getting the following exception in my JUnit test case.
    
    
    Line 26 in XML document from class path resource &#91;META-INF/dataAccess-local.xml&#93; is invalid; nested exception is org.xml.sax.SAXParseException&#58; Element "bean" does not allow text.
    
    org.springframework.beans.factory.BeanDefinitionStoreException&#58; Line 26 in XML document from class path resource &#91;META-INF/dataAccess-local.xml&#93; is invalid; nested exception is org.xml.sax.SAXParseException&#58; Element "bean" does not allow text.org.xml.sax.SAXParseException&#58; Element "bean" does not allow text. at org.apache.crimson.parser.Parser2.error&#40;Parser2.java&#58;3354&#41; at org.apache.crimson.parser.ValidatingParser$ChildrenValidator.text&#40;ValidatingParser.java&#58;355&#41; at org.apache.crimson.parser.InputEntity.parsedContent&#40;InputEntity.java&#58;597&#41; at org.apache.crimson.parser.Parser2.content&#40;Parser2.java&#58;2010&#41; at org.apache.crimson.parser.Parser2.maybeElement&#40;Parser2.java&#58;1691&#41; at org.apache.crimson.parser.Parser2.content&#40;Parser2.java&#58;1963&#41; at org.apache.crimson.parser.Parser2.maybeElement&#40;Parser2.java&#58;1691&#41; at org.apache.crimson.parser.Parser2.parseInternal&#40;Parser2.java&#58;667&#41; at org.apache.crimson.parser.Parser2.parse&#40;Parser2.java&#58;337&#41; at org.apache.crimson.parser.XMLReaderImpl.parse&#40;XMLReaderImpl.java&#58;448&#41; at org.apache.crimson.jaxp.DocumentBuilderImpl.parse&#40;DocumentBuilderImpl.java&#58;185&#41; at javax.xml.parsers.DocumentBuilder.parse&#40;DocumentBuilder.java&#58;76&#41; at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions&#40;XmlBeanDefinitionReader.java&#58;128&#41; at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions&#40;AbstractXmlApplicationContext.java&#58;144&#41; at org.springframework.context.support.AbstractXmlApplicationContext.refreshBeanFactory&#40;AbstractXmlApplicationContext.java&#58;79&#41; at org.springframework.context.support.AbstractApplicationContext.refresh&#40;AbstractApplicationContext.java&#58;249&#41; at org.springframework.context.support.ClassPathXmlApplicationContext.<init>&#40;ClassPathXmlApplicationContext.java&#58;80&#41; at org.springframework.context.support.ClassPathXmlApplicationContext.<init>&#40;ClassPathXmlApplicationContext.java&#58;65&#41; at com.apple.irmt.domain.AbstractRMTTests.setUp&#40;AbstractRMTTests.java&#58;24&#41; at com.apple.irmt.domain.ProjectTests.setUp&#40;ProjectTests.java&#58;30&#41;
    <code>

  4. #4
    Join Date
    Nov 2004
    Posts
    159

    Default

    Could someone PLEASE HELP finding out why i'm not seeing error message provided by the Spring-plugin and what's the problem in my spring configuration file?

    Thanks!

  5. #5
    Join Date
    Aug 2004
    Location
    Toulouse, France
    Posts
    148

    Default

    It complains about the fact that some plain text is child of one of your bean tag.
    Can you post the whole file so that we can see which is the line 26 and its environment ?
    also, can you use an xml outline view to check which children do your bean tag have ?
    Olivier

Similar Threads

  1. Spring MVC Web Framework versus Struts
    By biguniverse in forum Web Flow
    Replies: 27
    Last Post: Aug 29th, 2012, 03:57 AM
  2. Spring plugin for Eclipse
    By spring04 in forum SpringSource Tool Suite
    Replies: 7
    Last Post: Dec 22nd, 2006, 12:47 PM
  3. can any tell me how to create project using Spring Plugin
    By chandra_yalla in forum SpringSource Tool Suite
    Replies: 1
    Last Post: Mar 25th, 2005, 03:36 AM
  4. Replies: 14
    Last Post: Feb 21st, 2005, 05:41 PM
  5. Replies: 8
    Last Post: Nov 21st, 2004, 09:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •