Announcement Announcement Module
Collapse
No announcement yet.
App unable to start due to it's inability to find mongo:mapping-converter Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • App unable to start due to it's inability to find mongo:mapping-converter

    Hey Guys
    I have updated to M3 of spring-data-mongodb and I am trying to add a custom ReadConverter but it's choking on my mapping-converter.

    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'mongo:mapping-converter'.

    This is usually due to a missing xmlns or an issue in the xsd but both look fine to me.
    Here is my mapping file:
    Code:
    <?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:context="http://www.springframework.org/schema/context" 
    	xmlns:mongo="http://www.springframework.org/schema/data/mongo"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans 
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context 
        http://www.springframework.org/schema/context/spring-context-3.0.xsd
       	http://www.springframework.org/schema/data/mongo
        http://www.springframework.org/schema/data/mongo/spring-mongo.xsd">
    
    	<mongo:repositories base-package="com.tot.model.repositories" />
    	<mongo:mongo host="localhost" port="27017" />
    
    
    
    	<mongo:repositories base-package="com.tot.model.dao.repository" />
    
    	<mongo:mapping-converter base-package="com.tot.model">
    		<mongo:custom-converters>
    			<mongo:converter ref="readConverter" />
    			<mongo:converter>
    				<bean class="com.tot.model.dao.repository.util.UserPointsReadConverter" />
    			</mongo:converter>
    		</mongo:custom-converters>
    	</mongo:mapping-converter>
    
    	<bean class="org.springframework.data.document.mongodb.MongoExceptionTranslator" />
    	<!-- To translate any MongoExceptions thrown in @Repository annotated classes -->
    	<bean id="mongo" class="org.springframework.data.document.mongodb.MongoFactoryBean">
    		<property name="host" value="localhost" />
    		<property name="port" value="27017" />
    	</bean>
    	<bean class="org.springframework.data.document.mongodb.repository.MongoRepositoryFactoryBean">
    		<property name="template" ref="mongoTemplate" />
    		<property name="repositoryInterface" value="com.tot.model.dao.repository.FeedItemDaoRepository" />
    	</bean>
    	<bean id="mongoTemplate" class="org.springframework.data.document.mongodb.MongoTemplate">
    		<constructor-arg ref="mongo" />
    		<constructor-arg value="database" />
    		<property name="defaultCollectionName" value="thisorthat" />
    	</bean>
    	<bean id="readConverter" class="com.tot.model.dao.repository.util.UserPointsReadConverter" />
    
    </beans>
    Any ideas?

  • #2
    My fault. My WEB-INF/lib didn't get updated with the right jars.
    Thanks

    Comment

    Working...
    X