Announcement Announcement Module
Collapse
No announcement yet.
Spring Data Document - MongoDB Support 1.0.0.M1 Released Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data Document - MongoDB Support 1.0.0.M1 Released

    Dear Spring Community,

    I am pleased to announce that the very first milestone release of the Spring Data Document 1.0 project with MongoDB support is now available!
    The primary goal of the <b>Spring Data</B> project is to make it easier to build Spring-powered applications that use new data access technologies such as non-relational databases, map-reduce frameworks, and cloud based data services.
    The MongoDB module provides integration with the MongoDB document database.

    Downloads | JavaDocs | Reference Documentation | Changelog

    To learn more about the project, visit the Spring Data Homepage.

    The features in Spring Data Document 1.0.0 M1 include:

    General
    • BeanFactory for basic configuration of Mongo environment
    • Namespace for basic configuration of Mongo environment

    Core Data Access
    • Introduce MongoTemplate implementation with methods defined in MongoOperations interface
    • MongoTemplate support for insert, find, save, update, remove
    • MongoTemplate support for basic POJO serialization based on bean properties
    • Allow MongoTemplate methods to use a default collection name
    • Exception translation in MongoTemplate to Spring's DAO exception hierarchy
    • Support for update modifiers to allow for partial document updates
    • Expose WriteConcern settings on MongoTemplate used for any write operations
    • Support in MongoTemplate for enabling either logging or throwing exceptions based on value of WriteResult return value.

    Repository
    • Introducing generic repository implementation for MongoDB
    • Automatic implementation of interface query method names on repositories.
    • Namespace support for Mongo repositories
    • Allow usage of pagination and sorting with repositories

    Looking forward to your feedback on the forum or in the issue tracker.
    Last edited by trisberg; Feb 25th, 2011, 02:18 PM.

  • #2
    Looking for examples? There are some in the spring-data-document-examples project.

    Comment


    • #3
      I'm trying to run some some examples, but having trouble getting the <mongo:repositories> scanning working with the M1 release. I had this working previously in one of the nightly snapshots from early February.

      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:mongo="http://www.springframework.org/schema/data/mongo"
      	xmlns:context="http://www.springframework.org/schema/context"
      	xsi:schemaLocation="http://www.springframework.org/schema/beans
              http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
              http://www.springframework.org/schema/data/mongo 
              http://www.springframework.org/schema/data/mongo/spring-mongo.xsd        
              http://www.springframework.org/schema/context
              http://www.springframework.org/schema/context/spring-context-3.0.xsd">
      
      	<context:component-scan base-package="org.mycompany" />
      
      	<mongo:repositories base-package="org.mycompany.*.repositories"
      		mongo-template-ref="mongoTemplate" />
      
      </beans>

      Stack trace:

      Code:
      Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 70 in XML document from file [C:\Documents and Settings\...\test\src\org\mycompany\springDataDocument\application-context.xml] is invalid; nested exception is org.xml.sax.SAXParseException: ct-props-correct.4: Error for type 'mongo-repository'. Duplicate attribute uses with the same name and target namespace are specified.  Name of duplicate attribute use is 'repository-impl-postfix'.
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:396)
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
      	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
      	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
      	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
      	at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
      	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
      	at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:92)
      	at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
      	at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
      	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
      	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
      	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:84)
      	at org.mycompany.springDataDocument.MongoTest.main(MongoTest.java:24)
      Caused by: org.xml.sax.SAXParseException: ct-props-correct.4: Error for type 'mongo-repository'. Duplicate attribute uses with the same name and target namespace are specified.  Name of duplicate attribute use is 'repository-impl-postfix'.
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
      	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
      	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
      	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:2537)
      	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2528)
      	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDAbstractTraverser.reportSchemaError(XSDAbstractTraverser.java:706)
      	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.handleComplexTypeError(XSDComplexTypeTraverser.java:1119)
      	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseComplexTypeDecl(XSDComplexTypeTraverser.java:285)
      	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDComplexTypeTraverser.traverseGlobal(XSDComplexTypeTraverser.java:160)
      	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.traverseSchemas(XSDHandler.java:1255)
      	at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:579)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:552)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2436)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1781)
      	at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:725)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
      	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
      	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
      	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
      	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
      	at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
      	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
      	at org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
      	at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
      	... 14 more
      Last edited by jzcfk9; Feb 23rd, 2011, 02:34 PM. Reason: forgot stack trace

      Comment


      • #4
        Make sure you have Spring Data Commons *M3* on the class path (the pom.xml of Spring Data Document M1 should actually reference to that). We've seen this issue popping up for users assuming you need all Spring Data dependencies in the same version, which is not the case here.

        Cheers,
        Ollie

        Comment

        Working...
        X