title: myBatis xml map causing namespace must be declared for element type mapper
body: <p>Is there anything obvious wrong with this setup please. On app startup I get Attribute "namespace" must be declared for element type "mapper", when it clearly is declared.</p>
  
  <p>spring xml resource dao.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:util="http://www.springframework.org/schema/util"
  xmlns:jms="http://www.springframework.org/schema/jms"
  xsi:schemaLocation="http://www.springframework.org/schema/beans
                      http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                      http://www.springframework.org/schema/util
                      http://www.springframework.org/schema/util/spring-util-3.2.xsd
                      http://www.springframework.org/schema/jms http://www.springframework.org/schema/jms/spring-jms-2.5.xsd"&gt;
  
  &lt;bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"&gt;
      &lt;property name="jndiName" value="java:comp/env/JNDINAME"/&gt;
      &lt;property name="lookupOnStartup" value="true"/&gt;
      &lt;property name="cache" value="true"/&gt;
      &lt;property name="proxyInterface" value="javax.sql.DataSource"/&gt;      
  &lt;/bean&gt; 
  
  &lt;bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="mapperScanner" class="org.mybatis.spring.mapper.MapperScannerConfigurer"&gt; 
      &lt;property name="basePackage" value="com.mycompany.dao"/&gt; 
      &lt;property name="sqlSessionFactory" ref="sqlSessionFactory"/&gt; 
  &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Interface:</p>
  
  <pre><code>public interface MyDAO {    
      public void save(@Param("id") String id);
  }
  </code></pre>
  
  <p>Mapper xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
  &lt;!DOCTYPE configuration
      PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
      "http://mybatis.org/dtd/mybatis-3-config.dtd"&gt;
  
  &lt;configuration&gt;
  
  &lt;mapper namespace="com.mycompany.dao"&gt;
  
  &lt;typeAlias alias="xxxVO" type="com.xxx" /&gt;
  
  &lt;insert id="save" parameterType="string"&gt;
      SOME SQL etc
  &lt;/insert&gt;
  
  &lt;/mapper&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>The Interface is in <code>src/main/java/com/mycompany/dao</code>
  The mapper xml in in <code>src/main/resources/com/mycompany/dao</code></p>
  
  <p>My pom has</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;org.mybatis&lt;/groupId&gt;
          &lt;artifactId&gt;mybatis-spring&lt;/artifactId&gt;
          &lt;version&gt;1.0.1&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Actual error:</p>
  
  <pre><code>Caused by: org.xml.sax.SAXParseException: Attribute "namespace" must be declared for element type "mapper".
      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.XMLErrorReporter.reportError(XMLErrorReporter.java:318)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.addDTDDefaultAttrsAndValidate(XMLDTDValidator.java:1275)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDValidator.java:1940)
      at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:764)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
      at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
      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.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:236)
  </code></pre>
  
  <p>Thanks in advance</p>