0

Hi following is my customMapping file.

<?xml version="1.0" encoding="UTF-8" ?> 

<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.c.DeploymentMapper">
<typeAlias type="org.bpmn.core.mgt.model.DeploymentMetaDataModel" alias="DeploymentMetaDataModel"/>
    <resultMap type="org.bpmn.core.mgt.model.DeploymentMetaDataModel" id="selectMetaDataMap">
        <id column="ID_" property="id"/>
        <result column="NAME_" property="packageName"/>
        <result column="TENANT_ID_" property="tenantID"/>
        <result column="CHECK_SUM_" property="checkSum"/>
    </resultMap>

    <!-- Default execution as PREPARED statements -->
    <select id="selectMetaData" resultMap="selectMetaDataMap">
        select * from BPS_BPMN_DEPLOYMENT_METADATA WHERE TENANT_ID_ = #{tenantID} AND NAME_ = #{name}
    </select>
</mapper>

When reading this file i'm given with this exception.

org.camunda.bpm.engine.ProcessEngineException: Error while building ibatis SqlSessionFactory: Error parsing SQL Mapper Configuration. 
Cause: org.apache.ibatis.builder.BuilderException: Error creating document instance.  
Cause: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 47; Document root element "mapper", must match DOCTYPE root "null". 
at org.camunda.bpm.engine.impl.cfg.ProcessEngineConfigurationImpl.initSqlSessionFactory(ProcessEngineConfigurationImpl.java:887)

this is my mappings.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd">

<configuration>
    <settings>
        <setting name="lazyLoadingEnabled" value="false" />
    </settings>
    <mappers>
        <mapper resource="DeploymentMapper.xml" />
    </mappers>
</configuration>

Any idea on what is wrong with my mappings file?

mvlaicevich
  • 103
  • 1
  • 8
user2894296
  • 590
  • 1
  • 10
  • 20

1 Answers1

1

The element typeAliase is not allowed in a mapping file. It can be part of the configuration typeAliases section.